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

Jin Xin Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 14 14:26:49 PDT 2022


Northbadge added inline comments.


================
Comment at: llvm/lib/Analysis/MLInlineAdvisor.cpp:181
+
+  // Remember nodes in case the SCC is split before onPassExit
+  for (const auto &N : *LastSCC)
----------------
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


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