[PATCH] D118316: [PowerPC] Materialize special ConstantFP using instructions instead of load from TOC

Nemanja Ivanovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 7 02:47:10 PST 2022


nemanjai added a comment.

I am wondering if you have done any performance comparison or even just latency/throughput "back-of-the-envelope" computation for this. It doesn't seem obvious to me that this is better than a CP load. The conversion is a fairly expensive instruction. Another less compelling thing to consider is that in high register pressure situations (for VMX registers), the `VSPLTISW` may cause a spill.

One thing to note is that this necessarily replaces the cracked `lfs` instruction which is also expensive, so this transformation may be worthwhile. However, I wonder how this transformation would compare to stopping the conversion from double precision to single precision for constants on Power9 (i.e. return `false` from `ShouldShrinkFPConstant()` on Power9). This would of course grow the constant pool in situations where a lot of compact constants are loaded, but presumably this is a somewhat rare situation.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D118316



More information about the llvm-commits mailing list