[llvm] [RISCV] Convert AVLs with vlenb to VLMAX where possible (PR #97800)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 5 02:57:03 PDT 2024


================
@@ -62,6 +69,54 @@ char RISCVFoldMasks::ID = 0;
 
 INITIALIZE_PASS(RISCVFoldMasks, DEBUG_TYPE, "RISC-V Fold Masks", false, false)
 
+// If an AVL is a VLENB that's possibly scaled to be equal to VLMAX, convert it
+// to the VLMAX sentinel value.
+bool RISCVFoldMasks::convertToVLMAX(MachineInstr &MI) const {
+  if (!RISCVII::hasVLOp(MI.getDesc().TSFlags) ||
----------------
lukel97 wrote:

I think we could use `RISCVVPseudosTable::getPseudoInfo(Opc)` to check if it's a pseudo.

For here do we need to use it, or is it ok to just check for VL and SEW ops?

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


More information about the llvm-commits mailing list