diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2014-06-24 10:38:10 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2014-06-24 10:38:10 +0000 |
commit | 9c8840362525b89774c10378317fc18e5d222ba8 (patch) | |
tree | a706a77b6f7cc814699dd7cc29c9c1acf8e35f83 /lib/Transforms | |
parent | f396732d9bddd27b9496dda6f51d492d81ef3ed7 (diff) | |
download | llvm-9c8840362525b89774c10378317fc18e5d222ba8.tar.gz llvm-9c8840362525b89774c10378317fc18e5d222ba8.tar.bz2 llvm-9c8840362525b89774c10378317fc18e5d222ba8.tar.xz |
InstCombine: Don't try to reorder shuffles where the mask is a ConstantExpr.
We can't analyze the individual values of a vector expression. PR20114.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211581 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/InstCombine/InstructionCombining.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Transforms/InstCombine/InstructionCombining.cpp b/lib/Transforms/InstCombine/InstructionCombining.cpp index 88d7a0d59e..88d461e1b2 100644 --- a/lib/Transforms/InstCombine/InstructionCombining.cpp +++ b/lib/Transforms/InstCombine/InstructionCombining.cpp @@ -1227,7 +1227,9 @@ Value *InstCombiner::SimplifyVectorOp(BinaryOperator &Inst) { if (isa<ShuffleVectorInst>(RHS)) Shuffle = cast<ShuffleVectorInst>(RHS); if (isa<Constant>(LHS)) C1 = cast<Constant>(LHS); if (isa<Constant>(RHS)) C1 = cast<Constant>(RHS); - if (Shuffle && C1 && isa<UndefValue>(Shuffle->getOperand(1)) && + if (Shuffle && C1 && + (isa<ConstantVector>(C1) || isa<ConstantDataVector>(C1)) && + isa<UndefValue>(Shuffle->getOperand(1)) && Shuffle->getType() == Shuffle->getOperand(0)->getType()) { SmallVector<int, 16> ShMask = Shuffle->getShuffleMask(); // Find constant C2 that has property: |