mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
When forming an ICmpZero LSRUse, normalize the non-IV operand
of the comparison, so that the resulting expression is fully normalized. This fixes PR9939. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131576 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -2073,6 +2073,10 @@ void LSRInstance::CollectFixupsAndInitialFormulae() {
|
||||
// x == y --> x - y == 0
|
||||
const SCEV *N = SE.getSCEV(NV);
|
||||
if (SE.isLoopInvariant(N, L)) {
|
||||
// S is normalized, so normalize N before folding it into S
|
||||
// to keep the result normalized.
|
||||
N = TransformForPostIncUse(Normalize, N, CI, 0,
|
||||
LF.PostIncLoops, SE, DT);
|
||||
Kind = LSRUse::ICmpZero;
|
||||
S = SE.getMinusSCEV(N, S);
|
||||
}
|
||||
|
Reference in New Issue
Block a user