diff options
author | Andrew Trick <atrick@apple.com> | 2012-05-22 17:39:59 +0000 |
---|---|---|
committer | Andrew Trick <atrick@apple.com> | 2012-05-22 17:39:59 +0000 |
commit | a7a3de1bcf9c811f174addbe670cd6b52aed58d2 (patch) | |
tree | e9fa45443d11fe2bddc1442d28248aa50f355413 /llvm/lib | |
parent | a425589feac540f1792d2e698c1cb0103ba1ec86 (diff) | |
download | bcm5719-llvm-a7a3de1bcf9c811f174addbe670cd6b52aed58d2.tar.gz bcm5719-llvm-a7a3de1bcf9c811f174addbe670cd6b52aed58d2.zip |
LSR fix: add a missing phi check during IV hoisting.
Fixes PR12898: SCEVExpander crash.
llvm-svn: 157263
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Analysis/ScalarEvolutionExpander.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolutionExpander.cpp b/llvm/lib/Analysis/ScalarEvolutionExpander.cpp index 69507beeaae..e7fe672ad31 100644 --- a/llvm/lib/Analysis/ScalarEvolutionExpander.cpp +++ b/llvm/lib/Analysis/ScalarEvolutionExpander.cpp @@ -955,7 +955,8 @@ bool SCEVExpander::hoistIVInc(Instruction *IncV, Instruction *InsertPos) { // InsertPos must itself dominate IncV so that IncV's new position satisfies // its existing users. - if (!SE.DT->dominates(InsertPos->getParent(), IncV->getParent())) + if (isa<PHINode>(InsertPos) + || !SE.DT->dominates(InsertPos->getParent(), IncV->getParent())) return false; // Check that the chain of IV operands leading back to Phi can be hoisted. |