[llvm] [M68k] Emit RTE for interrupt handler. (PR #72787)

via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 4 04:34:02 PST 2023


================
@@ -252,12 +252,11 @@ bool M68kExpandPseudo::ExpandMI(MachineBasicBlock &MBB,
     return true;
   }
   case M68k::RET: {
-    // Adjust stack to erase error code
-    int64_t StackAdj = MBBI->getOperand(0).getImm();
-    MachineInstrBuilder MIB;
-
-    if (StackAdj == 0) {
-      MIB = BuildMI(MBB, MBBI, DL, TII->get(M68k::RTS));
+    if (MBB.getParent()->getFunction().getCallingConv() ==
+        CallingConv::M68k_INTR) {
+      BuildMI(MBB, MBBI, DL, TII->get(M68k::RTE));
+    } else if (int64_t StackAdj = MBBI->getOperand(0).getImm(); StackAdj == 0) {
----------------
0x59616e wrote:

Oh, such a blunder. 

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


More information about the llvm-commits mailing list