[PATCH] D127693: [mlgo] Fix accounting for SCC splits

Mircea Trofin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 14 17:49:26 PDT 2022


mtrofin accepted this revision.
mtrofin added inline comments.
This revision is now accepted and ready to land.


================
Comment at: llvm/lib/Analysis/MLInlineAdvisor.cpp:181
+
+  // Remember nodes in case the SCC is split before onPassExit
+  for (const auto &N : *LastSCC)
----------------
Northbadge wrote:
> mtrofin wrote:
> > point out we're reusing NodesInLastSCC for that, so it's clear that this is the intent: 1) drain it (lines 160-180), 2) remember.
> > 
> > I'd even add an `assert(NodesInLastSCC.empty())` right above the for loop - same reason, clarifies the design intent
> > 
> > Finally: I think you can do NodesInLastSCC.insert(LastSCC.begin(), LastSCC.end()) or smth like that (skipping the for)
> got it! but using SCC iterators won't work since we're inserting node pointers here, while the iterators would return nodes
ah, ok


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D127693



More information about the llvm-commits mailing list