[llvm] [SimpleLoopUnswitch][NFC] move quadratic asserts under EXPENSIVE_CHECKS (PR #144887)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 19 08:54:34 PDT 2025
================
@@ -2522,12 +2522,14 @@ static void unswitchNontrivialInvariants(
if (MSSAU && VerifyMemorySSA)
MSSAU->getMemorySSA()->verifyMemorySSA();
+#ifdef EXPENSIVE_CHECKS
// This transformation has a high risk of corrupting the dominator tree, and
// the below steps to rebuild loop structures will result in hard to debug
// errors in that case so verify that the dominator tree is sane first.
// FIXME: Remove this when the bugs stop showing up and rely on existing
// verification steps.
assert(DT.verify(DominatorTree::VerificationLevel::Fast));
----------------
jeanPerier wrote:
Just to clarify, are you suggesting completely deleting this one because it has not fired recently and to turn the one on line 3714/3717 to VerificationLevel::Full under expensive checks, or do you want to keep this one outside of `EXPENSIVE_CHECKS` and use VerificationLevel::Full for the last one under EXPENSIVE_CHECKS?
The comment "Remove this when the bugs stop showing up and rely on existing verification steps" from 7 years ago seems to imply the former assuming the assert has not fired recently (not familiar with the code here, do you know? Searching GitHub issues for this asserts, I did not find an issues for this pass).
https://github.com/llvm/llvm-project/pull/144887
More information about the llvm-commits
mailing list