[llvm] [RISCV] Explicitly set FRM defs as non-dead to prevent their reordering with instructions that may use it (PR #135176)

Sergey Kachkov via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 11 02:50:41 PDT 2025


================
@@ -20926,6 +20926,15 @@ RISCVTargetLowering::EmitInstrWithCustomInserter(MachineInstr &MI,
 
 void RISCVTargetLowering::AdjustInstrPostInstrSelection(MachineInstr &MI,
                                                         SDNode *Node) const {
+  // If instruction defines FRM operand, conservatively set it as non-dead to
+  // express data dependency with FRM users and prevent incorrect instruction
+  // reordering (these defs are marked as dead because at the moment of
+  // instruction emission they actually don't have any uses - they are added
+  // later in this hook).
----------------
skachkov-sc wrote:

Removed this statement to avoid confusion

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


More information about the llvm-commits mailing list