Skip to content

Commit 8c5d9c7

Browse files
committed
Revert "[MLIR][Flang][DebugInfo] Set debug info format in MLIR->IR translation (#95098)"
Reverted due to failure on buildbot due to missing use of the WriteNewDbgInfoFormat flag in MLIR. This reverts commit ca920bb.
1 parent ffc3a6b commit 8c5d9c7

File tree

2 files changed

+0
-19
lines changed

2 files changed

+0
-19
lines changed

flang/lib/Frontend/FrontendActions.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
#include "llvm/Analysis/TargetTransformInfo.h"
5151
#include "llvm/Bitcode/BitcodeWriterPass.h"
5252
#include "llvm/CodeGen/MachineOptimizationRemarkEmitter.h"
53-
#include "llvm/IR/DebugProgramInstruction.h"
5453
#include "llvm/IR/LLVMRemarkStreamer.h"
5554
#include "llvm/IR/LegacyPassManager.h"
5655
#include "llvm/IR/Verifier.h"
@@ -82,8 +81,6 @@ using namespace Fortran::frontend;
8281
llvm::PassPluginLibraryInfo get##Ext##PluginInfo();
8382
#include "llvm/Support/Extension.def"
8483

85-
extern llvm::cl::opt<bool> WriteNewDbgInfoFormat;
86-
8784
/// Save the given \c mlirModule to a temporary .mlir file, in a location
8885
/// decided by the -save-temps flag. No files are produced if the flag is not
8986
/// specified.
@@ -1274,12 +1271,6 @@ void CodeGenAction::executeAction() {
12741271
runOptimizationPipeline(ci.isOutputStreamNull() ? *os : ci.getOutputStream());
12751272

12761273
if (action == BackendActionTy::Backend_EmitLL) {
1277-
// When printing LLVM IR, we should convert the module to the debug info
1278-
// format that LLVM expects us to print.
1279-
llvm::ScopedDbgInfoFormatSetter FormatSetter(*llvmModule,
1280-
WriteNewDbgInfoFormat);
1281-
if (WriteNewDbgInfoFormat)
1282-
llvmModule->removeDebugIntrinsicDeclarations();
12831274
llvmModule->print(ci.isOutputStreamNull() ? *os : ci.getOutputStream(),
12841275
/*AssemblyAnnotationWriter=*/nullptr);
12851276
return;

mlir/lib/Target/LLVMIR/ModuleTranslation.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@ using namespace mlir;
6464
using namespace mlir::LLVM;
6565
using namespace mlir::LLVM::detail;
6666

67-
extern llvm::cl::opt<bool> UseNewDbgInfoFormat;
68-
6967
#include "mlir/Dialect/LLVMIR/LLVMConversionEnumsToLLVM.inc"
7068

7169
namespace {
@@ -1791,9 +1789,6 @@ prepareLLVMModule(Operation *m, llvm::LLVMContext &llvmContext,
17911789
StringRef name) {
17921790
m->getContext()->getOrLoadDialect<LLVM::LLVMDialect>();
17931791
auto llvmModule = std::make_unique<llvm::Module>(name, llvmContext);
1794-
// ModuleTranslation can currently only construct modules in the old debug
1795-
// info format, so set the flag accordingly.
1796-
llvmModule->setNewDbgInfoFormatFlag(false);
17971792
if (auto dataLayoutAttr =
17981793
m->getDiscardableAttr(LLVM::LLVMDialect::getDataLayoutAttrName())) {
17991794
llvmModule->setDataLayout(cast<StringAttr>(dataLayoutAttr).getValue());
@@ -1872,11 +1867,6 @@ mlir::translateModuleToLLVMIR(Operation *module, llvm::LLVMContext &llvmContext,
18721867
if (failed(translator.convertFunctions()))
18731868
return nullptr;
18741869

1875-
// Once we've finished constructing elements in the module, we should convert
1876-
// it to use the debug info format desired by LLVM.
1877-
// See https://llvm.org/docs/RemoveDIsDebugInfo.html
1878-
translator.llvmModule->setIsNewDbgInfoFormat(UseNewDbgInfoFormat);
1879-
18801870
if (!disableVerification &&
18811871
llvm::verifyModule(*translator.llvmModule, &llvm::errs()))
18821872
return nullptr;

0 commit comments

Comments
 (0)