[llvm] 157b626 - Revert "[DebugInfo][RemoveDIs] Don't pointlessly scan funcs for debug-info (#79327)"

Jeremy Morse via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 26 06:54:27 PST 2024


Author: Jeremy Morse
Date: 2024-01-26T14:53:07Z
New Revision: 157b62612a7c72094b5b35a6b01368e3221086cd

URL: https://github.com/llvm/llvm-project/commit/157b62612a7c72094b5b35a6b01368e3221086cd
DIFF: https://github.com/llvm/llvm-project/commit/157b62612a7c72094b5b35a6b01368e3221086cd.diff

LOG: Revert "[DebugInfo][RemoveDIs] Don't pointlessly scan funcs for debug-info (#79327)"

This reverts commit c23608b8d58bdeb0134d99168e6d0335da2c8366.

It looks like this depends on #79345, which isn't going to land today, so revert for now.

Added: 
    

Modified: 
    llvm/include/llvm/IR/BasicBlock.h
    llvm/lib/IR/BasicBlock.cpp
    llvm/lib/IR/Function.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/IR/BasicBlock.h b/llvm/include/llvm/IR/BasicBlock.h
index 39ac9a5cf4a5e40..a72b68d867f36e7 100644
--- a/llvm/include/llvm/IR/BasicBlock.h
+++ b/llvm/include/llvm/IR/BasicBlock.h
@@ -81,16 +81,12 @@ class BasicBlock final : public Value, // Basic blocks are data objects also
   /// intrinsics into DPMarker / DPValue records. Deletes all dbg.values in
   /// the process and sets IsNewDbgInfoFormat = true. Only takes effect if
   /// the UseNewDbgInfoFormat LLVM command line option is given.
-  /// \param HasNoDebugInfo Flag indicating the scan of instructions should be
-  /// skipped as the function is known to have no debug-info.
-  void convertToNewDbgValues(bool HasNoDebugInfo = false);
+  void convertToNewDbgValues();
 
   /// Convert variable location debugging information stored in DPMarkers and
   /// DPValues into the dbg.value intrinsic representation. Sets
   /// IsNewDbgInfoFormat = false.
-  /// \param HasNoDebugInfo Flag indicating the scan of instructions should be
-  /// skipped as the function is known to have no debug-info.
-  void convertFromNewDbgValues(bool HasNoDebugInfo = false);
+  void convertFromNewDbgValues();
 
   /// Ensure the block is in "old" dbg.value format (\p NewFlag == false) or
   /// in the new format (\p NewFlag == true), converting to the desired format

diff  --git a/llvm/lib/IR/BasicBlock.cpp b/llvm/lib/IR/BasicBlock.cpp
index e9d15989b6e5e8e..dca528328384701 100644
--- a/llvm/lib/IR/BasicBlock.cpp
+++ b/llvm/lib/IR/BasicBlock.cpp
@@ -60,17 +60,13 @@ DPMarker *BasicBlock::createMarker(InstListType::iterator It) {
   return DPM;
 }
 
-void BasicBlock::convertToNewDbgValues(bool HasNoDebugInfo) {
+void BasicBlock::convertToNewDbgValues() {
   // Is the command line option set?
   if (!UseNewDbgInfoFormat)
     return;
 
   IsNewDbgInfoFormat = true;
 
-  // If the caller knows there's no debug-info in this function, do nothing.
-  if (HasNoDebugInfo)
-    return;
-
   // Iterate over all instructions in the instruction list, collecting dbg.value
   // instructions and converting them to DPValues. Once we find a "real"
   // instruction, attach all those DPValues to a DPMarker in that instruction.
@@ -97,14 +93,10 @@ void BasicBlock::convertToNewDbgValues(bool HasNoDebugInfo) {
   }
 }
 
-void BasicBlock::convertFromNewDbgValues(bool HasNoDebugInfo) {
+void BasicBlock::convertFromNewDbgValues() {
   invalidateOrders();
   IsNewDbgInfoFormat = false;
 
-  // If the caller knows there's no debug-info in this function, do nothing.
-  if (HasNoDebugInfo)
-    return;
-
   // Iterate over the block, finding instructions annotated with DPMarkers.
   // Convert any attached DPValues to dbg.values and insert ahead of the
   // instruction.

diff  --git a/llvm/lib/IR/Function.cpp b/llvm/lib/IR/Function.cpp
index 58e180c2fd6a519..22e2455462bf445 100644
--- a/llvm/lib/IR/Function.cpp
+++ b/llvm/lib/IR/Function.cpp
@@ -83,17 +83,15 @@ static cl::opt<unsigned> NonGlobalValueMaxNameSize(
 
 void Function::convertToNewDbgValues() {
   IsNewDbgInfoFormat = true;
-  bool HasNoDebugInfo = getSubprogram() == nullptr;
   for (auto &BB : *this) {
-    BB.convertToNewDbgValues(HasNoDebugInfo);
+    BB.convertToNewDbgValues();
   }
 }
 
 void Function::convertFromNewDbgValues() {
   IsNewDbgInfoFormat = false;
-  bool HasNoDebugInfo = getSubprogram() == nullptr;
   for (auto &BB : *this) {
-    BB.convertFromNewDbgValues(HasNoDebugInfo);
+    BB.convertFromNewDbgValues();
   }
 }
 


        


More information about the llvm-commits mailing list