diff options
Diffstat (limited to 'lib/Transforms/Scalar/JumpThreading.cpp')
-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 0352c6e74e..1a64b2cbad 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 = |