[llvm] [RISCV][VLOPT] Compute demanded VLs up front. NFC (PR #124530)

Michael Maitland via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 27 07:14:34 PST 2025


================
@@ -1230,46 +1233,59 @@ RISCVVLOptimizer::getMinimumVLForUser(MachineOperand &UserOp) {
   // Looking for an immediate or a register VL that isn't X0.
   assert((!VLOp.isReg() || VLOp.getReg() != RISCV::X0) &&
          "Did not expect X0 VL");
+
+  // If we know the demanded VL of UserMI, then we can reduce the VL it
+  // requires.
+  if (DemandedVLs.contains(&UserMI)) {
----------------
michaelmaitland wrote:

Is it really possible to have a VLOp but not be part of DemandedVLs?

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


More information about the llvm-commits mailing list