[llvm] [MIPS] Move dead register hack to MIPSSEISelDAGtoDAG (PR #204980)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 8 09:33:34 PDT 2026


================
@@ -195,6 +213,15 @@ void MipsSEDAGToDAGISel::processFunctionAfterISel(MachineFunction &MF) {
       default:
         replaceUsesWithZeroReg(MRI, MI);
       }
+
+      // MIPS DSP intrinsics don't explicitly model their dependencies
+      // in the SelectionDAG, which causes InstrEmitter to mistakenly mark them
+      // as dead. We clear the dead flags here so that LiveVariables will
+      // compute liveness correctly, avoiding MachineDeadInstrElim from deleting
+      // the definitions.
----------------
arsenm wrote:

The same fundamental problem exists no matter where you apply this hack. These registers either need to have accurate uses and defs, or be reserved 

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


More information about the llvm-commits mailing list