[llvm] [LoopVectorize] Add cost of generating tail-folding mask to the loop (PR #130565)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 18 09:52:30 PDT 2025


================
@@ -78,11 +78,16 @@ loop:
   store i64 0, ptr %arrayidx13, align 8
   %iv.next = add nuw nsw i64 %iv, 1
   %exitcond.not = icmp eq i64 %iv.next, 3
-  br i1 %exitcond.not, label %exit, label %loop
+  br i1 %exitcond.not, label %exit, label %loop, !llvm.loop !1
 
 exit:
   ret void
 }
+
+!1 = distinct !{!1, !2, !3, !4}
+!2 = !{!"llvm.loop.vectorize.width", i32 2}
+!3 = !{!"llvm.loop.vectorize.scalable.enable", i1 true}
+!4 = !{!"llvm.loop.vectorize.enable", i1 true}
----------------
david-arm wrote:

Done!

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


More information about the llvm-commits mailing list