[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:18:31 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:

Feel free to clean it up in a follow up.

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


More information about the llvm-commits mailing list