mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-21 21:29:41 +00:00
Avoid allocating a value of zero in a register if the initial formula
inputs happen to negate each other. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100828 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
dd98c4d185
commit
e60bb15982
@ -262,11 +262,15 @@ void Formula::InitialMatch(const SCEV *S, Loop *L,
|
||||
SmallVector<const SCEV *, 4> Bad;
|
||||
DoInitialMatch(S, L, Good, Bad, SE, DT);
|
||||
if (!Good.empty()) {
|
||||
BaseRegs.push_back(SE.getAddExpr(Good));
|
||||
const SCEV *Sum = SE.getAddExpr(Good);
|
||||
if (!Sum->isZero())
|
||||
BaseRegs.push_back(Sum);
|
||||
AM.HasBaseReg = true;
|
||||
}
|
||||
if (!Bad.empty()) {
|
||||
BaseRegs.push_back(SE.getAddExpr(Bad));
|
||||
const SCEV *Sum = SE.getAddExpr(Bad);
|
||||
if (!Sum->isZero())
|
||||
BaseRegs.push_back(Sum);
|
||||
AM.HasBaseReg = true;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user