diff options
author | Dan Gohman <gohman@apple.com> | 2009-04-23 15:16:49 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-04-23 15:16:49 +0000 |
commit | 6860e16c324d5b65ef710b0ce60a52c52f557b82 (patch) | |
tree | 29c9aa4f22339fc36ee937332eb664934ada172a /include/llvm/Analysis/ScalarEvolutionExpander.h | |
parent | 8edc822c25f4bb28d05e7dde949f134922d361a0 (diff) | |
download | external_llvm-6860e16c324d5b65ef710b0ce60a52c52f557b82.zip external_llvm-6860e16c324d5b65ef710b0ce60a52c52f557b82.tar.gz external_llvm-6860e16c324d5b65ef710b0ce60a52c52f557b82.tar.bz2 |
Change SCEVExpander's expandCodeFor to provide more flexibility
with the persistent insertion point, and change IndVars to make
use of it. This fixes a bug where IndVars was holding on to a
stale insertion point and forcing the SCEVExpander to continue to
use it.
This fixes PR4038.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69892 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Analysis/ScalarEvolutionExpander.h')
-rw-r--r-- | include/llvm/Analysis/ScalarEvolutionExpander.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/include/llvm/Analysis/ScalarEvolutionExpander.h b/include/llvm/Analysis/ScalarEvolutionExpander.h index 6e2db29..b6b4578 100644 --- a/include/llvm/Analysis/ScalarEvolutionExpander.h +++ b/include/llvm/Analysis/ScalarEvolutionExpander.h @@ -71,13 +71,23 @@ namespace llvm { InsertedInstructions.insert(I); } + void setInsertionPoint(BasicBlock::iterator NewIP) { InsertPt = NewIP; } + BasicBlock::iterator getInsertionPoint() const { return InsertPt; } /// expandCodeFor - Insert code to directly compute the specified SCEV /// expression into the program. The inserted code is inserted into the + /// SCEVExpander's current insertion point. + Value *expandCodeFor(SCEVHandle SH, const Type *Ty); + + /// expandCodeFor - Insert code to directly compute the specified SCEV + /// expression into the program. The inserted code is inserted into the /// specified block. Value *expandCodeFor(SCEVHandle SH, const Type *Ty, - BasicBlock::iterator IP); + BasicBlock::iterator IP) { + setInsertionPoint(IP); + return expandCodeFor(SH, Ty); + } /// InsertCastOfTo - Insert a cast of V to the specified type, doing what /// we can to share the casts. |