aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/ScalarEvolution.cpp
diff options
context:
space:
mode:
authorMax Kazantsev <max.kazantsev@azul.com>2019-01-29 05:37:59 +0000
committerMax Kazantsev <max.kazantsev@azul.com>2019-01-29 05:37:59 +0000
commit468ad52213184b03040ded6f0315d2b4196dba48 (patch)
tree5a058cfe0aa3606aeda0fe170dd99f8be55bc75a /llvm/lib/Analysis/ScalarEvolution.cpp
parentd4de606ddb8061d33172e86eb6a9dd986d5da5e9 (diff)
downloadllvm-468ad52213184b03040ded6f0315d2b4196dba48.zip
llvm-468ad52213184b03040ded6f0315d2b4196dba48.tar.gz
llvm-468ad52213184b03040ded6f0315d2b4196dba48.tar.bz2
[SCEV] Take correct loop in AddRec simplification. PR40420
The code of AddRec simplification is using wrong loop when it creates a new AddRecExpr. It should be using AddRecLoop which we have saved and against which all gate checks are made, and not calling AddRec->getLoop() over and over again because AddRec may change and become an AddRecurrency from outer loop during the transform iterations. Considering this change trivial, commiting for postcommit review. llvm-svn: 352451
Diffstat (limited to 'llvm/lib/Analysis/ScalarEvolution.cpp')
-rw-r--r--llvm/lib/Analysis/ScalarEvolution.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp
index 2ca494e..1796fd3 100644
--- a/llvm/lib/Analysis/ScalarEvolution.cpp
+++ b/llvm/lib/Analysis/ScalarEvolution.cpp
@@ -3089,7 +3089,7 @@ const SCEV *ScalarEvolution::getMulExpr(SmallVectorImpl<const SCEV *> &Ops,
AddRecOps.push_back(getAddExpr(SumOps, SCEV::FlagAnyWrap, Depth + 1));
}
if (!Overflow) {
- const SCEV *NewAddRec = getAddRecExpr(AddRecOps, AddRec->getLoop(),
+ const SCEV *NewAddRec = getAddRecExpr(AddRecOps, AddRecLoop,
SCEV::FlagAnyWrap);
if (Ops.size() == 2) return NewAddRec;
Ops[Idx] = NewAddRec;