[PATCH] D77677: [RDA] Don't explicitly store outgoing reaching defs (NFCI)

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 7 13:36:36 PDT 2020


nikic created this revision.
nikic added reviewers: samparker, SjoerdMeijer, craig.topper.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

We currently explicitly store the last reaching def at the end of a basic block. However, this information is already available as the last element in the reaching definitions vector -- they only differ in whether the reaching def is relative to the start or the end of the basic block.

This patch removes the separate `MBBOutRegsInfos` and instead computes the incoming reaching defs on the fly. For that purpose it does cache the number of (non-debug) instructions in each block.

Assuming D77513 <https://reviews.llvm.org/D77513> as baseline, this drops the memory requirement per basic block per reg unit from 12 to 8 bytes, which makes for an extra 1% saving <http://llvm-compile-time-tracker.com/compare.php?from=daffeb820ff2f31c90bc489c31ed47580174d447&to=5884ae703adf6ab58c45e932a8bd32a819fa8b2c&stat=max-rss> on sqlite compilation. It's not completely free (with about 0.05% increase in instructions retired), but that seems like a good tradeoff.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D77677

Files:
  include/llvm/CodeGen/ReachingDefAnalysis.h
  lib/CodeGen/ReachingDefAnalysis.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77677.255705.patch
Type: text/x-patch
Size: 6801 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200407/53fc261b/attachment.bin>


More information about the llvm-commits mailing list