-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[SimplifyCFG] Refine metadata handling during instruction hoisting #158448
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 5 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
27285df
Refine metadata handling during instruction hoisting
wsmoses a79af80
Refactor condition in SimplifyCFG.cpp
wsmoses f2e6584
fmt
wsmoses 499965e
add test
wsmoses f02a8fc
fix
wsmoses 0915691
Refactor debug location handling in SimplifyCFG
wsmoses 1dbcca7
Update llvm/test/Transforms/SimplifyCFG/no-drop-debug-loc-when-specul…
wsmoses b8c7fa0
Clean up comments in SimplifyCFG.cpp
wsmoses 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
44 changes: 44 additions & 0 deletions
44
llvm/test/Transforms/SimplifyCFG/no-drop-debug-loc-when-speculating-call.ll
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,44 @@ | ||
; RUN: opt -S -o - %s -passes=simplifycfg -simplifycfg-require-and-preserve-domtree=1 | FileCheck %s | ||
|
||
|
||
declare i1 @make_condition() | ||
|
||
define i1 @specfn() readnone nounwind speculatable { | ||
ret i1 true | ||
} | ||
|
||
; CHECK-LABEL: @test1( | ||
; CHECK: call i1 @specfn(), !dbg | ||
; CHECK: select i1 | ||
define void @test1() !dbg !6 { | ||
start: | ||
%cond = call i1 @make_condition(), !dbg !8 | ||
wsmoses marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
br i1 %cond, label %then, label %else, !dbg !9 | ||
|
||
then: ; preds = %start | ||
%sres = call i1 @specfn(), !dbg !8 | ||
br label %else, !dbg !11 | ||
|
||
else: ; preds = %then, %start | ||
%phi = phi i1 [ %cond, %start ], [ %sres, %then ], !dbg !12 | ||
ret void, !dbg !13 | ||
} | ||
|
||
!llvm.dbg.cu = !{!0} | ||
!llvm.debugify = !{!3, !4} | ||
!llvm.module.flags = !{!5} | ||
|
||
!0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "debugify", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2) | ||
!1 = !DIFile(filename: "test.ll", directory: "/") | ||
!2 = !{} | ||
!3 = !{i32 6} | ||
!4 = !{i32 0} | ||
!5 = !{i32 2, !"Debug Info Version", i32 3} | ||
!6 = distinct !DISubprogram(name: "test1", linkageName: "test1", scope: null, file: !1, line: 1, type: !7, scopeLine: 1, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !2) | ||
!7 = !DISubroutineType(types: !2) | ||
!8 = !DILocation(line: 1, column: 1, scope: !6) | ||
!9 = !DILocation(line: 2, column: 1, scope: !6) | ||
!10 = !DILocation(line: 3, column: 2, scope: !6) | ||
!11 = !DILocation(line: 4, column: 2, scope: !6) | ||
!12 = !DILocation(line: 5, column: 3, scope: !6) | ||
!13 = !DILocation(line: 6, column: 3, scope: !6) |
Oops, something went wrong.
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.