[llvm] [RISCV] Handle LHS == 0 in isVLKnownLE (PR #148860)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 15 20:08:31 PDT 2025


================
@@ -4812,6 +4812,8 @@ bool RISCV::isVLKnownLE(const MachineOperand &LHS, const MachineOperand &RHS) {
     return true;
   if (RHS.isImm() && RHS.getImm() == RISCV::VLMaxSentinel)
     return true;
+  if (LHS.isImm() && LHS.getImm() == 0)
+    return true;
   if (LHS.isImm() && LHS.getImm() == RISCV::VLMaxSentinel)
----------------
lukel97 wrote:

The returns whether or not it's known to be LE, so I think returning false should be conservatively correct. I.e returning false != known GT

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


More information about the llvm-commits mailing list