[llvm] SystemZ: Handle copies between gr64 and fp64 (PR #124890)

Ulrich Weigand via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 29 03:17:48 PST 2025


uweigand wrote:

> > Well, there is not any data type that is legal in both gr64 and fp64, so these copies would never come up. I'm wondering why this is needed now?
> 
> There would still be bitcasts, which I would expect to emit a copy. Peephole optimizer doesn't do a great job looking through various subregister patterns, which I'm working on fixing. Uncoalescable copies and bitcasts get rewritten

Right now, the bitcasts do not emit a copy but rather directly the LDGR/LGDR instruction patterns:
```
// Moves between 64-bit integer and floating-point registers.
def LGDR : UnaryRRE<"lgdr", 0xB3CD, bitconvert, GR64, FP64>;
def LDGR : UnaryRRE<"ldgr", 0xB3C1, bitconvert, FP64, GR64>;
```

If we add those instructions to `copyPhysReg`, *should* those bitcasts then just emit copies instead?


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


More information about the llvm-commits mailing list