[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
Mon May 30 08:12:42 PDT 2022


jonpa created this revision.
jonpa added a reviewer: uweigand.
Herald added a subscriber: hiraditya.
Herald added a project: All.
jonpa requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Performance results so far show minor changes both ways, overall a slight regression, which may be worth looking into. I however got several nice improvements with my first version of this patch which (by mistake sort of) loaded the fp constants into a full VR128 instead of a VR32/VR64. I found that I with that first patch got a lot more spilling overall (the vector regs are never callee saved, right), but however also some nice improvements:

  (VR128 version)
  Improvements:  
  0.938: f507.cactuBSSN_r 
  0.975: f544.nab_r 
  0.985: f511.povray_r 
  
  Regressions:
  1.016: i523.xalancbmk_r 

I am trying to look into why cactus is so much better and I know for one thing that in that particular file there is a lot *less* spilling for some reason when constants are loaded into full vector regs instead of VR32/64 ones (this is the same file that was improving previusly with fp-contract=off, with a huge function that is not that easy to analyze...). This could be something "random" or there may be an explanation / heuristic to be found. I am not sure why VR128 should work better... The VR128 version gave less spills than main or the VR32/VR64 version, which were about the same.

Not quite sure if it is necessary to have the new SystemZ::INSERT_FP_LANE - perhaps it would be easier to just emit the machine nodes directly there instead.

With a handling in foldMemoryOperandImpl(), I don't know much to improve except to try to figure out more about the cactus difference.


https://reviews.llvm.org/D126656

Files:
  llvm/lib/Target/SystemZ/SystemZAsmPrinter.cpp
  llvm/lib/Target/SystemZ/SystemZISelLowering.cpp
  llvm/lib/Target/SystemZ/SystemZISelLowering.h
  llvm/lib/Target/SystemZ/SystemZInstrFormats.td
  llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp
  llvm/lib/Target/SystemZ/SystemZInstrVector.td
  llvm/lib/Target/SystemZ/SystemZOperators.td
  llvm/lib/Target/SystemZ/SystemZScheduleZ13.td
  llvm/lib/Target/SystemZ/SystemZScheduleZ14.td
  llvm/lib/Target/SystemZ/SystemZScheduleZ15.td
  llvm/lib/Target/SystemZ/SystemZScheduleZ16.td
  llvm/test/CodeGen/SystemZ/foldmemop-fpimmviagpr.mir
  llvm/test/CodeGen/SystemZ/fp-const-13.ll
  llvm/test/CodeGen/SystemZ/vector-constrained-fp-intrinsics.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D126656.432926.patch
Type: text/x-patch
Size: 73578 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220530/b27ebf50/attachment-0001.bin>


More information about the llvm-commits mailing list