[llvm] [RemoveDIs] Don't convert debug-info in bitcode-loading just now (PR #80865)

Jeremy Morse via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 6 08:21:57 PST 2024


https://github.com/jmorse created https://github.com/llvm/llvm-project/pull/80865

We've been building and testing this no-debug-intrinsic work inside of the pass manager for a while, so that optimisation passes get exercised and tested when we turn it on. However, by converting to the non-intrinsic form in the bitcode loader, we accidentally caused all parts of LLVM to potentially see non-intrinsic debug-info.

Seeing how we're trying to turn things on incrementally, it was a mistake to go this far this fast: we can instead just focus on enabling during optimisations for the moment, then all the other parts of LLVM later.

(@OCHyams @SLTozer this is what we've been talking about internally about "drawing the wrong line" through LLVM when staging these changes. Removing these hunks avoids every single tool in the repo having to immediately cope with RemoveDIs debug-info, and we can continue focusing on optimisations only).

>From eec3c258faeaf3aa4ae1a7ce91d88f1fa30638e8 Mon Sep 17 00:00:00 2001
From: Jeremy Morse <jeremy.morse at sony.com>
Date: Tue, 6 Feb 2024 15:10:15 +0000
Subject: [PATCH] [RemoveDIs] Don't convert debug-info in bitcode-loading just
 now

We've been building and testing this no-debug-intrinsic work inside of the
pass manager for a while, so that optimisation passes get exercised and
tested when we turn it on. However, by converting to the non-intrinsic form
in the bitcode loader, we accidentally caused all parts of LLVM to
potentially see non-intrinsic debug-info.

Seeing how we're trying to turn things on incrementally, it was a mistake
to go this far this fast: we can instead just focus on enabling during
optimisations for the moment, then all the other parts of LLVM later.
---
 llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
index 5b233fb365fe2..db86df2fdc72e 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -6632,9 +6632,6 @@ Error BitcodeReader::materialize(GlobalValue *GV) {
   if (Error Err = materializeMetadata())
     return Err;
 
-  bool NewDebugInfoRequested = F->IsNewDbgInfoFormat;
-  F->IsNewDbgInfoFormat = false;
-
   // Move the bit stream to the saved position of the deferred function body.
   if (Error JumpFailed = Stream.JumpToBit(DFII->second))
     return JumpFailed;
@@ -6710,14 +6707,6 @@ Error BitcodeReader::materialize(GlobalValue *GV) {
   // Look for functions that rely on old function attribute behavior.
   UpgradeFunctionAttributes(*F);
 
-  // If we've materialized a function set up in "new" debug-info mode, the
-  // contents just loaded will still be in dbg.value mode. Switch to the new
-  // mode now. NB: we can add more complicated logic here in the future to
-  // correctly identify when we do and don't need to autoupgrade.
-  if (NewDebugInfoRequested) {
-    F->convertToNewDbgValues();
-  }
-
   // Bring in any functions that this function forward-referenced via
   // blockaddresses.
   return materializeForwardReferencedFunctions();



More information about the llvm-commits mailing list