Commit 8fc6907
committed
[AArch64] Fix offset in FP-based epilogue restore for popless ret.
In a swiftcorocc function, on the restoreless epilogue path (using
llvm.ret.popless), we're using FP-based addressing to restore
callee-saved registers, as we can't rely on SP having been restored to
its initial value, since we're not restoring it at all.
FP-based CSR restore is novel and bound to find interesting divergence
from all of our existing epilogues.
In this case, at least the problem is pretty simple, and was even
visible in one of the original test case: we were missing the
statically-sized locals. I haven't gotten to the point of convincing
myself this is sufficient yet, and I'm confident I'm missing some other
convoluted PEI-ism, but with this we can actually successfully run
a bunch of end-to-end swift tests!
While there, add an assert that checks that the FP/LR frame record
itself is only ever loaded from FP+0, without an offset. If there's an
offset from FP, we must have goofed somewhere, since that breaks the
frame record linked list.
rdar://1478389681 parent 384770e commit 8fc6907
File tree
2 files changed
+13
-6
lines changed- llvm
- lib/Target/AArch64
- test/CodeGen/AArch64
2 files changed
+13
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1578 | 1578 | | |
1579 | 1579 | | |
1580 | 1580 | | |
1581 | | - | |
| 1581 | + | |
1582 | 1582 | | |
1583 | 1583 | | |
1584 | 1584 | | |
| |||
1615 | 1615 | | |
1616 | 1616 | | |
1617 | 1617 | | |
1618 | | - | |
| 1618 | + | |
| 1619 | + | |
| 1620 | + | |
| 1621 | + | |
| 1622 | + | |
| 1623 | + | |
| 1624 | + | |
1619 | 1625 | | |
1620 | 1626 | | |
1621 | 1627 | | |
| |||
2550 | 2556 | | |
2551 | 2557 | | |
2552 | 2558 | | |
2553 | | - | |
2554 | | - | |
| 2559 | + | |
| 2560 | + | |
| 2561 | + | |
2555 | 2562 | | |
2556 | 2563 | | |
2557 | 2564 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
46 | | - | |
| 45 | + | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
0 commit comments