[cfe-commits] r130830 - /cfe/trunk/lib/CodeGen/CGBuiltin.cpp

Bill Wendling isanbard at gmail.com
Tue May 3 19:40:39 PDT 2011


Author: void
Date: Tue May  3 21:40:38 2011
New Revision: 130830

URL: http://llvm.org/viewvc/llvm-project?rev=130830&view=rev
Log:
Convert the non-temporal store builtins to LLVM-native IR.

Modified:
    cfe/trunk/lib/CodeGen/CGBuiltin.cpp

Modified: cfe/trunk/lib/CodeGen/CGBuiltin.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBuiltin.cpp?rev=130830&r1=130829&r2=130830&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGBuiltin.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGBuiltin.cpp Tue May  3 21:40:38 2011
@@ -2154,6 +2154,23 @@
     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:





More information about the cfe-commits mailing list