[llvm] [LoopVectorize] Enable vectorisation of early exit loops with live-outs (PR #120567)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 6 05:26:45 PST 2025


================
@@ -212,7 +212,11 @@ bool VPlanVerifier::verifyVPBasicBlock(const VPBasicBlock *VPBB) {
           continue;
         }
 
-        if (!VPDT.dominates(VPBB, UI->getParent())) {
+        // Now that we support vectorising loops with uncountable early exits
+        // we can end up in situations where VPBB does not dominate the exit
+        // block. Only do the check if the user is not in a VPIRBasicBlock.
+        if (!isa<VPIRBasicBlock>(UI->getParent()) &&
+            !VPDT.dominates(VPBB, UI->getParent())) {
----------------
david-arm wrote:

This isn't a use before def, it's an invalid assumption that the block containing the use has a single predecessor. Now that we support vectorising loops with early exits that assumption is broken, for example the user could be a PHI node.

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


More information about the llvm-commits mailing list