[llvm] LoopVectorize: run verifyFunction once (PR #91470)
Ramkumar Ramachandra via llvm-commits
llvm-commits at lists.llvm.org
Wed May 8 05:58:16 PDT 2024
https://github.com/artagnon created https://github.com/llvm/llvm-project/pull/91470
In an effort to cut compile-times, run verifyFunction once per function in LoopVectorize, as opposed to running it as many times as there are loops in the function. The downside of this is that, in cases of a broken function, the user won't be informed exactly which loop transformation failed, but this is perhaps an acceptable price to pay for cutting down compile-times.
-- 8< --
Statistics from the LLVM Compile Time Tracker are pending. Will include them once they become available.
>From 44a1941f7e26aa0d06943ed6771ffe1b759ec269 Mon Sep 17 00:00:00 2001
From: Ramkumar Ramachandra <r at artagnon.com>
Date: Wed, 8 May 2024 13:50:03 +0100
Subject: [PATCH] LoopVectorize: run verifyFunction once
In an effort to cut compile-times, run verifyFunction once per function
in LoopVectorize, as opposed to running it as many times as there are
loops in the function. The downside of this is that, in cases of a
broken function, the user won't be informed exactly which loop
transformation failed, but this is perhaps an acceptable price to pay
for cutting down compile-times.
---
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index 261933966b74b..8d9afeabb67e0 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -9677,7 +9677,6 @@ static bool processLoopInVPlanNativePath(
// Mark the loop as already vectorized to avoid vectorizing again.
Hints.setAlreadyVectorized();
- assert(!verifyFunction(*L->getHeader()->getParent(), &dbgs()));
return true;
}
@@ -10286,7 +10285,6 @@ bool LoopVectorizePass::processLoop(Loop *L) {
Hints.setAlreadyVectorized();
}
- assert(!verifyFunction(*L->getHeader()->getParent(), &dbgs()));
return true;
}
@@ -10359,6 +10357,8 @@ LoopVectorizeResult LoopVectorizePass::runImpl(
}
}
+ assert(!Changed || !verifyFunction(F, &dbgs()));
+
// Process each loop nest in the function.
return LoopVectorizeResult(Changed, CFGChanged);
}
More information about the llvm-commits
mailing list