[llvm] [RISCV] Handle recurrences in RISCVVLOptimizer (PR #151285)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 21 18:51:11 PDT 2025


================
@@ -6,15 +6,15 @@ target triple = "riscv64-unknown-linux-gnu"
 define i32 @_ZN4Mesh12rezone_countESt6vectorIiSaIiEERiS3_(<vscale x 4 x i32> %wide.load, <vscale x 4 x i1> %0, <vscale x 4 x i1> %1, <vscale x 4 x i1> %2, <vscale x 4 x i1> %3) #0 {
 ; CHECK-LABEL: _ZN4Mesh12rezone_countESt6vectorIiSaIiEERiS3_:
 ; CHECK:       # %bb.0: # %entry
-; CHECK-NEXT:    vsetvli a0, zero, e32, m2, ta, ma
+; CHECK-NEXT:    vsetivli zero, 0, e32, m2, ta, ma
----------------
lukel97 wrote:

Yeah, because it's a loop `middle.block` gets removed before it reaches the VL optimizer. So there's no "root" instruction to propagate the VL upwards from and all the demanded VLs stay at 0.

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


More information about the llvm-commits mailing list