aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/LoopUtils.cpp
diff options
context:
space:
mode:
authorRoman Lebedev <lebedev.ri@gmail.com>2021-08-15 18:59:32 +0300
committerRoman Lebedev <lebedev.ri@gmail.com>2021-08-15 18:59:32 +0300
commit35a8bdc775817ce13a6c9b5cf81502052634aa1f (patch)
tree8bb22e4bddff201a7fc1a63734813dfe55c1a510 /llvm/lib/Transforms/Utils/LoopUtils.cpp
parent944dfa4975e8d55ca9d97f6eb7222ff1d0f7291a (diff)
downloadllvm-35a8bdc775817ce13a6c9b5cf81502052634aa1f.zip
llvm-35a8bdc775817ce13a6c9b5cf81502052634aa1f.tar.gz
llvm-35a8bdc775817ce13a6c9b5cf81502052634aa1f.tar.bz2
[NFCI][IndVars] rewriteLoopExitValues(): nowadays SCEV should not change `GEP` base pointer
Currently/previously, while SCEV guaranteed that it produces the same value, the way it was produced may be illegal IR, so we have an ugly check that the replacement is valid. But now that the SCEV strictness wrt the pointer/integer types has been improved, i believe this invariant is already upheld by the SCEV itself, natively. I think we should add an assertion, wait for a week, and then, if all is good, rip out all this checking. Or we could just do the latter directly i guess. This reverts commit rL127839. Reviewed By: nikic Differential Revision: https://reviews.llvm.org/D108043
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopUtils.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/LoopUtils.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopUtils.cpp b/llvm/lib/Transforms/Utils/LoopUtils.cpp
index e4d78f9..5149854 100644
--- a/llvm/lib/Transforms/Utils/LoopUtils.cpp
+++ b/llvm/lib/Transforms/Utils/LoopUtils.cpp
@@ -1351,6 +1351,9 @@ int llvm::rewriteLoopExitValues(Loop *L, LoopInfo *LI, TargetLibraryInfo *TLI,
// FIXME: isValidRewrite() is a hack. it should be an assert, eventually.
Phi.ValidRewrite = isValidRewrite(SE, Phi.ExpansionPoint, Phi.Expansion);
+ assert(Phi.ValidRewrite &&
+ "Now that the SCEV is strict wrt pointer/integer types, this "
+ "invariant is expected to be uphold by SCEV itself.");
if (!Phi.ValidRewrite) {
DeadInsts.push_back(Phi.Expansion);
continue;