-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[CodeExtractor] Improve debug info for input values. #136016
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
Merged
Changes from 7 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
4adba9b
[CodeExtractor] Improve debug info for input values.
abidh f209196
Removed use of undef from the test.
abidh f08fe28
Fix formatting issues.
abidh 1a28e55
Update llvm/lib/Transforms/Utils/CodeExtractor.cpp
abidh f0ad59a
Update llvm/lib/Transforms/Utils/CodeExtractor.cpp
abidh 4180e9f
Address review comments.
abidh 73c78cb
Fix formatting issues.
abidh 393108c
Handle review comments.
abidh 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
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,54 @@ | ||
| ; RUN: opt -passes=hotcoldsplit -hotcoldsplit-threshold=0 -S < %s | FileCheck %s | ||
|
|
||
| target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" | ||
| target triple = "x86_64-unknown-linux-gnu" | ||
|
|
||
| define void @foo(i32 %a, i32 %b) !dbg !2 { | ||
| entry: | ||
| %1 = alloca i32, i64 1, align 4 | ||
| %2 = alloca i32, i64 1, align 4 | ||
| store i32 %a, ptr %1, align 4 | ||
| #dbg_declare(ptr %1, !8, !DIExpression(), !1) | ||
| #dbg_value(i32 %b, !9, !DIExpression(), !1) | ||
| %tobool = icmp eq i32 %a, 0 | ||
| br i1 %tobool, label %if.then, label %if.end | ||
| if.then: ; preds = %entry | ||
| ret void | ||
|
|
||
| if.end: ; preds = %entry | ||
| store i32 10, ptr %1, align 4 | ||
| %3 = add i32 %b, 1 | ||
| store i32 1, ptr %2, align 4 | ||
| call void @sink(i32 %3) | ||
| #dbg_declare(ptr %2, !10, !DIExpression(), !1) | ||
| ret void | ||
| } | ||
|
|
||
| declare void @sink(i32) cold | ||
|
|
||
| !llvm.dbg.cu = !{!6} | ||
| !llvm.module.flags = !{!0} | ||
| !0 = !{i32 2, !"Debug Info Version", i32 3} | ||
| !1 = !DILocation(line: 11, column: 7, scope: !2) | ||
| !2 = distinct !DISubprogram(name: "foo", scope: !3, file: !3, type: !4, spFlags: DISPFlagDefinition, unit: !6) | ||
| !3 = !DIFile(filename: "test.c", directory: "") | ||
| !4 = !DISubroutineType(cc: DW_CC_program, types: !5) | ||
| !5 = !{} | ||
| !6 = distinct !DICompileUnit(language: DW_LANG_C, file: !3) | ||
| !7 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) | ||
| !8 = !DILocalVariable(name: "a", scope: !2, file: !3, type: !7) | ||
| !9 = !DILocalVariable(name: "b", scope: !2, file: !3, type: !7) | ||
| !10 = !DILocalVariable(name: "c", scope: !2, file: !3, type: !7) | ||
|
|
||
| ; CHECK: define {{.*}}@foo.cold.1(ptr %[[ARG0:.*]], i32 %[[ARG1:.*]], ptr %[[ARG2:.*]]){{.*}} !dbg ![[FN:.*]] { | ||
| ; CHECK-NEXT: newFuncRoot: | ||
| ; CHECK-NEXT: #dbg_declare(ptr %[[ARG0]], ![[V1:[0-9]+]], {{.*}}) | ||
| ; CHECK-NEXT: #dbg_value(i32 %[[ARG1]], ![[V2:[0-9]+]], {{.*}}) | ||
| ; CHECK-NEXT: br | ||
| ; CHECK: if.end: | ||
| ; CHECK: #dbg_declare(ptr %[[ARG2]], ![[V3:[0-9]+]], {{.*}}) | ||
| ; CHECK: } | ||
|
|
||
| ; CHECK: ![[V1]] = !DILocalVariable(name: "a", scope: ![[FN]]{{.*}}) | ||
| ; CHECK: ![[V2]] = !DILocalVariable(name: "b", scope: ![[FN]]{{.*}}) | ||
| ; CHECK: ![[V3]] = !DILocalVariable(name: "c", scope: ![[FN]]{{.*}}) |
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
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.
Uh oh!
There was an error while loading. Please reload this page.