[PATCH] D116403: [IR] Add DebugEntryValues pass
Milica Lazarevic via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 30 04:50:17 PST 2021
milica-lazarevic created this revision.
milica-lazarevic added reviewers: Orlando, jmorse, djtodoro, aprantl.
Herald added subscribers: ormris, dexonsmith, wenlei, steven_wu, hiraditya, mgorny.
milica-lazarevic requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
This IR pass collects the function parameters and maps them to their entry values. If parameter's value remains unchanged we can restore it original value and make it available in the debugging process. This pass introduces the using of DW_OP_LLVM_entry_value operation on IR level. Pass has been added to the default<O2 <https://reviews.llvm.org/owners/package/2/>> pass pipeline, right after the DeadArgumentEliminationPass.
When a function inlining happens, there is no typical parameter passing. This situation is handled by deleting calls to llvm.dbg.value instructions which describe the location of the variable as an entry value.
For understanding motivation for introducing this kind of feature, consider an example below:
extern void fn1 ();
long int __attribute__((noinline)) fn2 (long int x)
{
fn1();
return 0;
}
void fn3 (){
fn2(1);
}
Due to DeadArgumentEliminationPass, parameter //x// will be mark as //undef// and reported as //<optimized_out>// by the debugger. After applying DebugEntryValues pass, and with existence of corresponding DW_TAG_call_site_parameter, the parameter value will be available in the debugging process.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D116403
Files:
llvm/include/llvm/IR/DebugInfoMetadata.h
llvm/include/llvm/Transforms/Utils/DebugEntryValues.h
llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp
llvm/lib/IR/DebugInfoMetadata.cpp
llvm/lib/IR/Verifier.cpp
llvm/lib/Passes/PassBuilder.cpp
llvm/lib/Passes/PassBuilderPipelines.cpp
llvm/lib/Passes/PassRegistry.def
llvm/lib/Transforms/Utils/CMakeLists.txt
llvm/lib/Transforms/Utils/DebugEntryValues.cpp
llvm/lib/Transforms/Utils/InlineFunction.cpp
llvm/test/Other/new-pm-defaults.ll
llvm/test/Other/new-pm-thinlto-defaults.ll
llvm/test/Other/new-pm-thinlto-postlink-pgo-defaults.ll
llvm/test/Other/new-pm-thinlto-postlink-samplepgo-defaults.ll
llvm/test/Other/new-pm-thinlto-prelink-pgo-defaults.ll
llvm/test/Other/new-pm-thinlto-prelink-samplepgo-defaults.ll
llvm/test/Transforms/DebugEntryValues/no-param-change.ll
llvm/test/Transforms/DebugEntryValues/with-param-change.ll
llvm/test/Verifier/diexpression-entry-value-llvm-ir.ll
llvm/test/Verifier/diexpression-entry-value.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D116403.396636.patch
Type: text/x-patch
Size: 27432 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211230/b3c286d5/attachment.bin>
More information about the llvm-commits
mailing list