Commit 3d5e8e4
[PAC][CodeGen] Do not emit trivial 'mov xN, xN' on tail call (llvm#109100)
Under some conditions, a trivial `mov xN xN` instruction was emitted on
tail calls. Consider the following code:
```
class Test {
public:
virtual void f() {}
};
void call_f(Test *t) {
t->f();
}
```
Correponding assembly:
```
_Z6call_fP4Test:
ldr x16, [x0]
mov x17, x0
movk x17, #6503, lsl #48
autda x16, x17
ldr x1, [x16]
=====> mov x16, x16
movk x16, llvm#54167, lsl #48
braa x1, x16
```
This patch makes such movs being omitted.
Co-authored-by: Anatoly Trosinenko <[email protected]>1 parent bb5e66e commit 3d5e8e4
File tree
2 files changed
+27
-5
lines changed- llvm
- lib/Target/AArch64
- test/CodeGen/AArch64
2 files changed
+27
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2510 | 2510 | | |
2511 | 2511 | | |
2512 | 2512 | | |
2513 | | - | |
2514 | | - | |
2515 | | - | |
2516 | | - | |
2517 | | - | |
| 2513 | + | |
| 2514 | + | |
| 2515 | + | |
| 2516 | + | |
| 2517 | + | |
| 2518 | + | |
2518 | 2519 | | |
2519 | 2520 | | |
2520 | 2521 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
170 | 191 | | |
171 | 192 | | |
172 | 193 | | |
| |||
0 commit comments