Skip to content

Commit

Permalink
[DebugInfo][RemoveDIs] Make debugify pass convert to/from RemoveDIs m…
Browse files Browse the repository at this point in the history
…ode (#73251)

Debugify is extremely useful as a testing and debugging tool, and a good
number of LLVM-IR transform tests use it. We need it to support "new"
non-instruction debug-info to get test coverage, but it's not important
enough to completely convert right now (and it'd be a large
undertaking). Thus: convert to/from dbg.value/DPValue mode on entry and
exit of the pass, which gives us the functionality without any further
work. The cost is compile-time, but again this is only happening during
tests.

Tested by: the large set of debugify tests enabled here. Note the
InstCombine test (cast-mul-select.ll) that hasn't been fully enabled:
this is because there's a debug-info sinking piece of code there that
hasn't been instrumented.
  • Loading branch information
jmorse committed Nov 29, 2023
1 parent 15798f4 commit d2d9dc8
Show file tree
Hide file tree
Showing 33 changed files with 101 additions and 6 deletions.
65 changes: 59 additions & 6 deletions llvm/lib/Transforms/Utils/Debugify.cpp
Expand Up @@ -801,7 +801,15 @@ bool checkDebugifyMetadata(Module &M,
/// legacy module pass manager.
struct DebugifyModulePass : public ModulePass {
bool runOnModule(Module &M) override {
return applyDebugify(M, Mode, DebugInfoBeforePass, NameOfWrappedPass);
bool NewDebugMode = M.IsNewDbgInfoFormat;
if (NewDebugMode)
M.convertFromNewDbgValues();

bool Result = applyDebugify(M, Mode, DebugInfoBeforePass, NameOfWrappedPass);

if (NewDebugMode)
M.convertToNewDbgValues();
return Result;
}

DebugifyModulePass(enum DebugifyMode Mode = DebugifyMode::SyntheticDebugInfo,
Expand All @@ -826,7 +834,15 @@ struct DebugifyModulePass : public ModulePass {
/// single function, used with the legacy module pass manager.
struct DebugifyFunctionPass : public FunctionPass {
bool runOnFunction(Function &F) override {
return applyDebugify(F, Mode, DebugInfoBeforePass, NameOfWrappedPass);
bool NewDebugMode = F.IsNewDbgInfoFormat;
if (NewDebugMode)
F.convertFromNewDbgValues();

bool Result = applyDebugify(F, Mode, DebugInfoBeforePass, NameOfWrappedPass);

if (NewDebugMode)
F.convertToNewDbgValues();
return Result;
}

DebugifyFunctionPass(
Expand All @@ -852,13 +868,24 @@ struct DebugifyFunctionPass : public FunctionPass {
/// legacy module pass manager.
struct CheckDebugifyModulePass : public ModulePass {
bool runOnModule(Module &M) override {
bool NewDebugMode = M.IsNewDbgInfoFormat;
if (NewDebugMode)
M.convertFromNewDbgValues();

bool Result;
if (Mode == DebugifyMode::SyntheticDebugInfo)
return checkDebugifyMetadata(M, M.functions(), NameOfWrappedPass,
Result = checkDebugifyMetadata(M, M.functions(), NameOfWrappedPass,
"CheckModuleDebugify", Strip, StatsMap);
return checkDebugInfoMetadata(
else
Result = checkDebugInfoMetadata(
M, M.functions(), *DebugInfoBeforePass,
"CheckModuleDebugify (original debuginfo)", NameOfWrappedPass,
OrigDIVerifyBugsReportFilePath);

if (NewDebugMode)
M.convertToNewDbgValues();

return Result;
}

CheckDebugifyModulePass(
Expand Down Expand Up @@ -891,16 +918,26 @@ struct CheckDebugifyModulePass : public ModulePass {
/// with the legacy module pass manager.
struct CheckDebugifyFunctionPass : public FunctionPass {
bool runOnFunction(Function &F) override {
bool NewDebugMode = F.IsNewDbgInfoFormat;
if (NewDebugMode)
F.convertFromNewDbgValues();

Module &M = *F.getParent();
auto FuncIt = F.getIterator();
bool Result;
if (Mode == DebugifyMode::SyntheticDebugInfo)
return checkDebugifyMetadata(M, make_range(FuncIt, std::next(FuncIt)),
Result = checkDebugifyMetadata(M, make_range(FuncIt, std::next(FuncIt)),
NameOfWrappedPass, "CheckFunctionDebugify",
Strip, StatsMap);
return checkDebugInfoMetadata(
else
Result = checkDebugInfoMetadata(
M, make_range(FuncIt, std::next(FuncIt)), *DebugInfoBeforePass,
"CheckFunctionDebugify (original debuginfo)", NameOfWrappedPass,
OrigDIVerifyBugsReportFilePath);

if (NewDebugMode)
F.convertToNewDbgValues();
return Result;
}

CheckDebugifyFunctionPass(
Expand Down Expand Up @@ -972,13 +1009,21 @@ createDebugifyFunctionPass(enum DebugifyMode Mode,
}

PreservedAnalyses NewPMDebugifyPass::run(Module &M, ModuleAnalysisManager &) {
bool NewDebugMode = M.IsNewDbgInfoFormat;
if (NewDebugMode)
M.convertFromNewDbgValues();

if (Mode == DebugifyMode::SyntheticDebugInfo)
applyDebugifyMetadata(M, M.functions(),
"ModuleDebugify: ", /*ApplyToMF*/ nullptr);
else
collectDebugInfoMetadata(M, M.functions(), *DebugInfoBeforePass,
"ModuleDebugify (original debuginfo)",
NameOfWrappedPass);

if (NewDebugMode)
M.convertToNewDbgValues();

PreservedAnalyses PA;
PA.preserveSet<CFGAnalyses>();
return PA;
Expand Down Expand Up @@ -1010,6 +1055,10 @@ FunctionPass *createCheckDebugifyFunctionPass(

PreservedAnalyses NewPMCheckDebugifyPass::run(Module &M,
ModuleAnalysisManager &) {
bool NewDebugMode = M.IsNewDbgInfoFormat;
if (NewDebugMode)
M.convertFromNewDbgValues();

if (Mode == DebugifyMode::SyntheticDebugInfo)
checkDebugifyMetadata(M, M.functions(), NameOfWrappedPass,
"CheckModuleDebugify", Strip, StatsMap);
Expand All @@ -1018,6 +1067,10 @@ PreservedAnalyses NewPMCheckDebugifyPass::run(Module &M,
M, M.functions(), *DebugInfoBeforePass,
"CheckModuleDebugify (original debuginfo)", NameOfWrappedPass,
OrigDIVerifyBugsReportFilePath);

if (NewDebugMode)
M.convertToNewDbgValues();

return PreservedAnalyses::all();
}

Expand Down
1 change: 1 addition & 0 deletions llvm/test/Transforms/ArgumentPromotion/pr27568.ll
@@ -1,6 +1,7 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --scrub-attributes
; RUN: opt -S -passes=argpromotion < %s | FileCheck %s
; RUN: opt -S -passes=debugify -o /dev/null < %s
; RUN: opt -S -passes=debugify -o /dev/null < %s --try-experimental-debuginfo-iterators
target triple = "x86_64-pc-windows-msvc"

define internal void @callee(ptr) {
Expand Down
1 change: 1 addition & 0 deletions llvm/test/Transforms/BDCE/basic.ll
@@ -1,6 +1,7 @@
; RUN: opt -S -passes='bdce,instsimplify' < %s | FileCheck %s
; RUN: opt -S -passes=instsimplify < %s | FileCheck %s -check-prefix=CHECK-IO
; RUN: opt -S -passes='debugify,bdce' < %s | FileCheck %s -check-prefix=DEBUGIFY
; RUN: opt -S -passes='debugify,bdce' < %s --try-experimental-debuginfo-iterators | FileCheck %s -check-prefix=DEBUGIFY
target datalayout = "E-m:e-i64:64-n32:64"
target triple = "powerpc64-unknown-linux-gnu"

Expand Down
1 change: 1 addition & 0 deletions llvm/test/Transforms/DCE/basic.ll
@@ -1,4 +1,5 @@
; RUN: opt -passes='module(debugify),function(dce)' -S < %s | FileCheck %s
; RUN: opt -passes='module(debugify),function(dce)' -S < %s --try-experimental-debuginfo-iterators | FileCheck %s

; CHECK-LABEL: @test
define void @test() {
Expand Down
1 change: 1 addition & 0 deletions llvm/test/Transforms/DeadStoreElimination/debuginfo.ll
@@ -1,4 +1,5 @@
; RUN: opt < %s -passes=debugify,dse -S | FileCheck %s
; RUN: opt < %s -passes=debugify,dse -S --try-experimental-debuginfo-iterators | FileCheck %s

target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128"

Expand Down
@@ -1,4 +1,5 @@
; RUN: opt -S -passes=debugify,globalopt -f %s | FileCheck %s
; RUN: opt -S -passes=debugify,globalopt -f %s --try-experimental-debuginfo-iterators | FileCheck %s

@foo = internal global i32 0, align 4

Expand Down
1 change: 1 addition & 0 deletions llvm/test/Transforms/InstCombine/call-guard.ll
@@ -1,6 +1,7 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -passes=instcombine -S | FileCheck %s
; RUN: opt < %s -passes=instcombine -S -debugify-each | FileCheck %s
; RUN: opt < %s -passes=instcombine -S -debugify-each --try-experimental-debuginfo-iterators | FileCheck %s

declare void @llvm.experimental.guard(i1, ...)

Expand Down
4 changes: 4 additions & 0 deletions llvm/test/Transforms/InstCombine/cast-mul-select.ll
Expand Up @@ -2,6 +2,10 @@
; RUN: opt < %s -passes=instcombine -S | FileCheck %s
; RUN: opt -passes=debugify,instcombine -S < %s | FileCheck %s -check-prefix DBGINFO

; FIXME RemoveDIs project: instcombine instruction sinking, and the
; corresponding debug-info updates that are required, are not yet implemented.
; run: opt -passes=debugify,instcombine -S < %s --try-experimental-debuginfo-iterators | FileCheck %s -check-prefix DBGINFO

target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32"

define i32 @mul(i32 %x, i32 %y) {
Expand Down
1 change: 1 addition & 0 deletions llvm/test/Transforms/InstCombine/debuginfo-variables.ll
@@ -1,4 +1,5 @@
; RUN: opt < %s -passes=debugify,instcombine -S | FileCheck %s
; RUN: opt < %s -passes=debugify,instcombine -S --try-experimental-debuginfo-iterators | FileCheck %s

declare void @escape32(i32)

Expand Down
1 change: 1 addition & 0 deletions llvm/test/Transforms/InstCombine/double-float-shrink-2.ll
Expand Up @@ -7,6 +7,7 @@
; RUN: opt < %s -passes=instcombine -S -mtriple "x86_64-pc-mingw32" | FileCheck %s --check-prefixes=CHECK,DOUBLE-8BYTE-ALIGN
; RUN: opt < %s -passes=instcombine -S -mtriple "sparc-sun-solaris" | FileCheck %s --check-prefixes=CHECK,DOUBLE-8BYTE-ALIGN
; RUN: opt < %s -passes=instcombine -S -mtriple "x86_64-pc-win32" -enable-debugify 2>&1 | FileCheck --check-prefix=DBG-VALID %s
; RUN: opt < %s -passes=instcombine -S -mtriple "x86_64-pc-win32" -enable-debugify 2>&1 --try-experimental-debuginfo-iterators | FileCheck --check-prefix=DBG-VALID %s

declare double @floor(double)
declare double @ceil(double)
Expand Down
1 change: 1 addition & 0 deletions llvm/test/Transforms/InstCombine/storemerge-dbg.ll
@@ -1,4 +1,5 @@
; RUN: opt < %s -passes=debugify,instcombine -S | FileCheck %s
; RUN: opt < %s -passes=debugify,instcombine -S --try-experimental-debuginfo-iterators | FileCheck %s

declare i32 @escape(i32)

Expand Down
1 change: 1 addition & 0 deletions llvm/test/Transforms/JumpThreading/branch-debug-info.ll
@@ -1,4 +1,5 @@
; RUN: opt -S -passes=debugify,jump-threading < %s | FileCheck %s
; RUN: opt -S -passes=debugify,jump-threading < %s --try-experimental-debuginfo-iterators | FileCheck %s
; Tests Bug 37966

define void @test0(i32 %i) {
Expand Down
@@ -1,4 +1,5 @@
; RUN: opt < %s -passes='debugify,function(loop-mssa(licm))' -S -o /dev/null
; RUN: opt < %s -passes='debugify,function(loop-mssa(licm))' -S -o /dev/null --try-experimental-debuginfo-iterators
;
; The following test is from https://bugs.llvm.org/show_bug.cgi?id=36238
; This test should pass (not assert or fault). The error that originally
Expand Down
1 change: 1 addition & 0 deletions llvm/test/Transforms/LCSSA/basictest.ll
@@ -1,5 +1,6 @@
; RUN: opt < %s -passes=lcssa -S | FileCheck %s
; RUN: opt < %s -passes=debugify,lcssa -S | FileCheck -check-prefix=DEBUGIFY %s
; RUN: opt < %s -passes=debugify,lcssa -S --try-experimental-debuginfo-iterators | FileCheck -check-prefix=DEBUGIFY %s

define void @lcssa(i1 %S2) {
; CHECK-LABEL: @lcssa
Expand Down
1 change: 1 addition & 0 deletions llvm/test/Transforms/LICM/sinking-debugify.ll
@@ -1,5 +1,6 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -passes='debugify,function(loop-mssa(licm))' -S | FileCheck %s
; RUN: opt < %s -passes='debugify,function(loop-mssa(licm))' -S --try-experimental-debuginfo-iterators | FileCheck %s

%Ty = type { i32, i32 }
@X2 = external global %Ty
Expand Down
@@ -1,6 +1,7 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -passes=debugify,loop-idiom -mtriple=x86_64 -mcpu=corei7 < %s -S | FileCheck --check-prefixes=CHECK,NOLZCNT %s
; RUN: opt -passes=debugify,loop-idiom -mtriple=x86_64 -mcpu=core-avx2 < %s -S | FileCheck --check-prefixes=CHECK,LZCNT %s
; RUN: opt -passes=debugify,loop-idiom -mtriple=x86_64 -mcpu=corei7 < %s -S --try-experimental-debuginfo-iterators | FileCheck --check-prefixes=CHECK,NOLZCNT %s

declare void @escape_inner(i8, i8, i8, i1, i8)
declare void @escape_outer(i8, i8, i8, i1, i8)
Expand Down
@@ -1,6 +1,7 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -passes=debugify,loop-idiom -mtriple=x86_64 -mcpu=core-avx2 < %s -S | FileCheck --check-prefixes=ALL,LZCNT %s
; RUN: opt -passes=debugify,loop-idiom -mtriple=x86_64 -mcpu=corei7 < %s -S | FileCheck --check-prefixes=ALL,NOLZCNT %s
; RUN: opt -passes=debugify,loop-idiom -mtriple=x86_64 -mcpu=core-avx2 < %s -S --try-experimental-debuginfo-iterators | FileCheck --check-prefixes=ALL,LZCNT %s

declare i32 @gen32()
declare void @use32(i32)
Expand Down
@@ -1,6 +1,7 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -passes=debugify,loop-idiom -mtriple=x86_64 -mcpu=corei7 < %s -S | FileCheck %s --check-prefixes=NOLZCNT
; RUN: opt -passes=debugify,loop-idiom -mtriple=x86_64 -mcpu=core-avx2 < %s -S | FileCheck %s --check-prefixes=LZCNT
; RUN: opt -passes=debugify,loop-idiom -mtriple=x86_64 -mcpu=corei7 < %s -S --try-experimental-debuginfo-iterators | FileCheck %s --check-prefixes=NOLZCNT

declare void @escape_inner(i8, i8, i8, i1, i8)
declare void @escape_outer(i8, i8, i8, i1, i8)
Expand Down
3 changes: 3 additions & 0 deletions llvm/test/Transforms/LoopIdiom/memcpy-debugify-remarks.ll
Expand Up @@ -2,6 +2,9 @@
; RUN: opt -passes=debugify,loop-idiom,verify -pass-remarks=loop-idiom -pass-remarks-analysis=loop-idiom -pass-remarks-output=%t.yaml -verify-each -verify-dom-info -verify-loop-info < %s -S 2>&1 | FileCheck %s
; RUN: FileCheck --input-file=%t.yaml %s --check-prefixes=YAML

; RUN: opt -passes=debugify,loop-idiom,verify -pass-remarks=loop-idiom -pass-remarks-analysis=loop-idiom -pass-remarks-output=%t.yaml -verify-each -verify-dom-info -verify-loop-info < %s -S 2>&1 --try-experimental-debuginfo-iterators | FileCheck %s
; RUN: FileCheck --input-file=%t.yaml %s --check-prefixes=YAML

target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

Expand Down
3 changes: 3 additions & 0 deletions llvm/test/Transforms/LoopIdiom/memset-debugify-remarks.ll
Expand Up @@ -2,6 +2,9 @@
; RUN: opt -passes=debugify,loop-idiom,verify -pass-remarks=loop-idiom -pass-remarks-analysis=loop-idiom -pass-remarks-output=%t.yaml -verify-each -verify-dom-info -verify-loop-info < %s -S 2>&1 | FileCheck %s
; RUN: FileCheck --input-file=%t.yaml %s --check-prefixes=YAML

; RUN: opt -passes=debugify,loop-idiom,verify -pass-remarks=loop-idiom -pass-remarks-analysis=loop-idiom -pass-remarks-output=%t.yaml -verify-each -verify-dom-info -verify-loop-info < %s -S 2>&1 --try-experimental-debuginfo-iterators | FileCheck %s
; RUN: FileCheck --input-file=%t.yaml %s --check-prefixes=YAML

target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

Expand Down
2 changes: 2 additions & 0 deletions llvm/test/Transforms/LoopUnroll/X86/call-remark.ll
Expand Up @@ -2,6 +2,8 @@
; RUN: opt -passes=debugify,loop-unroll -mcpu=znver3 -pass-remarks=TTI -pass-remarks-analysis=TTI < %s -S 2>&1 | FileCheck --check-prefixes=ALL,TTI %s
; RUN: opt -passes=debugify,loop-unroll -mcpu=znver4 -pass-remarks=loop-unroll -pass-remarks-analysis=loop-unroll < %s -S 2>&1 | FileCheck --check-prefixes=ALL,UNROLL %s

; RUN: opt -passes=debugify,loop-unroll -mcpu=znver3 -pass-remarks=loop-unroll -pass-remarks-analysis=loop-unroll < %s -S 2>&1 --try-experimental-debuginfo-iterators | FileCheck --check-prefixes=ALL,UNROLL %s

target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

Expand Down
1 change: 1 addition & 0 deletions llvm/test/Transforms/LoopVectorize/i8-induction.ll
@@ -1,5 +1,6 @@
; RUN: opt < %s -passes=loop-vectorize,dce,instcombine -force-vector-interleave=1 -force-vector-width=4 -S
; RUN: opt < %s -passes=debugify,loop-vectorize -S | FileCheck %s --check-prefix=DEBUGLOC
; RUN: opt < %s -passes=debugify,loop-vectorize -S --try-experimental-debuginfo-iterators | FileCheck %s --check-prefix=DEBUGLOC

target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"

Expand Down
@@ -1,5 +1,6 @@
; RUN: opt < %s -passes=loop-vectorize -S 2>&1 | FileCheck %s
; RUN: opt < %s -passes=debugify,loop-vectorize -S | FileCheck %s -check-prefix DEBUGLOC
; RUN: opt < %s -passes=debugify,loop-vectorize -S --try-experimental-debuginfo-iterators | FileCheck %s -check-prefix DEBUGLOC
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"

; This test makes sure we don't duplicate the loop vectorizer's metadata
Expand Down
1 change: 1 addition & 0 deletions llvm/test/Transforms/Mem2Reg/PromoteMemToRegister.ll
@@ -1,5 +1,6 @@
; Simple basic correctness check testcase. Both alloca's should be eliminated.
; RUN: opt < %s -passes='debugify,mem2reg,check-debugify' -S 2>&1 | FileCheck %s
; RUN: opt < %s -passes='debugify,mem2reg,check-debugify' -S 2>&1 --try-experimental-debuginfo-iterators | FileCheck %s

; CHECK-NOT: alloca
; CHECK: CheckModuleDebugify: PASS
Expand Down
1 change: 1 addition & 0 deletions llvm/test/Transforms/MemCpyOpt/pr37967.ll
@@ -1,5 +1,6 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -passes='debugify,memcpyopt,check-debugify' -S < %s 2>&1 -verify-memoryssa | FileCheck %s
; RUN: opt -passes='debugify,memcpyopt,check-debugify' -S < %s 2>&1 -verify-memoryssa --try-experimental-debuginfo-iterators | FileCheck %s

; CHECK: CheckModuleDebugify: PASS

Expand Down
@@ -1,4 +1,5 @@
; RUN: opt < %s -S -passes=debugify,mldst-motion -o - | FileCheck %s
; RUN: opt < %s -S -passes=debugify,mldst-motion -o - --try-experimental-debuginfo-iterators | FileCheck %s

%struct.S = type { i32 }

Expand Down
1 change: 1 addition & 0 deletions llvm/test/Transforms/SCCP/ipsccp-basic.ll
@@ -1,6 +1,7 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2
; RUN: opt < %s -passes=ipsccp -S | FileCheck %s
; RUN: opt < %s -enable-debugify -passes=ipsccp -debugify-quiet -disable-output
; RUN: opt < %s -enable-debugify -passes=ipsccp -debugify-quiet -disable-output --try-experimental-debuginfo-iterators

;;======================== test1

Expand Down
2 changes: 2 additions & 0 deletions llvm/test/Transforms/SCCP/loadtest.ll
Expand Up @@ -4,6 +4,8 @@
; RUN: opt < %s -data-layout="E-p:32:32" -passes=debugify,sccp -S | FileCheck %s
; RUN: opt < %s -data-layout="E-p:32:32" -passes=debugify,ipsccp -S | FileCheck %s

; RUN: opt < %s -data-layout="E-p:32:32" -passes=debugify,ipsccp -S --try-experimental-debuginfo-iterators | FileCheck %s

@X = constant i32 42 ; <ptr> [#uses=1]
@Y = constant [2 x { i32, float }] [ { i32, float } { i32 12, float 1.000000e+00 }, { i32, float } { i32 37, float 0x3FF3B2FEC0000000 } ] ; <ptr> [#uses=2]

Expand Down
1 change: 1 addition & 0 deletions llvm/test/Transforms/SROA/alignment.ll
Expand Up @@ -2,6 +2,7 @@
; RUN: opt < %s -passes='sroa<preserve-cfg>' -S | FileCheck %s --check-prefixes=CHECK,CHECK-PRESERVE-CFG
; RUN: opt < %s -passes='sroa<modify-cfg>' -S | FileCheck %s --check-prefixes=CHECK,CHECK-MODIFY-CFG
; RUN: opt -passes='debugify,function(sroa<preserve-cfg>)' -S < %s | FileCheck %s -check-prefix CHECK-DEBUGLOC
; RUN: opt -passes='debugify,function(sroa<preserve-cfg>)' -S < %s --try-experimental-debuginfo-iterators | FileCheck %s -check-prefix CHECK-DEBUGLOC

target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-n8:16:32:64"

Expand Down
@@ -1,6 +1,7 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-attributes --check-globals
; RUN: opt < %s -passes=debugify,simplifycfg -simplifycfg-require-and-preserve-domtree=1 -sink-common-insts -S | FileCheck %s
; RUN: opt < %s -passes='debugify,simplifycfg<sink-common-insts>' -S | FileCheck %s
; RUN: opt < %s -passes='debugify,simplifycfg<sink-common-insts>' -S --try-experimental-debuginfo-iterators | FileCheck %s

target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
Expand Down
1 change: 1 addition & 0 deletions llvm/test/Transforms/SimplifyCFG/debug-info-thread-phi.ll
@@ -1,4 +1,5 @@
; RUN: opt %s -passes=debugify,simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s
; RUN: opt %s -passes=debugify,simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S --try-experimental-debuginfo-iterators | FileCheck %s
; Tests Bug 37966

define void @bar(i32 %aa) {
Expand Down
1 change: 1 addition & 0 deletions llvm/test/Transforms/TailCallElim/debugloc.ll
@@ -1,4 +1,5 @@
; RUN: opt < %s -passes=debugify,tailcallelim -S | FileCheck %s
; RUN: opt < %s -passes=debugify,tailcallelim -S --try-experimental-debuginfo-iterators | FileCheck %s

define void @foo() {
entry:
Expand Down
2 changes: 2 additions & 0 deletions llvm/test/Transforms/Util/Debugify/loc-only.ll
@@ -1,6 +1,8 @@
; RUN: opt -passes=debugify -S < %s | FileCheck --check-prefixes=ALL,VALUE %s
; RUN: opt -passes=debugify -debugify-level=locations -S < %s | FileCheck --check-prefixes=ALL --implicit-check-not=dbg.value %s

; RUN: opt -passes=debugify -S < %s --try-experimental-debuginfo-iterators | FileCheck --check-prefixes=ALL,VALUE %s

; ALL-LABEL: @test
define void @test() {
%add = add i32 1, 2
Expand Down

0 comments on commit d2d9dc8

Please sign in to comment.