diff options
author | Sanjay Patel <spatel@rotateright.com> | 2019-02-15 16:31:55 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2019-02-15 16:31:55 +0000 |
commit | 8a2b543a133340377e8cc92ee8860d60ee93d80c (patch) | |
tree | 980a48b161d0dfb20756403bd088613de7b8eb84 /llvm/lib/Transforms/InstCombine/InstructionCombining.cpp | |
parent | 77d0e63c1e8c8be2df8bc921ce4bd1f8714242df (diff) | |
download | bcm5719-llvm-8a2b543a133340377e8cc92ee8860d60ee93d80c.tar.gz bcm5719-llvm-8a2b543a133340377e8cc92ee8860d60ee93d80c.zip |
[InstCombine] fix crash while trying to narrow a binop of shuffles (PR40734)
https://bugs.llvm.org/show_bug.cgi?id=40734
llvm-svn: 354144
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstructionCombining.cpp')
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstructionCombining.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp index 8cbf57a97ef..723bb4c0d68 100644 --- a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp +++ b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp @@ -1375,7 +1375,8 @@ Instruction *InstCombiner::foldVectorBinop(BinaryOperator &Inst) { if (match(LHS, m_ShuffleVector(m_Value(L0), m_Value(L1), m_Constant(Mask))) && match(RHS, m_ShuffleVector(m_Value(R0), m_Value(R1), m_Specific(Mask))) && LHS->hasOneUse() && RHS->hasOneUse() && - cast<ShuffleVectorInst>(LHS)->isConcat()) { + cast<ShuffleVectorInst>(LHS)->isConcat() && + cast<ShuffleVectorInst>(RHS)->isConcat()) { // This transform does not have the speculative execution constraint as // below because the shuffle is a concatenation. The new binops are // operating on exactly the same elements as the existing binop. |