[PATCH] D67437: [SystemZ] Swap compare operands in foldMemoryOperandImpl() if possible.

Jonas Paulsson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 9 12:54:42 PST 2020


jonpa updated this revision to Diff 237167.
jonpa added a comment.

Patch extended to also fold reloads into conditional load operands (both LOCR and SELR).

                                                                                          

The mapping from LOC(G)R to LOC(G) gives ~ 250 folded instructions on SPEC 2006.

                                                                                          

New MemFoldPseudo instructions for LOCG and LOCMux, so that the SELGR/SELRMux can be mapped to them, and later handled in SystemZPostRewrite as was already done previously for e.g. AG. This gives ~100 folded cases becoming LOC on SPEC 2006 on z15. There were no cases of COPYs insterted in SystemZPostRewrite due to this on the given day on SPEC 2006.

There are two new MemFoldPseudo opcodes that are not used since we always use LOCRMux : LOCFH_MemFoldPseudo and LOC_MemFoldPseudo.

These mappings are superfluous in getMemOpcode():

  LOCFHR -> LOCFH 
  LOCR   -> LOC        
  SELR   -> LOC_MemFoldPseudo

in getTargetMemOpcode():

  LOCFH_MemFoldPseudo -> LOCFH  
  LOC_MemFoldPseudo   -> LOC  

New test case for folding reload into LOCG/LOCMux both on z14 and z15.

Perhaps just reuse reverseCCMask() in SystemZISelLowering.cpp instead of the new SystemZ::getSwappedCCMask() ..?


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

https://reviews.llvm.org/D67437

Files:
  llvm/lib/Target/SystemZ/SystemZISelLowering.cpp
  llvm/lib/Target/SystemZ/SystemZInstrFormats.td
  llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp
  llvm/lib/Target/SystemZ/SystemZInstrInfo.h
  llvm/lib/Target/SystemZ/SystemZInstrInfo.td
  llvm/test/CodeGen/SystemZ/cond-move-10.ll
  llvm/test/CodeGen/SystemZ/int-cmp-56.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D67437.237167.patch
Type: text/x-patch
Size: 29004 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200109/fa4f0faf/attachment.bin>


More information about the llvm-commits mailing list