Skip to content

Commit 4ece507

Browse files
committed
[Assignment Tracking][NFC] Replace LLVM command line option with a module flag
Remove LLVM flag -experimental-assignment-tracking. Assignment tracking is still enabled from Clang with the command line -Xclang -fexperimental-assignment-tracking which tells Clang to ask LLVM to run the pass declare-to-assign. That pass converts conventional debug intrinsics to assignment tracking metadata. With this patch it now also sets a module flag debug-info-assignment-tracking with the value `i1 true` (using the flag conflict rule `Max` since enabling assignment tracking on IR that contains only conventional debug intrinsics should cause no issues). Update the docs and tests too. Reviewed By: CarlosAlbertoEnciso Differential Revision: https://reviews.llvm.org/D142027
1 parent d49b842 commit 4ece507

File tree

86 files changed

+264
-194
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+264
-194
lines changed

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6971,11 +6971,6 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
69716971
if (StringRef(Arg->getValue()) == "-finclude-default-header")
69726972
continue;
69736973
}
6974-
if (StringRef(Arg->getValue()) == "-fexperimental-assignment-tracking") {
6975-
// Add the llvm version of this flag too.
6976-
CmdArgs.push_back("-mllvm");
6977-
CmdArgs.push_back("-experimental-assignment-tracking");
6978-
}
69796974
CmdArgs.push_back(Arg->getValue());
69806975
}
69816976
for (const Arg *A : Args.filtered(options::OPT_mllvm)) {

clang/test/Driver/assignment-tracking-opts.c

Lines changed: 0 additions & 10 deletions
This file was deleted.

llvm/docs/AssignmentTracking.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@ except for development and testing.
2525

2626
**Enable in Clang**: `-Xclang -fexperimental-assignment-tracking`
2727

28-
**Enable in LLVM tools**: `-experimental-assignment-tracking`
28+
That causes Clang to get LLVM to run the pass `declare-to-assign`. The pass
29+
converts conventional debug intrinsics to assignment tracking metadata and sets
30+
the module flag `debug-info-assignment-tracking` to the value `i1 true`. To
31+
check whether assignment tracking is enabled for a module call
32+
`isAssignmentTrackingEnabled(const Module &M)` (from `llvm/IR/DebugInfo.h`).
2933

3034
## Design and implementation
3135

llvm/include/llvm/IR/DebugInfo.h

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -291,15 +291,20 @@ std::optional<AssignmentInfo> getAssignmentInfo(const DataLayout &DL,
291291
/// intrinsics by treating stores to the dbg.declare'd address as assignments
292292
/// to the variable. Not all kinds of variables are supported yet; those will
293293
/// be left with their dbg.declare intrinsics.
294+
/// The pass sets the debug-info-assignment-tracking module flag to true to
295+
/// indicate assignment tracking has been enabled.
294296
class AssignmentTrackingPass : public PassInfoMixin<AssignmentTrackingPass> {
295-
public:
297+
/// Note: this method does not set the debug-info-assignment-tracking module
298+
/// flag.
296299
void runOnFunction(Function &F);
300+
301+
public:
297302
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
298303
PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
299304
};
300305

301-
/// Return true if assignment tracking is enabled.
302-
bool getEnableAssignmentTracking();
306+
/// Return true if assignment tracking is enabled for module \p M.
307+
bool isAssignmentTrackingEnabled(const Module &M);
303308
} // end namespace llvm
304309

305310
#endif // LLVM_IR_DEBUGINFO_H

llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2389,6 +2389,9 @@ static void analyzeFunction(Function &Fn, const DataLayout &Layout,
23892389
}
23902390

23912391
bool AssignmentTrackingAnalysis::runOnFunction(Function &F) {
2392+
if (!isAssignmentTrackingEnabled(*F.getParent()))
2393+
return false;
2394+
23922395
LLVM_DEBUG(dbgs() << "AssignmentTrackingAnalysis run on " << F.getName()
23932396
<< "\n");
23942397
auto DL = std::make_unique<DataLayout>(F.getParent());

llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6090,7 +6090,7 @@ void SelectionDAGBuilder::visitIntrinsicCall(const CallInst &I,
60906090
case Intrinsic::dbg_addr:
60916091
case Intrinsic::dbg_declare: {
60926092
// Debug intrinsics are handled seperately in assignment tracking mode.
6093-
if (getEnableAssignmentTracking())
6093+
if (isAssignmentTrackingEnabled(*I.getFunction()->getParent()))
60946094
return;
60956095
// Assume dbg.addr and dbg.declare can not currently use DIArgList, i.e.
60966096
// they are non-variadic.
@@ -6193,13 +6193,13 @@ void SelectionDAGBuilder::visitIntrinsicCall(const CallInst &I,
61936193
}
61946194
case Intrinsic::dbg_assign: {
61956195
// Debug intrinsics are handled seperately in assignment tracking mode.
6196-
assert(getEnableAssignmentTracking() &&
6196+
assert(isAssignmentTrackingEnabled(*I.getFunction()->getParent()) &&
61976197
"expected assignment tracking to be enabled");
61986198
return;
61996199
}
62006200
case Intrinsic::dbg_value: {
62016201
// Debug intrinsics are handled seperately in assignment tracking mode.
6202-
if (getEnableAssignmentTracking())
6202+
if (isAssignmentTrackingEnabled(*I.getFunction()->getParent()))
62036203
return;
62046204
const DbgValueInst &DI = cast<DbgValueInst>(I);
62056205
assert(DI.getVariable() && "Missing variable");

llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -345,10 +345,10 @@ void SelectionDAGISel::getAnalysisUsage(AnalysisUsage &AU) const {
345345
if (UseMBPI && OptLevel != CodeGenOpt::None)
346346
AU.addRequired<BranchProbabilityInfoWrapperPass>();
347347
AU.addRequired<ProfileSummaryInfoWrapperPass>();
348-
if (getEnableAssignmentTracking()) {
349-
AU.addRequired<AssignmentTrackingAnalysis>();
350-
AU.addPreserved<AssignmentTrackingAnalysis>();
351-
}
348+
// AssignmentTrackingAnalysis only runs if assignment tracking is enabled for
349+
// the module.
350+
AU.addRequired<AssignmentTrackingAnalysis>();
351+
AU.addPreserved<AssignmentTrackingAnalysis>();
352352
if (OptLevel != CodeGenOpt::None)
353353
LazyBlockFrequencyInfoPass::getLazyBFIAnalysisUsage(AU);
354354
MachineFunctionPass::getAnalysisUsage(AU);
@@ -420,7 +420,7 @@ bool SelectionDAGISel::runOnMachineFunction(MachineFunction &mf) {
420420
BFI = &getAnalysis<LazyBlockFrequencyInfoPass>().getBFI();
421421

422422
FunctionVarLocs const *FnVarLocs = nullptr;
423-
if (getEnableAssignmentTracking())
423+
if (isAssignmentTrackingEnabled(*Fn.getParent()))
424424
FnVarLocs = getAnalysis<AssignmentTrackingAnalysis>().getResults();
425425

426426
LLVM_DEBUG(dbgs() << "\n\n\n=== " << Fn.getName() << "\n");
@@ -1435,7 +1435,7 @@ void SelectionDAGISel::SelectAllBasicBlocks(const Function &Fn) {
14351435
if (FastIS && Inserted)
14361436
FastIS->setLastLocalValue(&*std::prev(FuncInfo->InsertPt));
14371437

1438-
if (getEnableAssignmentTracking()) {
1438+
if (isAssignmentTrackingEnabled(*Fn.getParent())) {
14391439
assert(CurDAG->getFunctionVarLocs() &&
14401440
"expected AssignmentTrackingAnalysis pass results");
14411441
processSingleLocVars(*FuncInfo, CurDAG->getFunctionVarLocs());

llvm/lib/IR/DebugInfo.cpp

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,6 @@ using namespace llvm;
4343
using namespace llvm::at;
4444
using namespace llvm::dwarf;
4545

46-
static cl::opt<bool>
47-
ExperimentalAssignmentTracking("experimental-assignment-tracking",
48-
cl::init(false));
49-
bool llvm::getEnableAssignmentTracking() {
50-
return ExperimentalAssignmentTracking;
51-
}
52-
5346
/// Finds all intrinsics declaring local variables as living in the memory that
5447
/// 'V' points to. This may include a mix of dbg.declare and
5548
/// dbg.addr intrinsics.
@@ -1959,9 +1952,33 @@ void AssignmentTrackingPass::runOnFunction(Function &F) {
19591952
}
19601953
}
19611954

1955+
static const char *AssignmentTrackingModuleFlag =
1956+
"debug-info-assignment-tracking";
1957+
1958+
static void setAssignmentTrackingModuleFlag(Module &M) {
1959+
M.setModuleFlag(Module::ModFlagBehavior::Max, AssignmentTrackingModuleFlag,
1960+
ConstantAsMetadata::get(
1961+
ConstantInt::get(Type::getInt1Ty(M.getContext()), 1)));
1962+
}
1963+
1964+
static bool getAssignmentTrackingModuleFlag(const Module &M) {
1965+
Metadata *Value = M.getModuleFlag(AssignmentTrackingModuleFlag);
1966+
return Value && !cast<ConstantAsMetadata>(Value)->getValue()->isZeroValue();
1967+
}
1968+
1969+
bool llvm::isAssignmentTrackingEnabled(const Module &M) {
1970+
return getAssignmentTrackingModuleFlag(M);
1971+
}
1972+
19621973
PreservedAnalyses AssignmentTrackingPass::run(Function &F,
19631974
FunctionAnalysisManager &AM) {
19641975
runOnFunction(F);
1976+
1977+
// Record that this module uses assignment tracking. It doesn't matter that
1978+
// some functons in the module may not use it - the debug info in those
1979+
// functions will still be handled properly.
1980+
setAssignmentTrackingModuleFlag(*F.getParent());
1981+
19651982
// Q: Can we return a less conservative set than just CFGAnalyses? Can we
19661983
// return PreservedAnalyses::all()?
19671984
PreservedAnalyses PA;
@@ -1973,6 +1990,10 @@ PreservedAnalyses AssignmentTrackingPass::run(Module &M,
19731990
ModuleAnalysisManager &AM) {
19741991
for (auto &F : M)
19751992
runOnFunction(F);
1993+
1994+
// Record that this module uses assignment tracking.
1995+
setAssignmentTrackingModuleFlag(M);
1996+
19761997
// Q: Can we return a less conservative set than just CFGAnalyses? Can we
19771998
// return PreservedAnalyses::all()?
19781999
PreservedAnalyses PA;

llvm/lib/Transforms/InstCombine/InstructionCombining.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4604,7 +4604,7 @@ static bool combineInstructionsOverFunction(
46044604
// LowerDbgDeclare calls RemoveRedundantDbgInstrs, but LowerDbgDeclare will
46054605
// almost never return true when running an assignment tracking build. Take
46064606
// this opportunity to do some clean up for assignment tracking builds too.
4607-
if (!MadeIRChange && getEnableAssignmentTracking()) {
4607+
if (!MadeIRChange && isAssignmentTrackingEnabled(*F.getParent())) {
46084608
for (auto &BB : F)
46094609
RemoveRedundantDbgInstrs(&BB);
46104610
}

llvm/lib/Transforms/Utils/BasicBlockUtils.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,8 @@ bool llvm::RemoveRedundantDbgInstrs(BasicBlock *BB) {
531531
// getting (2) out of the way, the foward scan will remove (3) since "x"
532532
// already is described as having the value V1 at (1).
533533
MadeChanges |= removeRedundantDbgInstrsUsingBackwardScan(BB);
534-
if (BB->isEntryBlock() && getEnableAssignmentTracking())
534+
if (BB->isEntryBlock() &&
535+
isAssignmentTrackingEnabled(*BB->getParent()->getParent()))
535536
MadeChanges |= remomveUndefDbgAssignsFromEntryBlock(BB);
536537
MadeChanges |= removeRedundantDbgInstrsUsingForwardScan(BB);
537538

llvm/lib/Transforms/Utils/InlineFunction.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2302,7 +2302,7 @@ llvm::InlineResult llvm::InlineFunction(CallBase &CB, InlineFunctionInfo &IFI,
23022302
fixupLineNumbers(Caller, FirstNewBlock, &CB,
23032303
CalledFunc->getSubprogram() != nullptr);
23042304

2305-
if (getEnableAssignmentTracking()) {
2305+
if (isAssignmentTrackingEnabled(*Caller->getParent())) {
23062306
// Interpret inlined stores to caller-local variables as assignments.
23072307
trackInlinedStores(FirstNewBlock, Caller->end(), CB);
23082308

llvm/test/DebugInfo/Generic/assignment-tracking/adce/no-delete.ll

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; RUN: opt %s -passes=adce -experimental-assignment-tracking -S -o - \
1+
; RUN: opt %s -passes=adce -S -o - \
22
; RUN: | FileCheck %s
33

44
;; $ cat test.c
@@ -26,7 +26,7 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata)
2626
declare void @llvm.dbg.assign(metadata, metadata, metadata, metadata, metadata, metadata)
2727

2828
!llvm.dbg.cu = !{!0}
29-
!llvm.module.flags = !{!2, !3, !4, !5}
29+
!llvm.module.flags = !{!2, !3, !4, !5, !1000}
3030
!llvm.ident = !{!6}
3131

3232
!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 14.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, splitDebugInlining: false, nameTableKind: None)
@@ -46,3 +46,4 @@ declare void @llvm.dbg.assign(metadata, metadata, metadata, metadata, metadata,
4646
!14 = !DILocation(line: 0, scope: !7)
4747
!19 = distinct !DIAssignID()
4848
!20 = !DILocation(line: 1, column: 22, scope: !7)
49+
!1000 = !{i32 7, !"debug-info-assignment-tracking", i1 true}

llvm/test/DebugInfo/Generic/assignment-tracking/codegenprepare/sunk-addr.ll

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; REQUIRES: x86-registered-target
22
; RUN: llc -start-before=codegenprepare -stop-after=codegenprepare \
3-
; RUN: -mtriple=x86_64-unknown-unknown -experimental-assignment-tracking %s -o - \
3+
; RUN: -mtriple=x86_64-unknown-unknown %s -o - \
44
; RUN: | FileCheck %s --implicit-check-not="call void @llvm.dbg."
55

66
;; Check that when CodeGenPrepare moves an address computation to a block it's
@@ -39,7 +39,7 @@ ret:
3939
declare void @llvm.dbg.assign(metadata, metadata, metadata, metadata, metadata, metadata)
4040

4141
!llvm.dbg.cu = !{!0}
42-
!llvm.module.flags = !{!3, !4, !5}
42+
!llvm.module.flags = !{!3, !4, !5, !1000}
4343
!llvm.ident = !{!6}
4444

4545
!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, nameTableKind: None)
@@ -58,3 +58,4 @@ declare void @llvm.dbg.assign(metadata, metadata, metadata, metadata, metadata,
5858
!14 = !DILocation(line: 4, column: 15, scope: !7)
5959
!20 = distinct !DILexicalBlock(scope: !7, file: !1, line: 8, column: 7)
6060
!21 = distinct !DIAssignID()
61+
!1000 = !{i32 7, !"debug-info-assignment-tracking", i1 true}

llvm/test/DebugInfo/Generic/assignment-tracking/dse/dse-after-memcpyopt-merge.ll

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; RUN: opt %s -S -passes=dse -o - -experimental-assignment-tracking | FileCheck %s
1+
; RUN: opt %s -S -passes=dse -o - | FileCheck %s
22

33
;; Observed in the wild, but test is created by running memcpyopt on
44
;; assignment-tracking/memcpyopt/merge-stores.ll then manually inserting
@@ -67,7 +67,7 @@ declare void @llvm.dbg.assign(metadata, metadata, metadata, metadata, metadata,
6767
declare void @llvm.memset.p0i8.i64(ptr nocapture writeonly, i8, i64, i1 immarg)
6868

6969
!llvm.dbg.cu = !{!0}
70-
!llvm.module.flags = !{!3, !4, !5}
70+
!llvm.module.flags = !{!3, !4, !5, !1000}
7171
!llvm.ident = !{!6}
7272

7373
!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 12.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, splitDebugInlining: false, nameTableKind: None)
@@ -133,3 +133,4 @@ declare void @llvm.memset.p0i8.i64(ptr nocapture writeonly, i8, i64, i1 immarg)
133133
!64 = !DISubprogram(name: "esc", linkageName: "_Z3escP1v", scope: !1, file: !1, line: 10, type: !65, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized, retainedNodes: !2)
134134
!65 = !DISubroutineType(types: !66)
135135
!66 = !{null, !30}
136+
!1000 = !{i32 7, !"debug-info-assignment-tracking", i1 true}

llvm/test/DebugInfo/Generic/assignment-tracking/dse/shorten.ll

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; RUN: opt %s -S -passes=dse -o - -experimental-assignment-tracking | FileCheck %s
1+
; RUN: opt %s -S -passes=dse -o - | FileCheck %s
22

33
;; $ cat test.cpp
44
;; void esc(int*);
@@ -77,7 +77,7 @@ entry:
7777
declare void @llvm.dbg.assign(metadata, metadata, metadata, metadata, metadata, metadata)
7878

7979
!llvm.dbg.cu = !{!0}
80-
!llvm.module.flags = !{!2, !3, !4, !5}
80+
!llvm.module.flags = !{!2, !3, !4, !5, !1000}
8181
!llvm.ident = !{!6}
8282

8383
!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1, producer: "clang version 14.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, splitDebugInlining: false, nameTableKind: None)
@@ -126,3 +126,4 @@ declare void @llvm.dbg.assign(metadata, metadata, metadata, metadata, metadata,
126126
!43 = distinct !DIAssignID()
127127
!44 = !DILocation(line: 12, column: 3, scope: !31)
128128
!45 = !DILocation(line: 13, column: 1, scope: !31)
129+
!1000 = !{i32 7, !"debug-info-assignment-tracking", i1 true}

llvm/test/DebugInfo/Generic/assignment-tracking/inline/id.ll

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; RUN: opt %s -S -passes=inline -o - -experimental-assignment-tracking \
1+
; RUN: opt %s -S -passes=inline -o - \
22
; RUN: | FileCheck %s
33

44
;; Check that all DIAssignID metadata that are inlined are replaced with new
@@ -55,7 +55,7 @@ entry:
5555
}
5656

5757
!llvm.dbg.cu = !{!0}
58-
!llvm.module.flags = !{!3, !4, !5}
58+
!llvm.module.flags = !{!3, !4, !5, !1000}
5959
!llvm.ident = !{!6}
6060

6161
!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1, producer: "clang version 12.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, splitDebugInlining: false, nameTableKind: None)
@@ -85,3 +85,4 @@ entry:
8585
!28 = !DILocation(line: 4, column: 3, scope: !25)
8686
!29 = !DILocation(line: 5, column: 3, scope: !25)
8787
!30 = !DILocation(line: 6, column: 1, scope: !25)
88+
!1000 = !{i32 7, !"debug-info-assignment-tracking", i1 true}

llvm/test/DebugInfo/Generic/assignment-tracking/inline/inline-stores.ll

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; RUN: opt -passes=inline %s -S -o - -experimental-assignment-tracking \
1+
; RUN: opt -passes=inline %s -S -o - \
22
; RUN: | FileCheck %s
33

44
;; $ cat test.cpp
@@ -230,7 +230,7 @@ declare void @llvm.dbg.assign(metadata, metadata, metadata, metadata, metadata,
230230
; CHECK-DAG: [[ID_6]] = distinct !DIAssignID()
231231

232232
!llvm.dbg.cu = !{!0}
233-
!llvm.module.flags = !{!3, !4, !5}
233+
!llvm.module.flags = !{!3, !4, !5, !1000}
234234
!llvm.ident = !{!6}
235235

236236
!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1, producer: "clang version 12.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, splitDebugInlining: false, nameTableKind: None)
@@ -338,3 +338,4 @@ declare void @llvm.dbg.assign(metadata, metadata, metadata, metadata, metadata,
338338
!106 = !DILocation(line: 39, column: 10, scope: !99)
339339
!107 = !DILocation(line: 40, column: 1, scope: !99)
340340
!108 = !DILocation(line: 39, column: 3, scope: !99)
341+
!1000 = !{i32 7, !"debug-info-assignment-tracking", i1 true}

llvm/test/DebugInfo/Generic/assignment-tracking/inline/use-before-def.ll

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; RUN: opt -passes=inline %s -S -o - -experimental-assignment-tracking \
1+
; RUN: opt -passes=inline %s -S -o - \
22
; RUN: | FileCheck %s
33

44
;; Hand modified from:
@@ -52,7 +52,7 @@ declare void @llvm.dbg.value(metadata, metadata, metadata) #2
5252

5353

5454
!llvm.dbg.cu = !{!2}
55-
!llvm.module.flags = !{!7, !8, !9}
55+
!llvm.module.flags = !{!7, !8, !9, !1000}
5656
!llvm.ident = !{!10}
5757

5858
!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
@@ -77,3 +77,4 @@ declare void @llvm.dbg.value(metadata, metadata, metadata) #2
7777
!19 = !DILocation(line: 3, column: 15, scope: !16)
7878
!24 = !DILocation(line: 0, scope: !16)
7979
!25 = !DILocation(line: 4, column: 3, scope: !16)
80+
!1000 = !{i32 7, !"debug-info-assignment-tracking", i1 true}

llvm/test/DebugInfo/Generic/assignment-tracking/instcombine/alloca-bitcast.ll

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; RUN: opt -opaque-pointers=0 -passes=instcombine -S %s -o - -experimental-assignment-tracking \
1+
; RUN: opt -opaque-pointers=0 -passes=instcombine -S %s -o - \
22
; RUN: | FileCheck %s
33

44
;; NOTE: This test uses typed pointers because it is testing a code path that
@@ -44,7 +44,7 @@ declare dso_local void @_ZN1cC1Ei(%struct.c*, i32) unnamed_addr
4444
declare void @llvm.dbg.assign(metadata, metadata, metadata, metadata, metadata, metadata)
4545

4646
!llvm.dbg.cu = !{!0}
47-
!llvm.module.flags = !{!3, !4, !5}
47+
!llvm.module.flags = !{!3, !4, !5, !1000}
4848
!llvm.ident = !{!6}
4949

5050
!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1, producer: "clang version 12.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, splitDebugInlining: false, nameTableKind: None)
@@ -72,3 +72,4 @@ declare void @llvm.dbg.assign(metadata, metadata, metadata, metadata, metadata,
7272
!22 = !DILocation(line: 0, scope: !7)
7373
!23 = !DILocation(line: 6, column: 5, scope: !7)
7474
!24 = !DILocation(line: 7, column: 3, scope: !7)
75+
!1000 = !{i32 7, !"debug-info-assignment-tracking", i1 true}

llvm/test/DebugInfo/Generic/assignment-tracking/instcombine/memset.ll

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; RUN: opt %s -S -passes=instcombine -o - -experimental-assignment-tracking \
1+
; RUN: opt %s -S -passes=instcombine -o - \
22
; RUN: | FileCheck %s
33

44
;; $ cat test.cpp
@@ -43,7 +43,7 @@ declare void @llvm.lifetime.end.p0i8(i64 immarg, ptr nocapture)
4343
declare void @llvm.dbg.assign(metadata, metadata, metadata, metadata, metadata, metadata)
4444

4545
!llvm.dbg.cu = !{!0}
46-
!llvm.module.flags = !{!2, !3, !4, !5}
46+
!llvm.module.flags = !{!2, !3, !4, !5, !1000}
4747
!llvm.ident = !{!6}
4848

4949
!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1, producer: "clang version 14.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, splitDebugInlining: false, nameTableKind: None)
@@ -76,3 +76,4 @@ declare void @llvm.dbg.assign(metadata, metadata, metadata, metadata, metadata,
7676
!27 = !{null, !28}
7777
!28 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !13, size: 64)
7878
!29 = !{}
79+
!1000 = !{i32 7, !"debug-info-assignment-tracking", i1 true}

0 commit comments

Comments
 (0)