Commit e2036ea
committed
[AArch64] Fix handling of x29/x30/x31 in inline assembly clobbers
The AArch64 backend was silently ignoring inline assembly clobbers when
numeric register names (x29, x30, x31) were used instead of their
architectural aliases (fp, lr, sp). I found this bug via inline assembly
in Zig, which not normalize the register names the way clang does.
There is an incoplete workaround for this in Rust, but that only
handles `x30/lr`, not `x29/fp` and `x31/sp`. I thought it would make
sense to fix this properly rather than adding a workaround to Zig.
This patch adds explicit handling in getRegForInlineAsmConstraint() to
map both numeric and alias forms to the correct physical registers,
following the same pattern used by the RISC-V backend.1 parent 9361113 commit e2036ea
File tree
2 files changed
+50
-0
lines changed- llvm
- lib/Target/AArch64
- test/CodeGen/AArch64
2 files changed
+50
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
13126 | 13127 | | |
13127 | 13128 | | |
13128 | 13129 | | |
| 13130 | + | |
| 13131 | + | |
| 13132 | + | |
| 13133 | + | |
| 13134 | + | |
| 13135 | + | |
| 13136 | + | |
| 13137 | + | |
| 13138 | + | |
| 13139 | + | |
| 13140 | + | |
| 13141 | + | |
| 13142 | + | |
13129 | 13143 | | |
13130 | 13144 | | |
13131 | 13145 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
0 commit comments