[llvm] LoopVectorize: run verifyFunction once (PR #91470)

via llvm-commits llvm-commits at lists.llvm.org
Wed May 8 05:58:47 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-transforms

Author: Ramkumar Ramachandra (artagnon)

<details>
<summary>Changes</summary>

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.

---
Full diff: https://github.com/llvm/llvm-project/pull/91470.diff


1 Files Affected:

- (modified) llvm/lib/Transforms/Vectorize/LoopVectorize.cpp (+2-2) 


``````````diff
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);
 }

``````````

</details>


https://github.com/llvm/llvm-project/pull/91470


More information about the llvm-commits mailing list