[PATCH] D97673: [RFC] [[Coroutine] [Debug] Salvage dbg.values

Chuanqi Xu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 27 20:56:07 PDT 2021


ChuanqiXu added inline comments.


================
Comment at: llvm/lib/Transforms/Coroutines/CoroFrame.cpp:2305-2308
+  for (auto *V : FrameData.getAllDefs()) {
+    // We would handle alloca specially.
+    if (isa<AllocaInst>(V))
+      continue;
----------------
lxfind wrote:
> ChuanqiXu wrote:
> > lxfind wrote:
> > > This is basically iterating over `FrameData.Spills` and obtain `.first` on the iterator
> > Yes, I am just wondering if the code now makes the semantics more clear. If we write
> > ```
> > for (auto *Iter : FrameData.Spills) {
> >      auto *V = Iter.first;
> >      // ...
> > }
> > ```
> > we need to comment that we would handle alloca specially. And the style tells it in the level of code.
> Well for one, we process Spills and Allocas separately everywhere (that's the intention of separating them as two fields anyway). And another reason is getAllDefs() reconstruct a new vector to hold all elements, which is costly.
Done, your suggestion makes sense.


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

https://reviews.llvm.org/D97673



More information about the llvm-commits mailing list