This works with debug entry value feature, which works by default.
Without call site parameter feature, debug entry value feature is of no use.
With current changes, debuggers should be able to show optimized out parameters by default.
Details
Diff Detail
Event Timeline
clang/lib/Frontend/CompilerInvocation.cpp | ||
---|---|---|
1648 | I am a bit confused now :) | |
llvm/test/DebugInfo/X86/callsitepar-fastisel.ll | ||
12 ↗ | (On Diff #332870) | I don't think this should be tested this way. We should be testing Driver itself. |
clang/lib/Frontend/CompilerInvocation.cpp | ||
---|---|---|
1648 | Classic flang calls same library. Below is the verbose output of "flang" command. Yes, I agree. I think there should be cases when even in C/C++ code this will be beneficial but not sure how frequent it shall be. We need to think about trade-off. Do you think it should be enabled only for Fortran or a command line option should be introduced to enable this otherwise it should disabled by default ? | |
llvm/test/DebugInfo/X86/callsitepar-fastisel.ll | ||
12 ↗ | (On Diff #332870) | Sure, I shall remove this test from here. |
clang/lib/Frontend/CompilerInvocation.cpp | ||
---|---|---|
1648 | I think we don't want this enabled by default at -O0. It doesn't run any optimizations that should eliminate parameters, so this is going to increase debug info size for no real benefit to the debugging experience. |
clang/lib/Frontend/CompilerInvocation.cpp | ||
---|---|---|
1648 | +1 to @probinson here. That's generally been the thinking behind why this was only enabled when optimizations are enabled. (there's some minor tradeoff here: call site descriptions in unoptimized code can still be useful if they call into optimized code, so this is a bit heuristical - assuming that all code will be compiled with the same optimization level) If flang is in a different situation and enables some optimizations at -O0 that make call site parameter descriptions beneficial even there, then maybe we'll need some different way to differentiate optimizations V no optimizations for the purpose of this feature. |
clang/lib/Frontend/CompilerInvocation.cpp | ||
---|---|---|
1648 | Thanks Paul for the comment. I shall probably add an option to enable in such cases which should remain off by default, Flang driver can pass that to compiler to turn it on. | |
1648 | Thanks David for your explanation and thoughts. Please also look at trigger to this https://reviews.llvm.org/D99160 It is needed in a Fortran case. I shall probably drop to enable it by default and add an option which by default is disabled and Fortran driver can pass that to make use of it. |
clang/lib/Frontend/CompilerInvocation.cpp | ||
---|---|---|
1648 | Sounds like @djtodoro is suggesting in https://reviews.llvm.org/D99160#2666106 that the "Bug" to fix here is the presence of DW_OP_call_value at -O0, it seems that could be an issue for the existing/original use of call_site_parameter/call_value (in C++/clang) as it would be for flang - so the fix should probably not be flang-specific if the issue isn't flang-specific. Understanding why we produce DW_OP_call_values at -O0, whether we can/should avoid that, what it costs (how much larger the debug info gets by adding DW_TAG_call_sites at -O0) would be necessary to determine the right path forward here. |
clang/lib/Frontend/CompilerInvocation.cpp | ||
---|---|---|
1648 | Thanks David for clarification. I shall look at it and get back. |
I am a bit confused now :)
Is flang using this clang's library?
I think we should be careful here, since I am not sure C/C++ -O0 code has any benefits of using this, but the DWARF size might be increased insanely.