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

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 8 14:08:34 PDT 2020


nikic marked an inline comment as done.
nikic added inline comments.


================
Comment at: lib/CodeGen/ReachingDefAnalysis.cpp:98
     // Find the most recent reaching definition from a predecessor.
-    for (unsigned Unit = 0; Unit != NumRegUnits; ++Unit)
-      LiveRegs[Unit] = std::max(LiveRegs[Unit], Incoming[Unit]);
+    int NumInsts = MBBNumInsts[pred->getNumber()];
+    for (unsigned Unit = 0; Unit != NumRegUnits; ++Unit) {
----------------
samparker wrote:
> Maybe now would be a good time to encapsulate these MBB details in their own class, instead of several separate vectors and a vector of vectors?
I'm planning to submit one more patch (last one, I promise!) that changes the reaching def storage from MBBNumber => RegUnit => Defs to RegUnit => MBBNumber => Defs, because that allows us not to allocate any storage for register units that are unused in a function. Prototype implementation at https://gist.github.com/nikic/45d4c76338637331bd7048348398833d. Haven't put this up yet, because I didn't measure an actual max-rss improvement with it. I suspect that RDA memory usage is now low enough that the peak memory usage moved somewhere else.

In any case, with that patch the reaching defs storage would not be indexed by MBBNumber first anymore, so it would have to be separate from the NumInsts storage.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77677





More information about the llvm-commits mailing list