[llvm] [AMDGPU] Remove implicit defs on expanded mov64 pseudos (PR #190379)
Joe Nash via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 6 13:11:58 PDT 2026
Sisyph wrote:
> This has been a problem in situations where you need to scavenge an intermediate register between the two halves of an instruction (so this is a bigger problem for spills). I believe it's also a problem for the AGPR copy case where you need an intermediate VGPR
The only use of registerScavenger after PostRA pseudo expansion I saw is in Branch Relaxation.
The scenario below seems ok to me, better even than if v1 was forced live, but maybe there are other issues.
```
v_mov_b64 v[0:1], v[10:11]
...
v_fma_f64 ... v[0:1]
```
would expand to
```
v_mov_b32 v0, v10
v_mov_b32 v1, v11
...
v_fma_f64 ... v[0:1]
```
Without the superreg define, if we expand a long branch, we might see
```
v_mov_b32 v0, v10
...
spill sX to v1
...
restore sX free v1
...
v_mov_b32 v1, v11
...
fma_f64 .... v[0:1]
```
I think removing the supereg defines is safe, but let me know if problems come to mind. I'll plan to land this.
https://github.com/llvm/llvm-project/pull/190379
More information about the llvm-commits
mailing list