[PATCH] D17257: New utility class ReachingPhysDefs for post-ra analysis.

Jonas Paulsson via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 15 01:21:04 PST 2016


jonpa created this revision.
jonpa added reviewers: qcolombet, uweigand.
jonpa added a subscriber: llvm-commits.
Herald added a subscriber: aemerson.

AArch64CollectLOH.cpp contained an algorithm for analysing reaching  definitions of physregs globally. To make this available to other  targets, it has been factored out as an independent CodeGen class. This was originally suggested by Quentin Colombet.

The algorithm finds defs and users per register (color). It is possible to add any number of regs to be analyzed. The inverse map from user to defs per register is also built. The analyzis of operands is heavily overloadable to suit particular contexts, e.g. treating defs of a particular reg as a use etc.

SystemZElimCompare.cpp was the initial reason for trying this. It however turned out that using this gave only very marginal results. (70 more eliminated compares and 15 more fused compare/branch, where the total for these stats are ~200000). There were about 600 cases with multiple defs (pruned) that might theoretically be handled, but that seems unlikely to be worth the effort.

Since it is marginally better, it would still perhaps be preferred to use this new class, provided that other targets do the same, since that would reduce custom code also in the SystemZ backend (even thought it isn't much).

* The API is just beginning to take form, and is at this point just enough to use it in the SystemZ and AArch64 files. It is hopefully possible to add new data structures / query methods to suit any type of situation.
* The AARch64CollectLOH.cpp file has been rewritten to use this new class instead. That part of the patch is imperfect and should preferably  be looked over by a backend maintainer, plus verfied for NFC.


http://reviews.llvm.org/D17257

Files:
  include/llvm/CodeGen/ReachingPhysDefs.h
  lib/CodeGen/CMakeLists.txt
  lib/CodeGen/ReachingPhysDefs.cpp
  lib/Target/AArch64/AArch64CollectLOH.cpp
  lib/Target/SystemZ/SystemZElimCompare.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D17257.47954.patch
Type: text/x-patch
Size: 65150 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160215/b6f6e285/attachment.bin>


More information about the llvm-commits mailing list