mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-26 20:26:07 +00:00
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
This commit is contained in:
@@ -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.
|
||||
|
Reference in New Issue
Block a user