[llvm] [RISCV][VLOPT] Compute demanded VLs up front. NFC (PR #124530)
Luke Lau via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 27 07:24:41 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)) {
----------------
lukel97 wrote:
I thought the same thing originally first, but then found out we have vcpop.m etc. which don't define any vector operands but use vector operands. So in that case we can't reduce the demanded VL since it's not elementwise
https://github.com/llvm/llvm-project/pull/124530
More information about the llvm-commits
mailing list