[llvm] [RISCV][VLOPT] Don't reduce the VL is the same as CommonVL (PR #123878)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 22 08:33:07 PST 2025


================
@@ -1314,8 +1314,8 @@ bool RISCVVLOptimizer::tryReduceVL(MachineInstr &OrigMI) {
     unsigned VLOpNum = RISCVII::getVLOpNum(MI.getDesc());
     MachineOperand &VLOp = MI.getOperand(VLOpNum);
 
-    if (!RISCV::isVLKnownLE(*CommonVL, VLOp)) {
-      LLVM_DEBUG(dbgs() << "    Abort due to CommonVL not <= VLOp.\n");
+    if (!RISCV::isVLKnownLT(*CommonVL, VLOp)) {
+      LLVM_DEBUG(dbgs() << "    Abort due to CommonVL not < VLOp.\n");
       continue;
     }
----------------
lukel97 wrote:

> In principal, this could happen for two different register values which had the same runtime value.

If we have two different register values then `isVLKnownLE` would be false right? So we would bail anyway.

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


More information about the llvm-commits mailing list