[PATCH] D126656: [SystemZ] Load FP immediates via a GPR instead of the constant pool.

Jonas Paulsson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 31 05:26:57 PDT 2022


jonpa added a comment.

I think I have found at least an interesting explanation: The reason the spilling decreased significantly when VR128 regs were used (VR128 = vlgg; extract subreg => use of VR128:subreg) is that those registers now have all the 32 registers to choose from. If however a VR64 is produced containing the immediate it will be constrained to FP64 whenever there is a user that folds a memory operand using an FP opcode. This makes many of those constants occupy FP64 regs instead of VR64, which increases reg-pressure significantly!

I have some ideas I will look into:

- rematerialize a load from constant pool
- avoid using FP reg/mem opcodes in case of high register pressure generally.

Comparing with fp-contract "off" (which previously ran faster), it looks like with "off" there are still less spills, but performance is the same. Not sure yet why there are less spills with "off", but IIRC that is a huge function (with huge blocks) with many FP constants that for some reason go through regalloc with a better result, even though I do not know why.  Seems very promising if it is possible to eliminate the extra spills per above...


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D126656/new/

https://reviews.llvm.org/D126656



More information about the llvm-commits mailing list