summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2015-07-20 15:31:17 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2015-07-20 15:31:17 +0000
commitb5960564133b8794fc1065869b9e2d4fbf6530ea (patch)
tree78b947610bc46d7186498bd43564d86a30dcac23 /clang/lib
parent25b2f754b57a376b958e9b13f82c114e4d3c5b00 (diff)
downloadbcm5719-llvm-b5960564133b8794fc1065869b9e2d4fbf6530ea.tar.gz
bcm5719-llvm-b5960564133b8794fc1065869b9e2d4fbf6530ea.zip
[CodeGen] Flip lanes when lowering __builtin_palignr with one lane
Otherwise we'd pick the wrong lane for the resulting shuffle and miscompile code. PR24187. llvm-svn: 242678
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/CodeGen/CGBuiltin.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp
index 9e538703177..463b3eee3d3 100644
--- a/clang/lib/CodeGen/CGBuiltin.cpp
+++ b/clang/lib/CodeGen/CGBuiltin.cpp
@@ -6238,6 +6238,7 @@ Value *CodeGenFunction::EmitX86BuiltinExpr(unsigned BuiltinID,
// but less than two lanes, convert to shifting in zeroes.
if (ShiftVal > NumLaneElts) {
ShiftVal -= NumLaneElts;
+ Ops[1] = Ops[0];
Ops[0] = llvm::Constant::getNullValue(Ops[0]->getType());
}
OpenPOWER on IntegriCloud