[llvm] [RISCV][VLOPT] Allow propagation even when VL isn't VLMAX (PR #112228)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 16 02:29:13 PDT 2024


================
@@ -643,8 +644,34 @@ bool RISCVVLOptimizer::isCandidate(const MachineInstr &MI) const {
 
   unsigned VLOpNum = RISCVII::getVLOpNum(Desc);
   const MachineOperand &VLOp = MI.getOperand(VLOpNum);
-  if (!VLOp.isImm() || VLOp.getImm() != RISCV::VLMaxSentinel)
+  if (((VLOp.isImm() && VLOp.getImm() != RISCV::VLMaxSentinel) ||
----------------
lukel97 wrote:

Ah sorry that makes sense. Just to check then, there isn't any difference between
`!VLOp.isImm() || VLOp.getImm() != RISCV::VLMaxSentinel` and `((VLOp.isImm() && VLOp.getImm() != RISCV::VLMaxSentinel) || VLOp.isReg())`?

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


More information about the llvm-commits mailing list