summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@intel.com>2018-02-12 22:38:34 +0000
committerCraig Topper <craig.topper@intel.com>2018-02-12 22:38:34 +0000
commit8d19c6fba2fa1d7d0ee3ae999e9f5c3a93f8c067 (patch)
treefdbb733f1c7b069a4b78edc8fa34fa578cf1396e /llvm/lib
parent9ac2e1138519c78f6b4850a367b0801b5988c74e (diff)
downloadbcm5719-llvm-8d19c6fba2fa1d7d0ee3ae999e9f5c3a93f8c067.tar.gz
bcm5719-llvm-8d19c6fba2fa1d7d0ee3ae999e9f5c3a93f8c067.zip
[X86] Reverse the operand order of the autoupgrade of the kunpack builtins.
The second operand needs to be in the lower bits of the concatenation. This matches llvm 5.0, gcc, and icc behavior. Fixes PR36360. llvm-svn: 324953
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/IR/AutoUpgrade.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/IR/AutoUpgrade.cpp b/llvm/lib/IR/AutoUpgrade.cpp
index 32ff7af32f0..9f6590dd609 100644
--- a/llvm/lib/IR/AutoUpgrade.cpp
+++ b/llvm/lib/IR/AutoUpgrade.cpp
@@ -1155,7 +1155,8 @@ void llvm::UpgradeIntrinsicCall(CallInst *CI, Function *NewFn) {
RHS = Builder.CreateShuffleVector(RHS, RHS,
makeArrayRef(Indices, NumElts / 2));
// Concat the vectors.
- Rep = Builder.CreateShuffleVector(LHS, RHS,
+ // NOTE: Operands have to be swapped to match intrinsic definition.
+ Rep = Builder.CreateShuffleVector(RHS, LHS,
makeArrayRef(Indices, NumElts));
Rep = Builder.CreateBitCast(Rep, CI->getType());
} else if (IsX86 && Name == "avx512.kand.w") {
OpenPOWER on IntegriCloud