[cfe-commits] r130830 - /cfe/trunk/lib/CodeGen/CGBuiltin.cpp
Chris Lattner
clattner at apple.com
Wed May 4 05:53:03 PDT 2011
On May 3, 2011, at 7:40 PM, Bill Wendling wrote:
> 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.
Thanks Bill,
MDNode::get takes an ArrayRef, so you don't need the SmallVector temporary, just pass the ConstantInt in directly. Also, IRBuilder has a helper to get i32 constants, something like Builder->getInt32(1)
-Chris
>
> 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:
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
More information about the cfe-commits
mailing list