-
Notifications
You must be signed in to change notification settings - Fork 14.5k
[OptBisect][IR] Adding a new OptPassGate for disabling passes via name #145059
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
+237
−49
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
ab60634
Adding -opt-disable and a test for it
cristianassaiante aea7b99
Merge branch 'llvm:main' into opt-disable
cristianassaiante 5e79702
Partial solve of review comments
cristianassaiante 8862507
Fix vector usage
cristianassaiante 9f95327
Remove leftovers
cristianassaiante 56405f2
Converted to cl::list, renamed verbose flag, cleanup
cristianassaiante ed3dd9f
Merge branch 'main' into opt-disable
cristianassaiante 731bcdf
Fixes, new test using opt in llvm/test
cristianassaiante 12bb09c
Added test description
cristianassaiante 6cc429b
Removing leftovers, solving nits
cristianassaiante 825b711
Update llvm/lib/IR/OptBisect.cpp
cristianassaiante 284a13f
Short names with both NPM and Legacy, updated test, solved nits
cristianassaiante 39b85f1
Update failing opt-bisect test
cristianassaiante 3b766f2
Apply suggestions from code review
cristianassaiante 2cb80ea
Removing virtual, cleaning format
cristianassaiante 0f13dab
Format check fail leftover
cristianassaiante 9b696eb
Full case sensitivity, leftover this
cristianassaiante 8282416
Merge branch 'main' into opt-disable
cristianassaiante 098431a
Update llvm/include/llvm/Pass.h
cristianassaiante 3774261
Merge branch 'main' into opt-disable
cristianassaiante 08341fd
Format check fix
cristianassaiante 82ffe52
Update clang bisect test with new output format
cristianassaiante 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
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,91 @@ | ||
; This test uses the same IR functions of the opt-bisect test | ||
; but it checks the correctness of the -opt-disable flag. | ||
; -opt-disable-enable-verbosity is required to have output. | ||
|
||
; RUN: opt -disable-output -disable-verify \ | ||
; RUN: -opt-disable-enable-verbosity \ | ||
; RUN: -passes=inferattrs -opt-disable=inferattrs %s 2>&1 \ | ||
; RUN: | FileCheck %s --check-prefix=CHECK-MODULE-PASS | ||
; CHECK-MODULE-PASS: OptDisable: NOT running pass inferattrs on [module] | ||
|
||
; RUN: opt -disable-output -disable-verify \ | ||
; RUN: -opt-disable-enable-verbosity \ | ||
; RUN: -passes=sroa -opt-disable=sroa %s 2>&1 \ | ||
; RUN: | FileCheck %s --check-prefix=CHECK-FUNCTION-PASS | ||
; CHECK-FUNCTION-PASS: OptDisable: NOT running pass sroa on f1 | ||
; CHECK-FUNCTION-PASS: OptDisable: NOT running pass sroa on f2 | ||
; CHECK-FUNCTION-PASS: OptDisable: NOT running pass sroa on f3 | ||
; CHECK-FUNCTION-PASS: OptDisable: NOT running pass sroa on f4 | ||
|
||
; RUN: opt -disable-output -disable-verify \ | ||
; RUN: -opt-disable=inferattrs,function-attrs \ | ||
; RUN: -opt-disable-enable-verbosity \ | ||
; RUN: -passes='inferattrs,cgscc(function-attrs,function(early-cse))' %s 2>&1 \ | ||
; RUN: | FileCheck %s --check-prefix=CHECK-MULTI-PASS | ||
; CHECK-MULTI-PASS: OptDisable: NOT running pass inferattrs on [module] | ||
; CHECK-MULTI-PASS: OptDisable: NOT running pass function-attrs on (f1) | ||
; CHECK-MULTI-PASS: OptDisable: running pass early-cse on f1 | ||
; CHECK-MULTI-PASS: OptDisable: NOT running pass function-attrs on (f2) | ||
; CHECK-MULTI-PASS: OptDisable: running pass early-cse on f2 | ||
; CHECK-MULTI-PASS: OptDisable: NOT running pass function-attrs on (f3) | ||
; CHECK-MULTI-PASS: OptDisable: running pass early-cse on f3 | ||
; CHECK-MULTI-PASS: OptDisable: NOT running pass function-attrs on (f4) | ||
; CHECK-MULTI-PASS: OptDisable: running pass early-cse on f4 | ||
|
||
declare i32 @g() | ||
|
||
define void @f1(i1 %arg) { | ||
entry: | ||
br label %loop.0 | ||
loop.0: | ||
br i1 %arg, label %loop.0.0, label %loop.1 | ||
loop.0.0: | ||
br i1 %arg, label %loop.0.0, label %loop.0.1 | ||
loop.0.1: | ||
br i1 %arg, label %loop.0.1, label %loop.0 | ||
loop.1: | ||
br i1 %arg, label %loop.1, label %loop.1.bb1 | ||
loop.1.bb1: | ||
br i1 %arg, label %loop.1, label %loop.1.bb2 | ||
loop.1.bb2: | ||
br i1 %arg, label %end, label %loop.1.0 | ||
loop.1.0: | ||
br i1 %arg, label %loop.1.0, label %loop.1 | ||
end: | ||
ret void | ||
} | ||
|
||
define i32 @f2() { | ||
entry: | ||
ret i32 0 | ||
} | ||
|
||
define i32 @f3() { | ||
entry: | ||
%temp = call i32 @g() | ||
%icmp = icmp ugt i32 %temp, 2 | ||
br i1 %icmp, label %bb.true, label %bb.false | ||
bb.true: | ||
%temp2 = call i32 @f2() | ||
ret i32 %temp2 | ||
bb.false: | ||
ret i32 0 | ||
} | ||
|
||
define void @f4(i1 %arg) { | ||
entry: | ||
%i = alloca i32, align 4 | ||
call void @llvm.lifetime.start(i64 4, ptr %i) | ||
br label %for.cond | ||
|
||
for.cond: | ||
br i1 %arg, label %for.body, label %for.end | ||
|
||
for.body: | ||
br label %for.cond | ||
|
||
for.end: | ||
ret void | ||
} | ||
|
||
declare void @llvm.lifetime.start(i64, ptr nocapture) |
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.