summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2019-02-13 19:04:26 +0000
committerNico Weber <nicolasweber@gmx.de>2019-02-13 19:04:26 +0000
commitacf81a7c149f7c2c6a987f1d2cabbd6ed39e8804 (patch)
treec973d5e3c1226565d882f225805ea1386714156b /clang/lib/CodeGen
parent4134143cf55d5cb68be12dd8511cdc7a254e31df (diff)
downloadbcm5719-llvm-acf81a7c149f7c2c6a987f1d2cabbd6ed39e8804.tar.gz
bcm5719-llvm-acf81a7c149f7c2c6a987f1d2cabbd6ed39e8804.zip
Re-enable the test disabled in r353836 and hopefully make it pass in gcc builds
Argument evaluation order is different between gcc and clang, so pull out the Builder calls to make the generated IR independent of the host compiler's argument evaluation order. Thanks to rnk for reminding me of this clang/gcc difference. llvm-svn: 353969
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGBuiltin.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp
index fd5a6ab8ff3..a02fd486e61 100644
--- a/clang/lib/CodeGen/CGBuiltin.cpp
+++ b/clang/lib/CodeGen/CGBuiltin.cpp
@@ -11854,9 +11854,10 @@ Value *CodeGenFunction::EmitX86BuiltinExpr(unsigned BuiltinID,
// Ops[2] = Builder.CreateZExt(Ops[2], Int64Ty);
// return Builder.CreateCall(F, Ops);
llvm::Type *Int128Ty = Builder.getInt128Ty();
- Value *Val = Builder.CreateOr(
- Builder.CreateShl(Builder.CreateZExt(Ops[1], Int128Ty), 64),
- Builder.CreateZExt(Ops[0], Int128Ty));
+ Value *HighPart128 =
+ Builder.CreateShl(Builder.CreateZExt(Ops[1], Int128Ty), 64);
+ Value *LowPart128 = Builder.CreateZExt(Ops[0], Int128Ty);
+ Value *Val = Builder.CreateOr(HighPart128, LowPart128);
Value *Amt = Builder.CreateAnd(Builder.CreateZExt(Ops[2], Int128Ty),
llvm::ConstantInt::get(Int128Ty, 0x3f));
Value *Res;
OpenPOWER on IntegriCloud