-
Notifications
You must be signed in to change notification settings - Fork 14.9k
[SimplifyCFG] Add loop metadata to the new branch when doing jump-threading #157180
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
Open
asastry108
wants to merge
14
commits into
llvm:main
Choose a base branch
from
asastry108:loopmetata_fix
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
cdb8e08
Add loop metadata to the new branch when doing jump-threading
asastry108 042d478
replaced loop header blocks with named labels, as per review suggestion
asastry108 4394b7d
used updte_test_checks.py, as per review feedback
asastry108 d995bb1
Merge branch 'main' into loopmetata_fix
asastry108 6e2e3ad
updated numbered labels with meaningful names
asastry108 50fb9cf
Merge branch 'main' into loopmetata_fix
asastry108 db1150b
Merge branch 'main' into loopmetata_fix
asastry108 60c5495
Merge branch 'main' into loopmetata_fix
asastry108 c7a766b
Merge branch 'main' into loopmetata_fix
asastry108 56f31a4
Merge branch 'main' into loopmetata_fix
asastry108 10a9151
Merge branch 'main' into loopmetata_fix
asastry108 e090d5e
Merge branch 'main' into loopmetata_fix
asastry108 2f56a5c
Merge branch 'main' into loopmetata_fix
asastry108 85a1901
Merge branch 'main' into loopmetata_fix
asastry108 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
47 changes: 47 additions & 0 deletions
47
llvm/test/Transforms/SimplifyCFG/preserve-llvm-loop-metadata-2.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,47 @@ | ||
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5 | ||
; RUN: opt -passes='simplifycfg' -S < %s | FileCheck %s | ||
|
||
|
||
define void @test(i32 %1 ) { | ||
; CHECK-LABEL: define void @test( | ||
; CHECK-SAME: i32 [[TMP0:%.*]]) { | ||
; CHECK-NEXT: [[_CRITEDGE:.*:]] | ||
; CHECK-NEXT: br label %[[LOOP1:.*]] | ||
; CHECK: [[LOOP1]]: | ||
; CHECK-NEXT: [[TMP1:%.*]] = icmp eq i32 [[TMP0]], 0 | ||
; CHECK-NEXT: br i1 [[TMP1]], label %[[LOOP2:.*]], label %[[BB3:.*]] | ||
; CHECK: [[LOOP2]]: | ||
; CHECK-NEXT: [[TMP2:%.*]] = phi i1 [ true, %[[LOOP1]] ], [ false, %[[LOOP2]] ] | ||
; CHECK-NEXT: br i1 [[TMP2]], label %[[LOOP2]], label %[[LOOP1]], !llvm.loop [[LOOP0:![0-9]+]] | ||
; CHECK: [[BB3]]: | ||
; CHECK-NEXT: ret void | ||
; | ||
entry: | ||
br label %loop1 | ||
|
||
loop1: ; preds = %loop2, %entry | ||
%111 = icmp eq i32 %1, 0 | ||
asastry108 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
br i1 %111, label %trampoline, label %retlabel | ||
|
||
trampoline: ; preds = %loop1 | ||
br label %loop2 | ||
|
||
loop2: ; preds = %loop2latch, %trampoline | ||
%148 = phi i1 [ false, %loop2latch ], [ true, %trampoline ] | ||
br i1 %148, label %loop2latch, label %loop1, !llvm.loop !32 | ||
|
||
loop2latch: ; preds = %loop2 | ||
br label %loop2 | ||
|
||
retlabel: ; preds = loop1 | ||
ret void | ||
} | ||
|
||
!32 = distinct !{!32, !33, !34} | ||
!33 = !{!"llvm.loop.unroll.enable"} | ||
!34 = !{!"llvm.loop.unroll.full"} | ||
;. | ||
; CHECK: [[LOOP0]] = distinct !{[[LOOP0]], [[META1:![0-9]+]], [[META2:![0-9]+]]} | ||
; CHECK: [[META1]] = !{!"llvm.loop.unroll.enable"} | ||
; CHECK: [[META2]] = !{!"llvm.loop.unroll.full"} | ||
;. |
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.