[PATCH] D75338: [Coroutines] Use dbg.declare for frame variables

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 28 09:19:32 PST 2020


aprantl added inline comments.


================
Comment at: llvm/test/Transforms/Coroutines/coro-debug-frame-variable.ll:877
+!653 = !DILocalVariable(name: "j", scope: !649, file: !5, line: 32, type: !130)
+!654 = !DILocation(line: 32, column: 7, scope: !649)
----------------
dstenb wrote:
> modocache wrote:
> > Beginner question of mine: is there a good way to reduce this debugging metadata to just the nodes that are necessary for my test? The 654 (!!) nodes here are the result of having run `llvm-reduce` on this test case, but I think many of these remaining nodes come from my having `#include <experimental/coroutine>` in my test program, and not actually necessary for the test case.
> Bugpoint can reduce metadata, but I have personally found that it is not the best at that. It might just be a PEBKAC problem though. I personally just try to minimize the number of metadata nodes that Clang emits by first creducing the source file,  omitting information that is not needed (e.g. passing -gno-column-info and -fno-strict-aliasing depending on situation), and then hand reducing the IR file.
> 
> In this case it seems that we can remove all the import node references in !108 (I assume they are not needed for this test case), and then run opt -S on the file, to remove all unused nodes. That leaves around 120 metadata nodes. I don't know much about C++ metadata (especially coroutines), so not sure how much more can be removed, but perhaps that is a start?
Delta `http://delta.tigris.org` is always your friend. My favorite trick is taking all nodes that are lists of metadata (`!1 = {!2, !3}`) and making sure the elements are on a separate line followed by a run of delta. Other methods include removing (most) !dbg attachments on instructions and of course removing all unnecessary dbg.value intrinsics and their dependencies. You can also replace most "parent:"-kind fields with a link to the DIFile or CU.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D75338





More information about the llvm-commits mailing list