diff options
author | Dan Gohman <gohman@apple.com> | 2010-06-04 19:16:34 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-06-04 19:16:34 +0000 |
commit | c87b40b1cd2a6b6ce3608bc81a199b5005edc373 (patch) | |
tree | c661fe3d01e769e4994565d4cab226cb5bd4540f /lib/Analysis/ScalarEvolutionNormalization.cpp | |
parent | 6de07178e1e6445080bf4f7704e274c5f219ff70 (diff) |
Fix normalization and de-normalization of non-affine SCEVs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105480 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/ScalarEvolutionNormalization.cpp')
-rw-r--r-- | lib/Analysis/ScalarEvolutionNormalization.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/Analysis/ScalarEvolutionNormalization.cpp b/lib/Analysis/ScalarEvolutionNormalization.cpp index 75c381d5ef..563fd2fa96 100644 --- a/lib/Analysis/ScalarEvolutionNormalization.cpp +++ b/lib/Analysis/ScalarEvolutionNormalization.cpp @@ -105,22 +105,25 @@ const SCEV *llvm::TransformForPostIncUse(TransformKind Kind, case NormalizeAutodetect: if (Instruction *OI = dyn_cast<Instruction>(OperandValToReplace)) if (IVUseShouldUsePostIncValue(User, OI, L, &DT)) { - Result = SE.getMinusSCEV(Result, AR->getStepRecurrence(SE)); + const SCEV *TransformedStep = + TransformForPostIncUse(Kind, AR->getStepRecurrence(SE), + User, OperandValToReplace, Loops, SE, DT); + Result = SE.getMinusSCEV(Result, TransformedStep); Loops.insert(L); } break; case Normalize: - if (Loops.count(L)) - Result = SE.getMinusSCEV(Result, AR->getStepRecurrence(SE)); - break; - case Denormalize: if (Loops.count(L)) { const SCEV *TransformedStep = TransformForPostIncUse(Kind, AR->getStepRecurrence(SE), User, OperandValToReplace, Loops, SE, DT); - Result = SE.getAddExpr(Result, TransformedStep); + Result = SE.getMinusSCEV(Result, TransformedStep); } break; + case Denormalize: + if (Loops.count(L)) + Result = SE.getAddExpr(Result, AR->getStepRecurrence(SE)); + break; } return Result; } |