[PATCH] D122163: [StripDeadDebugInfo] Drop dead CUs
Mikhail Lychkov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 21 11:11:17 PDT 2022
mlychkov created this revision.
mlychkov added reviewers: loladiro, aprantl, dexonsmith, probinson.
mlychkov created this object with edit policy "Administrators".
Herald added subscribers: ormris, hiraditya.
Herald added a project: All.
mlychkov requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
In situations when a submodule is extracted from big module (i.e. using
CloneModule) a lot of debug info is copied via metadata nodes. Despite of
the fact that part of that info is not linked to any instruction in extracted
IR file, StripDeadDebugInfo pass doesn't drop them.
Harden criteria for debug info that should be kept in a module:
- Only those compile units are left that referenced by a subprogram debug info
node that is attached to a function definition in the module or to an instruction
in the module that belongs to an inlined function.
- Compile units are not left explicitly if they have const global expression.
They should be left if that const global is used in a function that is contained
in extracted module.
Signed-off-by: Mikhail Lychkov <mikhail.lychkov at intel.com>
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D122163
Files:
llvm/lib/Transforms/IPO/StripSymbols.cpp
llvm/test/Transforms/StripSymbols/strip-cu-with-const-gve.ll
llvm/test/Transforms/StripSymbols/strip-cu-with-dangling-subprogram.ll
llvm/test/Transforms/StripSymbols/strip-dead-debug-info.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D122163.417030.patch
Type: text/x-patch
Size: 9801 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220321/1693a60e/attachment.bin>
More information about the llvm-commits
mailing list