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

Xun Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 27 20:40:37 PDT 2021


lxfind 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;
----------------
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.


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

https://reviews.llvm.org/D97673



More information about the llvm-commits mailing list