summaryrefslogtreecommitdiff
path: root/lib/Analysis/ScalarEvolutionExpander.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-03-02 01:59:21 +0000
committerDan Gohman <gohman@apple.com>2010-03-02 01:59:21 +0000
commit069d6f3396856655d5d4ba155ee16eb0209d38b0 (patch)
tree9e4a75f0aeb9eaf3c7760f5bbe9ea1c12134f3a1 /lib/Analysis/ScalarEvolutionExpander.cpp
parent46ada19645c981a0b7932487d163f7582074a4d9 (diff)
downloadllvm-069d6f3396856655d5d4ba155ee16eb0209d38b0.tar.gz
llvm-069d6f3396856655d5d4ba155ee16eb0209d38b0.tar.bz2
llvm-069d6f3396856655d5d4ba155ee16eb0209d38b0.tar.xz
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97537 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/ScalarEvolutionExpander.cpp')
-rw-r--r--lib/Analysis/ScalarEvolutionExpander.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Analysis/ScalarEvolutionExpander.cpp b/lib/Analysis/ScalarEvolutionExpander.cpp
index 9aa8bfbdb1..b6c7ce6448 100644
--- a/lib/Analysis/ScalarEvolutionExpander.cpp
+++ b/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));