diff options
| author | David Majnemer <david.majnemer@gmail.com> | 2016-03-19 04:39:52 +0000 |
|---|---|---|
| committer | David Majnemer <david.majnemer@gmail.com> | 2016-03-19 04:39:52 +0000 |
| commit | cdf2873e36d0ec51fa02e1713aa34fb6762475c0 (patch) | |
| tree | f95512464bb64ab03236cb3a0789b12926606c88 /llvm/lib | |
| parent | 50988fba649e75286a78dad8547718d619dce8a7 (diff) | |
| download | bcm5719-llvm-cdf2873e36d0ec51fa02e1713aa34fb6762475c0.tar.gz bcm5719-llvm-cdf2873e36d0ec51fa02e1713aa34fb6762475c0.zip | |
[InstCombine] Don't insert instructions before a catch switch
CatchSwitches are not splittable, we cannot insert casts, etc. before
them.
This fixes PR26992.
llvm-svn: 263874
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp index 7401cb6034a..bbd118c67b8 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp @@ -661,6 +661,9 @@ static bool canRewriteGEPAsOffset(Value *Start, Value *Base, } if (auto *PN = dyn_cast<PHINode>(V)) { + // We cannot transform PHIs on unsplittable basic blocks. + if (isa<CatchSwitchInst>(PN->getParent()->getTerminator())) + return false; Explored.insert(PN); PHIs.insert(PN); } |

