[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 03:14:22 PST 2025


================
@@ -4232,6 +4232,8 @@ unsigned RISCV::getDestLog2EEW(const MCInstrDesc &Desc, unsigned Log2SEW) {
 
 /// Given two VL operands, do we know that LHS <= RHS?
 bool RISCV::isVLKnownLE(const MachineOperand &LHS, const MachineOperand &RHS) {
+  if (LHS.isImm() && LHS.getImm() == 0)
+    return true;
----------------
lukel97 wrote:

This is needed to be able to replace the std::optional<MachineOperand> with CreateImm(0) in computeDemandedVL

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


More information about the llvm-commits mailing list