[PATCH] D32673: [CaptureTracking] Handle capturing of launder.invariant.group

Piotr Padlewski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 4 19:48:39 PDT 2018


Prazek added inline comments.


================
Comment at: llvm/lib/Analysis/CaptureTracking.cpp:219
 
-  for (const Use &U : V->uses()) {
-    // If there are lots of uses, conservatively say that the value
-    // is captured to avoid taking too much compile time.
-    if (Count++ >= Threshold)
-      return Tracker->tooManyUses();
-
-    if (!Tracker->shouldExplore(&U)) continue;
-    Visited.insert(&U);
-    Worklist.push_back(&U);
-  }
+  auto AddUses = [&](const Value *V) {
+    int Count = 0;
----------------
xbolva00 wrote:
> is lambda better here? I would prefer seperate function personally.
I prefer lambda because it narrows function visibility to only this function, and capture of worklist and Visited set looks better than passing as a reference.


Repository:
  rL LLVM

https://reviews.llvm.org/D32673





More information about the llvm-commits mailing list