[llvm-branch-commits] [llvm] [AArch64][MachineOutliner] Handle async CFI for outlined calls (PR #236836)
Csanád Hajdú via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Wed Nov 4 01:28:56 PST 2026
================
@@ -11048,6 +11048,27 @@ AArch64InstrInfo::getOutliningCandidateInfo(
}
}
+ // Disallow saving LR to the stack if async unwind information is needed,
+ // because it's difficult to determine what CFI instructions are required
+ // for correct unwind information.
----------------
Il-Capitano wrote:
So it seems that we can't assume `x30` contains the return address in any of the cases here. E.g. see https://godbolt.org/z/13dT83KGE. Here, one of the outlined calls looks like this:
```
str x30, [sp, #-16]!
mov w30, #51966
mov x1, x30
bl OUTLINED_FUNCTION_0
mov x30, x1
// ...
ldr x30, [sp], #16
ret
```
Inserting `.cfi_register w30, w1` after `mov x1, x30` would be incorrect.
I don't think we can avoid analysing the function to determine what CFI we have to emit. In this case we can probably handle saving `x30` to the stack as well, at least in some cases.
https://github.com/llvm/llvm-project/pull/236836
More information about the llvm-branch-commits
mailing list