-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[DebugInfo][DWARF] Set is_stmt on first non-line-0 instruction in BB #105524
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+53
−14
Merged
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
cf8ef90
[DebugInfo][DWARF] Set is_stmt on first non-line-0 instruction in BB
SLTozer 32ee269
Update existing tests with newly generated is_stmt flags
SLTozer bb4f00f
Update to not merge identical DLs across BB boundaries
SLTozer 949ac83
Update other tests for new line output
SLTozer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| ;; Checks that when an instruction at the start of a BasicBlock has the same | ||
| ;; DebugLoc as the instruction at the end of the previous BasicBlock, we add | ||
| ;; is_stmt to the new line, to ensure that we still step on it if we arrive from | ||
| ;; a BasicBlock other than the immediately preceding one. | ||
|
|
||
| ; RUN: %llc_dwarf -O0 -filetype=obj < %s | llvm-dwarfdump --debug-line - | FileCheck %s | ||
|
|
||
| ; CHECK: {{0x[0-9a-f]+}} 13 5 {{.+}} is_stmt | ||
| ; CHECK-NEXT: {{0x[0-9a-f]+}} 13 25 {{.+}} is_stmt | ||
|
|
||
| define void @_Z1fi(i1 %cond) !dbg !21 { | ||
| entry: | ||
| br i1 %cond, label %if.then2, label %if.else4 | ||
|
|
||
| if.then2: ; preds = %entry | ||
| br label %if.end8, !dbg !24 | ||
|
|
||
| if.else4: ; preds = %entry | ||
| %0 = load i32, ptr null, align 4, !dbg !28 | ||
| %call5 = call i1 null(i32 %0) | ||
| ret void | ||
|
|
||
| if.end8: ; preds = %if.then2 | ||
| ret void | ||
| } | ||
|
|
||
| !llvm.dbg.cu = !{!0} | ||
| !llvm.module.flags = !{!20} | ||
|
|
||
| !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1, producer: "clang version 20.0.0", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, splitDebugInlining: false, nameTableKind: None) | ||
| !1 = !DIFile(filename: "test.cpp", directory: "/home/gbtozers/dev/upstream-llvm") | ||
| !20 = !{i32 2, !"Debug Info Version", i32 3} | ||
| !21 = distinct !DISubprogram(name: "f", linkageName: "_Z1fi", scope: !1, file: !1, line: 7, type: !22, scopeLine: 7, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0) | ||
| !22 = distinct !DISubroutineType(types: !23) | ||
| !23 = !{null} | ||
| !24 = !DILocation(line: 13, column: 5, scope: !25) | ||
| !25 = distinct !DILexicalBlock(scope: !21, file: !1, line: 11, column: 27) | ||
| !28 = !DILocation(line: 13, column: 25, scope: !25) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ISTM the first check is for block if.then2, the second is for if.else4? Should there also be one for if.end8?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not for this test specifically, as only these two instructions have non-0 line numbers (excluding 0x0, which has the function header).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh right,
!dbgisn't inherited the way it is for asm.But, you could use the same
!dbgfor both, showing that it really is the BB that triggers it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, trying to make this work has revealed another an issue - when the lines are actually identical, they will be merged into a single entry (whether this patch is in effect or not), which any jump to the branch would land in the middle of. I'm not sure whether that would result in a step in the debugger or not; it prevents the test from working, at the very least.