[llvm] [RISCV] Add XSfmm pseudo instruction and vset* insertion support (PR #143068)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 25 06:59:44 PDT 2025


================
@@ -1784,6 +1899,83 @@ void RISCVInsertVSETVLI::insertReadVL(MachineBasicBlock &MBB) {
   }
 }
 
+static void shrinkIntervalAndRemoveDeadMI(MachineOperand &MO,
+                                          LiveIntervals *LIS,
+                                          const TargetInstrInfo *TII) {
+  Register Reg = MO.getReg();
+  MO.setReg(RISCV::NoRegister);
+  MO.setIsKill(false);
+
+  if (!LIS)
+    return;
+
+  LiveInterval &LI = LIS->getInterval(Reg);
+
+  // Erase the AVL operand from the instruction.
----------------
lukel97 wrote:

I think this should say the TK or TM operand?

I'm also wondering, if TmpMI is inserted just before MI in `insertVSETMTK, and TmpMI always uses TK/TM, then will the definition of TK/TM ever be dead? If we just ignore the DeadMIs parameter do we get any regressions?

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


More information about the llvm-commits mailing list