[llvm] [RemoveDIs] Load into new debug info format by default in llvm-reduce (PR #86275)

Orlando Cazalet-Hyams via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 22 05:32:36 PDT 2024


https://github.com/OCHyams created https://github.com/llvm/llvm-project/pull/86275

Directly load all bitcode into the new debug info format in llvm-reduce. This means that new-mode bitcode no longer round-trips back to old-mode after parsing, and that old-mode bitcode gets auto-upgraded to new-mode debug info (which is the current in-memory default in LLVM).

>From 6f4e3f12536468e4fb6b3ce96b8b68ca9ca1f8fd Mon Sep 17 00:00:00 2001
From: Orlando Cazalet-Hyams <orlando.hyams at sony.com>
Date: Fri, 22 Mar 2024 12:27:05 +0000
Subject: [PATCH] llvm-reduce

---
 llvm/tools/llvm-reduce/llvm-reduce.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/llvm/tools/llvm-reduce/llvm-reduce.cpp b/llvm/tools/llvm-reduce/llvm-reduce.cpp
index f913771487afe1..618770a5ca4d01 100644
--- a/llvm/tools/llvm-reduce/llvm-reduce.cpp
+++ b/llvm/tools/llvm-reduce/llvm-reduce.cpp
@@ -106,6 +106,7 @@ static cl::opt<bool> TryUseNewDbgInfoFormat(
     cl::init(false));
 
 extern cl::opt<bool> UseNewDbgInfoFormat;
+extern cl::opt<cl::boolOrDefault> LoadBitcodeIntoNewDbgInfoFormat;
 
 static codegen::RegisterCodeGenFlags CGF;
 
@@ -149,6 +150,9 @@ int main(int Argc, char **Argv) {
 
   cl::HideUnrelatedOptions({&LLVMReduceOptions, &getColorCategory()});
   cl::ParseCommandLineOptions(Argc, Argv, "LLVM automatic testcase reducer.\n");
+  // Load bitcode into the new debug info format by default.
+  if (LoadBitcodeIntoNewDbgInfoFormat == cl::boolOrDefault::BOU_UNSET)
+    LoadBitcodeIntoNewDbgInfoFormat = cl::boolOrDefault::BOU_TRUE;
 
   // RemoveDIs debug-info transition: tests may request that we /try/ to use the
   // new debug-info format.



More information about the llvm-commits mailing list