diff options
author | Andrew Trick <atrick@apple.com> | 2013-01-06 05:59:39 +0000 |
---|---|---|
committer | Andrew Trick <atrick@apple.com> | 2013-01-06 05:59:39 +0000 |
commit | c6b4936a59234704b788532de36d860f14b45e82 (patch) | |
tree | 423a4ad230e980020a311f10a1f6d666f0368aac /lib/Transforms/Scalar | |
parent | 46418797cd3b24ddf92240eab76f52bc7ac72d9d (diff) | |
download | external_llvm-c6b4936a59234704b788532de36d860f14b45e82.zip external_llvm-c6b4936a59234704b788532de36d860f14b45e82.tar.gz external_llvm-c6b4936a59234704b788532de36d860f14b45e82.tar.bz2 |
Fix a crash in LSR replaceCongruentIVs.
Indirect branch in the preheader crashes replaceCongruentIVs.
Fixes rdar://12910141.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171653 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar')
-rw-r--r-- | lib/Transforms/Scalar/LoopStrengthReduce.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/lib/Transforms/Scalar/LoopStrengthReduce.cpp index acae9b4..70ccc54 100644 --- a/lib/Transforms/Scalar/LoopStrengthReduce.cpp +++ b/lib/Transforms/Scalar/LoopStrengthReduce.cpp @@ -4820,7 +4820,7 @@ bool LoopStrengthReduce::runOnLoop(Loop *L, LPPassManager & /*LPM*/) { // Remove any extra phis created by processing inner loops. Changed |= DeleteDeadPHIs(L->getHeader()); - if (EnablePhiElim) { + if (EnablePhiElim && L->isLoopSimplifyForm()) { SmallVector<WeakVH, 16> DeadInsts; SCEVExpander Rewriter(getAnalysis<ScalarEvolution>(), "lsr"); #ifndef NDEBUG |