aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2011-05-04 02:40:38 +0000
committerBill Wendling <isanbard@gmail.com>2011-05-04 02:40:38 +0000
commitb51bddab211ba7daa8832c017d82281e0d8348d1 (patch)
treedff6cf461882de6169d8e7e02c3d9a5478a853cd
parent3c989fc446fd8118aba964e8e0005ae510e4c621 (diff)
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
-rw-r--r--lib/CodeGen/CGBuiltin.cpp17
1 files changed, 17 insertions, 0 deletions
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<Value *, 1> 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: