aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
diff options
context:
space:
mode:
authorJeremy Morse <jeremy.morse@sony.com>2025-04-01 14:27:11 +0100
committerGitHub <noreply@github.com>2025-04-01 14:27:11 +0100
commit1ebc308bba0e1403b9fb3ba0fbadc66e182138e0 (patch)
tree225b80b8aeea143ef5dc3f2d667d63d89217e0f5 /llvm/lib/Bitcode/Reader/BitcodeReader.cpp
parenta1e041b64648789897c96eca5d6270e253773d16 (diff)
downloadllvm-1ebc308bba0e1403b9fb3ba0fbadc66e182138e0.zip
llvm-1ebc308bba0e1403b9fb3ba0fbadc66e182138e0.tar.gz
llvm-1ebc308bba0e1403b9fb3ba0fbadc66e182138e0.tar.bz2
[DebugInfo][RemoveDIs] Remove debug-intrinsic printing cmdline options (#131855)
During the transition from debug intrinsics to debug records, we used several different command line options to customise handling: the printing of debug records to bitcode and textual could be independent of how the debug-info was represented inside a module, whether the autoupgrader ran could be customised. This was all valuable during development, but now that totally removing debug intrinsics is coming up, this patch removes those options in favour of a single flag (experimental-debuginfo-iterators), which enables autoupgrade, in-memory debug records, and debug record printing to bitcode and textual IR. We need to do this ahead of removing the experimental-debuginfo-iterators flag, to reduce the amount of test-juggling that happens at that time. There are quite a number of weird test behaviours related to this -- some of which I simply delete in this commit. Things like print-non-instruction-debug-info.ll , the test suite now checks for debug records in all tests, and we don't want to check we can print as intrinsics. Or the update_test_checks tests -- these are duplicated with write-experimental-debuginfo=false to ensure file writing for intrinsics is correct, but that's something we're imminently going to delete. A short survey of curious test changes: * free-intrinsics.ll: we don't need to test that debug-info is a zero cost intrinsic, because we won't be using intrinsics in the future. * undef-dbg-val.ll: apparently we pinned this to non-RemoveDIs in-memory mode while we sorted something out; it works now either way. * salvage-cast-debug-info.ll: was testing intrinsics-in-memory get salvaged, isn't necessary now * localize-constexpr-debuginfo.ll: was producing "dead metadata" intrinsics for optimised-out variable values, dbg-records takes the (correct) representation of poison/undef as an operand. Looks like we didn't update this in the past to avoid spurious test differences. * Transforms/Scalarizer/dbginfo.ll: this test was explicitly testing that debug-info affected codegen, and we deferred updating the tests until now. This is just one of those silent gnochange issues that get fixed by RemoveDIs. Finally: I've added a bitcode test, dbg-intrinsics-autoupgrade.ll.bc, that checks we can autoupgrade debug intrinsics that are in bitcode into the new debug records.
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r--llvm/lib/Bitcode/Reader/BitcodeReader.cpp23
1 files changed, 3 insertions, 20 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
index b0d9bcc..4de3c4f 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -102,18 +102,8 @@ static cl::opt<bool> ExpandConstantExprs(
cl::desc(
"Expand constant expressions to instructions for testing purposes"));
-/// Load bitcode directly into RemoveDIs format (use debug records instead
-/// of debug intrinsics). UNSET is treated as FALSE, so the default action
-/// is to do nothing. Individual tools can override this to incrementally add
-/// support for the RemoveDIs format.
-cl::opt<cl::boolOrDefault> LoadBitcodeIntoNewDbgInfoFormat(
- "load-bitcode-into-experimental-debuginfo-iterators", cl::Hidden,
- cl::desc("Load bitcode directly into the new debug info format (regardless "
- "of input format)"));
extern cl::opt<bool> UseNewDbgInfoFormat;
extern cl::opt<cl::boolOrDefault> PreserveInputDbgFormat;
-extern bool WriteNewDbgInfoFormatToBitcode;
-extern cl::opt<bool> WriteNewDbgInfoFormat;
namespace {
@@ -4492,14 +4482,9 @@ Error BitcodeReader::parseGlobalIndirectSymbolRecord(
Error BitcodeReader::parseModule(uint64_t ResumeBit,
bool ShouldLazyLoadMetadata,
ParserCallbacks Callbacks) {
- // Load directly into RemoveDIs format if LoadBitcodeIntoNewDbgInfoFormat
- // has been set to true and we aren't attempting to preserve the existing
- // format in the bitcode (default action: load into the old debug format).
- if (PreserveInputDbgFormat != cl::boolOrDefault::BOU_TRUE) {
- TheModule->IsNewDbgInfoFormat =
- UseNewDbgInfoFormat &&
- LoadBitcodeIntoNewDbgInfoFormat != cl::boolOrDefault::BOU_FALSE;
- }
+ // In preparation for the deletion of debug-intrinsics, don't allow module
+ // loading to escape intrinsics being autoupgraded to debug records.
+ TheModule->IsNewDbgInfoFormat = UseNewDbgInfoFormat;
this->ValueTypeCallback = std::move(Callbacks.ValueType);
if (ResumeBit) {
@@ -7026,8 +7011,6 @@ Error BitcodeReader::materialize(GlobalValue *GV) {
SeenAnyDebugInfo ? SeenDebugRecord : F->getParent()->IsNewDbgInfoFormat;
if (SeenAnyDebugInfo) {
UseNewDbgInfoFormat = SeenDebugRecord;
- WriteNewDbgInfoFormatToBitcode = SeenDebugRecord;
- WriteNewDbgInfoFormat = SeenDebugRecord;
}
// If the module's debug info format doesn't match the observed input
// format, then set its format now; we don't need to call the conversion