r188722 - Simplify code by using CreateMemTemp. No functional change intended.
Michael Gottesman
mgottesman at apple.com
Mon Aug 19 15:59:04 PDT 2013
I believe this broke the public llvm builder:
http://lab.llvm.org:8013/builders/phase1%20-%20sanity/builds/10418
Can you fix/revert.
Michael
On Aug 19, 2013, at 3:20 PM, Juergen Ributzka <juergen at apple.com> wrote:
> Author: ributzka
> Date: Mon Aug 19 17:20:37 2013
> New Revision: 188722
>
> URL: http://llvm.org/viewvc/llvm-project?rev=188722&view=rev
> Log:
> Simplify code by using CreateMemTemp. No functional change intended.
>
> Reviewer: Eli
>
> 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=188722&r1=188721&r2=188722&view=diff
> ==============================================================================
> --- cfe/trunk/lib/CodeGen/CGBuiltin.cpp (original)
> +++ cfe/trunk/lib/CodeGen/CGBuiltin.cpp Mon Aug 19 17:20:37 2013
> @@ -2019,9 +2019,7 @@ Value *CodeGenFunction::EmitARMBuiltinEx
> Function *F = CGM.getIntrinsic(Intrinsic::arm_strexd);
> llvm::Type *STy = llvm::StructType::get(Int32Ty, Int32Ty, NULL);
>
> - Value *One = llvm::ConstantInt::get(Int32Ty, 1);
> - Value *Tmp = Builder.CreateAlloca(ConvertType(E->getArg(0)->getType()),
> - One);
> + Value *Tmp = CreateMemTemp(E->getArg(0)->getType());
> Value *Val = EmitScalarExpr(E->getArg(0));
> Builder.CreateStore(Val, Tmp);
>
> @@ -2928,19 +2926,15 @@ Value *CodeGenFunction::EmitX86BuiltinEx
> return Builder.CreateExtractElement(Ops[0],
> llvm::ConstantInt::get(Ops[1]->getType(), 0));
> case X86::BI__builtin_ia32_ldmxcsr: {
> - llvm::Type *PtrTy = Int8PtrTy;
> - Value *One = llvm::ConstantInt::get(Int32Ty, 1);
> - Value *Tmp = Builder.CreateAlloca(Int32Ty, One);
> + Value *Tmp = CreateMemTemp(E->getArg(0)->getType());
> Builder.CreateStore(Ops[0], Tmp);
> return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::x86_sse_ldmxcsr),
> - Builder.CreateBitCast(Tmp, PtrTy));
> + Builder.CreateBitCast(Tmp, Int8PtrTy));
> }
> case X86::BI__builtin_ia32_stmxcsr: {
> - llvm::Type *PtrTy = Int8PtrTy;
> - Value *One = llvm::ConstantInt::get(Int32Ty, 1);
> - Value *Tmp = Builder.CreateAlloca(Int32Ty, One);
> + Value *Tmp = CreateMemTemp(E->getArg(0)->getType());
> Builder.CreateCall(CGM.getIntrinsic(Intrinsic::x86_sse_stmxcsr),
> - Builder.CreateBitCast(Tmp, PtrTy));
> + Builder.CreateBitCast(Tmp, Int8PtrTy));
> return Builder.CreateLoad(Tmp, "stmxcsr");
> }
> case X86::BI__builtin_ia32_storehps:
> @@ -3131,13 +3125,10 @@ Value *CodeGenFunction::EmitX86BuiltinEx
> }
> // AVX2 broadcast
> case X86::BI__builtin_ia32_vbroadcastsi256: {
> - llvm::Type *VecTy = llvm::VectorType::get(Int64Ty, 2);
> - llvm::Type *PtrTy = Int8PtrTy;
> - Value *One = llvm::ConstantInt::get(Int32Ty, 1);
> - Value *Tmp = Builder.CreateAlloca(VecTy, One);
> - Builder.CreateStore(Ops[0], Tmp);
> - return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::x86_avx2_vbroadcasti128),
> - Builder.CreateBitCast(Tmp, PtrTy));
> + Value *VecTmp = CreateMemTemp(E->getArg(0)->getType());
> + Builder.CreateStore(Ops[0], VecTmp);
> + Value *F = CGM.getIntrinsic(Intrinsic::x86_avx2_vbroadcasti128);
> + return Builder.CreateCall(F, Builder.CreateBitCast(VecTmp, Int8PtrTy));
> }
> }
> }
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130819/e0aaabf2/attachment.html>
More information about the cfe-commits
mailing list