mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-24 13:18:17 +00:00
cache result of operator*
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107976 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1118,17 +1118,19 @@ Value *SCEVExpander::visitAddRecExpr(const SCEVAddRecExpr *S) {
|
||||
|
||||
Constant *One = ConstantInt::get(Ty, 1);
|
||||
for (pred_iterator HPI = pred_begin(Header), HPE = pred_end(Header);
|
||||
HPI != HPE; ++HPI)
|
||||
if (L->contains(*HPI)) {
|
||||
HPI != HPE; ++HPI) {
|
||||
BasicBlock *HP = *HPI;
|
||||
if (L->contains(HP)) {
|
||||
// Insert a unit add instruction right before the terminator
|
||||
// corresponding to the back-edge.
|
||||
Instruction *Add = BinaryOperator::CreateAdd(PN, One, "indvar.next",
|
||||
(*HPI)->getTerminator());
|
||||
HP->getTerminator());
|
||||
rememberInstruction(Add);
|
||||
PN->addIncoming(Add, *HPI);
|
||||
PN->addIncoming(Add, HP);
|
||||
} else {
|
||||
PN->addIncoming(Constant::getNullValue(Ty), *HPI);
|
||||
PN->addIncoming(Constant::getNullValue(Ty), HP);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// {0,+,F} --> {0,+,1} * F
|
||||
|
||||
Reference in New Issue
Block a user