diff options
| author | Dan Gohman <gohman@apple.com> | 2010-03-02 01:59:21 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2010-03-02 01:59:21 +0000 |
| commit | 52f55639732cffc7615f71d4f7521a19c1db43d8 (patch) | |
| tree | 9763a21029cbfbe1eb00941bb29905a8635c3efc /llvm/lib/Analysis | |
| parent | 78c5b7a76d825f01e8519b5a7fd74a645c4a9ad5 (diff) | |
| download | bcm5719-llvm-52f55639732cffc7615f71d4f7521a19c1db43d8.tar.gz bcm5719-llvm-52f55639732cffc7615f71d4f7521a19c1db43d8.zip | |
Non-affine post-inc SCEV expansions have more code which must be
emitted after the increment. Make sure the insert position
reflects this. This fixes PR6453.
llvm-svn: 97537
Diffstat (limited to 'llvm/lib/Analysis')
| -rw-r--r-- | llvm/lib/Analysis/ScalarEvolutionExpander.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolutionExpander.cpp b/llvm/lib/Analysis/ScalarEvolutionExpander.cpp index 9aa8bfbdb17..b6c7ce64481 100644 --- a/llvm/lib/Analysis/ScalarEvolutionExpander.cpp +++ b/llvm/lib/Analysis/ScalarEvolutionExpander.cpp @@ -1087,7 +1087,7 @@ Value *SCEVExpander::expand(const SCEV *S) { // If the SCEV is computable at this level, insert it into the header // after the PHIs (and after any other instructions that we've inserted // there) so that it is guaranteed to dominate any user inside the loop. - if (L && S->hasComputableLoopEvolution(L)) + if (L && S->hasComputableLoopEvolution(L) && L != PostIncLoop) InsertPt = L->getHeader()->getFirstNonPHI(); while (isInsertedInstruction(InsertPt)) InsertPt = llvm::next(BasicBlock::iterator(InsertPt)); |

