diff options
author | Chris Lattner <sabre@nondot.org> | 2010-06-14 19:45:43 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-06-14 19:45:43 +0000 |
commit | 5b7c792d3fe590a3f5028e004a982e037fa05835 (patch) | |
tree | 923c53da4c118bdfa4116816dc23efd184ab8440 /lib | |
parent | 31b21ed7f1a479687cdef401e31ae046b5df4e55 (diff) | |
download | external_llvm-5b7c792d3fe590a3f5028e004a982e037fa05835.zip external_llvm-5b7c792d3fe590a3f5028e004a982e037fa05835.tar.gz external_llvm-5b7c792d3fe590a3f5028e004a982e037fa05835.tar.bz2 |
jump threading can't split a critical edge from an indirectbr. This
fixes PR7356.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105950 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Transforms/Scalar/JumpThreading.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/JumpThreading.cpp b/lib/Transforms/Scalar/JumpThreading.cpp index 0352c6e..1a64b2c 100644 --- a/lib/Transforms/Scalar/JumpThreading.cpp +++ b/lib/Transforms/Scalar/JumpThreading.cpp @@ -870,9 +870,14 @@ bool JumpThreading::SimplifyPartiallyRedundantLoad(LoadInst *LI) { // Add all the unavailable predecessors to the PredsToSplit list. for (pred_iterator PI = pred_begin(LoadBB), PE = pred_end(LoadBB); - PI != PE; ++PI) + PI != PE; ++PI) { + // If the predecessor is an indirect goto, we can't split the edge. + if (isa<IndirectBrInst>((*PI)->getTerminator())) + return false; + if (!AvailablePredSet.count(*PI)) PredsToSplit.push_back(*PI); + } // Split them out to their own block. UnavailablePred = |