diff options
author | Serge Pavlov <sepavloff@gmail.com> | 2014-05-12 05:44:53 +0000 |
---|---|---|
committer | Serge Pavlov <sepavloff@gmail.com> | 2014-05-12 05:44:53 +0000 |
commit | 0581109708b995167af55b08db60965688fd61c8 (patch) | |
tree | 73f07f6216ae50b89b83ed03f3bf78ba0e19168c /llvm/lib/Transforms | |
parent | 36250ad632a5a2611919413c1a00a1b9f338fc85 (diff) | |
download | bcm5719-llvm-0581109708b995167af55b08db60965688fd61c8.tar.gz bcm5719-llvm-0581109708b995167af55b08db60965688fd61c8.zip |
Fix reordering of shuffles and binary operations
Do not apply transformation:
BinOp(shuffle(v1), shuffle(v2)) -> shuffle(BinOp(v1, v2))
if operands v1 and v2 are of different size.
This change fixes PR19717, which was caused by r208488.
llvm-svn: 208518
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstructionCombining.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp index 82b7cae410c..90ca8863e8c 100644 --- a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp +++ b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp @@ -1120,6 +1120,7 @@ Value *InstCombiner::SimplifyVectorOp(BinaryOperator &Inst) { ShuffleVectorInst *RShuf = cast<ShuffleVectorInst>(RHS); if (isa<UndefValue>(LShuf->getOperand(1)) && isa<UndefValue>(RShuf->getOperand(1)) && + LShuf->getOperand(0)->getType() == RShuf->getOperand(0)->getType() && LShuf->getMask() == RShuf->getMask()) { BinaryOperator *NewBO = CreateBinOpAsGiven(Inst, LShuf->getOperand(0), RShuf->getOperand(0), Builder); |