[llvm] [SystemZ] Improve shouldCoalesce() for i128. (PR #74942)

Jonas Paulsson via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 11 09:35:43 PST 2023


JonPsson1 wrote:

Sorry, but I am a little worried about that because if we only check the three-free for the coalesced GPR64, those three registers may be different ones than those free over the GPR128 interval. If we on the other hand decided to also check the GPR128 interval spanning many blocks that could in huge functions become a real compile time slowdown, I think.

Once i128:s live in 32 vector registers, I think this is much less needed. If GPR128:s are then only used one at a time in order to use a scalar instruction, there should not have to bee any intervening phys reg clobbers to make this problematic. I can only think of inline assembly instructions then to be potentially problematic and if we made sure they are not scheduled inside such a local GPR128 use, we would be safe. Another idea might be to emit the VLGV/VLVGP instructions directly without any COPYs so that we would never need any coalescing for GPR128 in the first place.

We could then instead add

 ```
 // The workaround below for regalloc running out of GPR128 registers is not
 // needed when vector registers are used for i128 values.
  if (MI->getMF()->getSubtarget<SystemZSubtarget>().hasVector())
    return true;
```

Perhaps in the future if support for earlier machines would be dropped this could even all be removed...



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


More information about the llvm-commits mailing list