================
@@ -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
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to