From: Bill Wendling Date: Wed, 4 May 2011 02:40:38 +0000 (+0000) Subject: Convert the non-temporal store builtins to LLVM-native IR. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b51bddab211ba7daa8832c017d82281e0d8348d1;p=clang Convert the non-temporal store builtins to LLVM-native IR. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130830 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGBuiltin.cpp b/lib/CodeGen/CGBuiltin.cpp index 7a0c8da502..c2f1ebd122 100644 --- a/lib/CodeGen/CGBuiltin.cpp +++ b/lib/CodeGen/CGBuiltin.cpp @@ -2154,6 +2154,23 @@ Value *CodeGenFunction::EmitX86BuiltinExpr(unsigned BuiltinID, LI->setAlignment(1); // Unaligned load. return Builder.CreateBitCast(LI, VecTy, "loadu.cast"); } + case X86::BI__builtin_ia32_movntps: + case X86::BI__builtin_ia32_movntpd: + case X86::BI__builtin_ia32_movntdq: + case X86::BI__builtin_ia32_movnti: { + llvm::SmallVector Elts; + Elts.push_back(llvm::ConstantInt::get(Int32Ty, 1)); + llvm::MDNode *Node = llvm::MDNode::get(getLLVMContext(), Elts); + + // Convert the type of the pointer to a pointer to the stored type. + Value *BC = Builder.CreateBitCast(Ops[0], + llvm::PointerType::getUnqual(Ops[1]->getType()), + "cast"); + StoreInst *SI = Builder.CreateStore(Ops[1], BC); + SI->setMetadata(CGM.getModule().getMDKindID("nontemporal"), Node); + SI->setAlignment(16); + return SI; + } // 3DNow! case X86::BI__builtin_ia32_pavgusb: case X86::BI__builtin_ia32_pf2id: