[llvm] [RISCV][VLOPT] Compute demanded VLs up front (PR #124530)
Michael Maitland via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 28 07:14:26 PST 2025
================
@@ -1285,9 +1290,9 @@ std::optional<MachineOperand> RISCVVLOptimizer::checkUsers(MachineInstr &MI) {
bool RISCVVLOptimizer::tryReduceVL(MachineInstr &MI) {
LLVM_DEBUG(dbgs() << "Trying to reduce VL for " << MI << "\n");
- auto CommonVL = checkUsers(MI);
- if (!CommonVL)
+ if (!DemandedVLs.contains(&MI))
return false;
+ auto CommonVL = std::make_optional(DemandedVLs.at(&MI));
----------------
michaelmaitland wrote:
Are we just using CommonVL as an optional that always has a value below? I think we could be using it as a MachineOperand.
https://github.com/llvm/llvm-project/pull/124530
More information about the llvm-commits
mailing list