aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/CodeGenPrepare.cpp
diff options
context:
space:
mode:
authorJordan Rupprecht <rupprecht@google.com>2021-03-12 13:58:37 -0800
committerJordan Rupprecht <rupprecht@google.com>2021-03-12 13:59:14 -0800
commit8d20f2c2c66eb486ff23cc3d55a53bd840b36971 (patch)
tree78c1799f06e12e6889ccb81cf7b7e72a8fcac85e /llvm/lib/CodeGen/CodeGenPrepare.cpp
parentdfd27ebbd0eb137c9a439b7c537bb87ba903efd3 (diff)
downloadllvm-8d20f2c2c66eb486ff23cc3d55a53bd840b36971.zip
llvm-8d20f2c2c66eb486ff23cc3d55a53bd840b36971.tar.gz
llvm-8d20f2c2c66eb486ff23cc3d55a53bd840b36971.tar.bz2
Revert "[CodeGenPrepare] Fix isIVIncrement (PR49466)"
This reverts commit cf82700af8c658ae09b14c3d01bb1e73e48d3bd3 due to a compile timeout when building the following with `clang -O2`: ``` template <class, class = int> class a; struct b { using d = int *; }; struct e { using f = b::d; }; class g { public: e::f h; e::f i; }; template <class, class> class a : g { public: long j() const { return i - h; } long operator[](long) const noexcept; }; template <class c, class k> long a<c, k>::operator[](long l) const noexcept { return h[l]; } template <typename m, typename n> int fn1(m, n, const char *); int o, p; class D { void q(const a<long> &); long r; }; void D::q(const a<long> &l) { int s; if (l[0]) for (; l.j(); ++s) { if (l[s]) while (fn1(o, 0, "")) ; r = l[s] / p; } } ```
Diffstat (limited to 'llvm/lib/CodeGen/CodeGenPrepare.cpp')
-rw-r--r--llvm/lib/CodeGen/CodeGenPrepare.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp
index 0f698dd..0b1156e 100644
--- a/llvm/lib/CodeGen/CodeGenPrepare.cpp
+++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp
@@ -1332,7 +1332,7 @@ getIVIncrement(const PHINode *PN, const LoopInfo *LI) {
static bool isIVIncrement(const BinaryOperator *BO, const LoopInfo *LI) {
auto *PN = dyn_cast<PHINode>(BO->getOperand(0));
- if (!PN || LI->getLoopFor(BO->getParent()) != LI->getLoopFor(PN->getParent()))
+ if (!PN)
return false;
if (auto IVInc = getIVIncrement(PN, LI))
return IVInc->first == BO;
@@ -1347,7 +1347,6 @@ bool CodeGenPrepare::replaceMathCmpWithIntrinsic(BinaryOperator *BO,
if (!isIVIncrement(BO, LI))
return false;
const Loop *L = LI->getLoopFor(BO->getParent());
- assert(L && "L should not be null after isIVIncrement()");
// Do not risk on moving increment into a child loop.
if (LI->getLoopFor(Cmp->getParent()) != L)
return false;