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

Pengcheng Wang via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 5 02:34:23 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) ||
----------------
wangpc-pp wrote:

Maybe we need a `isRVVPseudo` helper, I think it can be very useful.

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


More information about the llvm-commits mailing list