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

Sam Parker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 14 02:37:09 PDT 2020


samparker 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) {
----------------
nikic wrote:
> 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.
Okay. Maybe another way to make this code a bit easier to follow would be to make getIncomingReachingDef take the Unit and the predecessor?


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