[clang] [llvm] [RISCV] Update Zvzip support to v0.3 (PR #210603)

Pengcheng Wang via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 14 23:59:15 PDT 2026


================
@@ -1153,8 +1159,7 @@ DemandedVL RISCVVLOptimizerImpl::getMinimumVLForUser(const MachineInstr &UserMI,
   if (RISCV::isVLKnownLE(*MRI, DemandedVLs.lookup(&UserMI).VL, VLOp))
     MinimumVL = DemandedVLs.lookup(&UserMI);
 
-  if ((IsVUNZIP && UserOp.getOperandNo() == 2) ||
-      (IsVZIP && UserOp.getOperandNo() == 4))
+  if (IsVUNZIP && UserOp.getOperandNo() == 2)
----------------
wangpc-pp wrote:

For `vzip.vv`, the two sources (operands 2 and 3) are read only for ceil(vl/2)/floor(vl/2) elements per the spec (`norm:vzip-vv_op`), but they inherit the full result-sized VL here. That's a safe upper bound, but it misses a chance to halve the demanded VL of a source producer. Could be a follow-up if not addressed here. BTW, we don't need to remove `IsVZIP` if we reduce vl for `vzip.vv` here. cc @lukel97 is it possible to model `ceil/floor` semantics here?

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


More information about the llvm-commits mailing list