forked from OSchip/llvm-project
[SCEV] Verify contents of loop disposition cache
It seems that it is sometimes broken. Initial motivation for this was investigation of https://github.com/llvm/llvm-project/issues/56260, but it also seems that we have found an unrelated bug in LoopFusion that leaves broken caches. Differential Revision: https://reviews.llvm.org/D134158 Reviewed By: nikic
This commit is contained in:
parent
908b3b6ccb
commit
bb68b2402d
|
@ -13968,6 +13968,24 @@ void ScalarEvolution::verify() const {
|
|||
};
|
||||
VerifyBECountUsers(/* Predicated */ false);
|
||||
VerifyBECountUsers(/* Predicated */ true);
|
||||
|
||||
// Verify intergity of loop disposition cache.
|
||||
for (const auto &It : LoopDispositions) {
|
||||
const SCEV *S = It.first;
|
||||
auto &Values = It.second;
|
||||
for (auto &V : Values) {
|
||||
auto CachedDisposition = V.getInt();
|
||||
const auto *Loop = V.getPointer();
|
||||
const auto RecomputedDisposition = SE2.getLoopDisposition(S, Loop);
|
||||
if (CachedDisposition != RecomputedDisposition) {
|
||||
dbgs() << "Cached disposition of " << *S << " for loop " << *Loop
|
||||
<< " is incorrect: cached "
|
||||
<< loopDispositionToStr(CachedDisposition) << ", actual "
|
||||
<< loopDispositionToStr(RecomputedDisposition) << "\n";
|
||||
std::abort();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool ScalarEvolution::invalidate(
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
; RUN: opt -S -loop-fusion < %s 2>&1 | FileCheck %s
|
||||
; XFAIL: *
|
||||
; REQUIRES: asserts
|
||||
; Fails due to incorrect cached loop disposition.
|
||||
|
||||
; Verify that LoopFusion can fuse two double-loop nests with guarded inner
|
||||
; loops. Loops are in canonical form.
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
; RUN: opt -S -loop-fusion < %s | FileCheck %s
|
||||
; XFAIL: *
|
||||
; REQUIRES: asserts
|
||||
; Fails due to incorrect cached loop disposition.
|
||||
;
|
||||
; int A[1024][1024];
|
||||
; int B[1024][1024];
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
; RUN: opt -S -loop-fusion < %s 2>&1 | FileCheck %s
|
||||
; XFAIL: *
|
||||
; REQUIRES: asserts
|
||||
; Fails due to incorrect cached loop disposition.
|
||||
|
||||
; Verify that LoopFusion can fuse two triple-loop nests with guarded inner
|
||||
; loops. Loops are in canonical form.
|
||||
|
|
Loading…
Reference in New Issue