mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-05-17 15:38:40 +00:00
Fix a bad case in gzip where we put lots of things in registers across the
loop, because a IV-dependent value was used outside of the loop and didn't have immediate-folding capability git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22798 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
ff2006aa74
commit
80b32b3aab
@ -737,15 +737,23 @@ void LoopStrengthReduce::StrengthReduceStridedIVUsers(const SCEVHandle &Stride,
|
|||||||
// fields of the BasedUsers. We do this so that it increases the commonality
|
// fields of the BasedUsers. We do this so that it increases the commonality
|
||||||
// of the remaining uses.
|
// of the remaining uses.
|
||||||
for (unsigned i = 0, e = UsersToProcess.size(); i != e; ++i) {
|
for (unsigned i = 0, e = UsersToProcess.size(); i != e; ++i) {
|
||||||
// Addressing modes can be folded into loads and stores. Be careful that
|
// If the user is not in the current loop, this means it is using the exit
|
||||||
// the store is through the expression, not of the expression though.
|
// value of the IV. Do not put anything in the base, make sure it's all in
|
||||||
bool isAddress = isa<LoadInst>(UsersToProcess[i].Inst);
|
// the immediate field to allow as much factoring as possible.
|
||||||
if (StoreInst *SI = dyn_cast<StoreInst>(UsersToProcess[i].Inst))
|
if (!L->contains(UsersToProcess[i].Inst->getParent())) {
|
||||||
if (SI->getOperand(1) == UsersToProcess[i].OperandValToReplace)
|
std::swap(UsersToProcess[i].Base, UsersToProcess[i].Imm);
|
||||||
isAddress = true;
|
} else {
|
||||||
|
|
||||||
MoveImmediateValues(UsersToProcess[i].Base, UsersToProcess[i].Imm,
|
// Addressing modes can be folded into loads and stores. Be careful that
|
||||||
isAddress, L);
|
// the store is through the expression, not of the expression though.
|
||||||
|
bool isAddress = isa<LoadInst>(UsersToProcess[i].Inst);
|
||||||
|
if (StoreInst *SI = dyn_cast<StoreInst>(UsersToProcess[i].Inst))
|
||||||
|
if (SI->getOperand(1) == UsersToProcess[i].OperandValToReplace)
|
||||||
|
isAddress = true;
|
||||||
|
|
||||||
|
MoveImmediateValues(UsersToProcess[i].Base, UsersToProcess[i].Imm,
|
||||||
|
isAddress, L);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now that we know what we need to do, insert the PHI node itself.
|
// Now that we know what we need to do, insert the PHI node itself.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user