[llvm] [SPARC] Prevent RESTORE from sourcing from %o7 in call delay slots (PR #172593)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 14 09:17:29 PST 2026


================
@@ -303,15 +303,20 @@ void Filler::insertCallDefsUses(MachineBasicBlock::iterator MI,
                                 SmallSet<unsigned, 32>& RegDefs,
                                 SmallSet<unsigned, 32>& RegUses)
 {
-  // Call defines o7, which is visible to the instruction in delay slot.
-  RegDefs.insert(SP::O7);
-
+  // Regular calls define o7, which is visible to the instruction in delay slot.
+  // On the other hand, tail calls preserve it.
   switch(MI->getOpcode()) {
   default: llvm_unreachable("Unknown opcode.");
   case SP::CALL:
+    RegDefs.insert(SP::O7);
----------------
koachan wrote:

Yeah, the definition in the tablegen file seems to be missing a `Defs`.
Should I move it there?

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


More information about the llvm-commits mailing list