From 36f325413ec27819f8e4c1cd22d5f5e8a6a43000 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Mon, 19 Sep 2022 15:07:03 +0200 Subject: [PATCH] [SCEV] Don't verify dispositions of invalid loops This should fix the expensive checks build. Ideally we would not have invalid loops in LoopDispositions. --- llvm/lib/Analysis/ScalarEvolution.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp index 31204a41df5c..966bb3594433 100644 --- a/llvm/lib/Analysis/ScalarEvolution.cpp +++ b/llvm/lib/Analysis/ScalarEvolution.cpp @@ -13976,6 +13976,9 @@ void ScalarEvolution::verify() const { for (auto &V : Values) { auto CachedDisposition = V.getInt(); const auto *Loop = V.getPointer(); + // TODO: Make sure LoopDispositions contains no invalid loops. + if (!ValidLoops.contains(Loop)) + continue; const auto RecomputedDisposition = SE2.getLoopDisposition(S, Loop); if (CachedDisposition != RecomputedDisposition) { dbgs() << "Cached disposition of " << *S << " for loop " << *Loop