[llvm] [RISCV] Add a pass to eliminate special copies in order to facilitate shrink-wrap optimization (PR #140716)

Sam Elliott via llvm-commits llvm-commits at lists.llvm.org
Tue May 20 22:59:45 PDT 2025


https://github.com/lenary commented:

Please can you add a test where the branch that uses `x10` (physical register) wants to move the copy after some inline assembly that clobbers `x10`. 

I think the input MIR would look something like:

```
...
  %0:gpr = COPY $x10
  <inline asm that clobbers $x10>
  %3:gpr = COPY %0:gpr
  BEQ %0:gpr, %3:gpr, %bb3
  PseudoBR $bb2
...
```

I am not sure you can propagate the copy in this case, but maybe you can?

https://github.com/llvm/llvm-project/pull/140716


More information about the llvm-commits mailing list