-
Notifications
You must be signed in to change notification settings - Fork 18.1k
[LLVM] InstCount pass added when enabling stats #171658
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 18 commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
8618bf0
Inst Count implemented for metrics pass
InakiVA c43bd80
Whitespace fix
InakiVA 777eb40
Whitespace fix
InakiVA a188066
Merge branch 'main' into 3metrics
InakiVA 77deef8
Format
InakiVA b04f06d
Merge branch 'main' into 3metrics
InakiVA d0077b5
Merge branch 'main' into 3metrics
InakiVA 2c16734
Merge branch 'main' into 3metrics
InakiVA 9fd9380
One check on test fix
InakiVA 3c8722d
Test case simplified
InakiVA 5f8a669
Clang format applied
InakiVA 3f158a9
Merge branch 'main' into 3metrics
InakiVA 378d928
Format retry
InakiVA 8e04b3b
Passes test implementation successful
InakiVA 8b303b2
Passes test implementation successful
InakiVA 9a73888
Merge branch 'main' into 3metrics
InakiVA 7d96aa4
Clang format my change
InakiVA 5f44ea3
Merge branch 'main' into 3metrics
InakiVA 388cbc5
PassBuilderPipelines pass updated
InakiVA 5c1651e
Merge branch 'main' into 3metrics
InakiVA 2b43d95
Merge branch 'llvm:main' into 3metrics
InakiVA b319de5
Use of correct method substitution
InakiVA ec35728
Merge branch 'main' into 3metrics
InakiVA 10ad117
Merge branch 'main' into 3metrics
InakiVA 92219f9
Merge branch 'main' into 3metrics
InakiVA 40fbac7
Merge branch 'main' into 3metrics
InakiVA 30b0ec3
Merge branch 'main' into 3metrics
InakiVA ea3b02b
Removed empty line
InakiVA ea58073
Merge branch 'main' into 3metrics
InakiVA 2d9e5d4
REQUIRES header added to test
InakiVA d799563
Merge branch 'main' into 3metrics
InakiVA 1c1a69e
Merge branch 'main' into 3metrics
InakiVA 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| ; RUN: opt -stats -passes=instcount -disable-output < %s 2>&1 | FileCheck %s | ||
| ; RUN: opt -stats -passes='thinlto<O3>' -disable-output < %s 2>&1 | FileCheck %s | ||
| ; RUN: opt -stats -passes='thinlto-pre-link<O2>' -disable-output < %s 2>&1 | FileCheck %s | ||
| ; RUN: opt -stats -passes='lto<O1>' -disable-output < %s 2>&1 | FileCheck %s | ||
| ; RUN: opt -stats -passes='lto-pre-link<Os>' -disable-output < %s 2>&1 | FileCheck %s | ||
| ; RUN: opt -stats -O3 -disable-output < %s 2>&1 | FileCheck %s | ||
| ; RUN: opt -stats -O0 -disable-output < %s 2>&1 | FileCheck %s | ||
|
|
||
| ; CHECK-DAG: 8 instcount - Number of Br insts | ||
| ; CHECK-DAG: 6 instcount - Number of Call insts | ||
| ; CHECK-DAG: 2 instcount - Number of ICmp insts | ||
| ; CHECK-DAG: 1 instcount - Number of Ret insts | ||
| ; CHECK-DAG: 1 instcount - Number of Switch insts | ||
| ; CHECK-DAG: 10 instcount - Number of basic blocks | ||
| ; CHECK-DAG: 1 instcount - Number of non-external functions | ||
| ; CHECK-DAG: 18 instcount - Number of instructions (of all types) | ||
|
|
||
|
|
||
| define void @foo(i32 %i, i32 %j, i32 %n) { | ||
| entry: | ||
| %cmp = icmp slt i32 %i, %j | ||
| br i1 %cmp, label %if.then, label %if.end | ||
|
|
||
| if.then: | ||
| call void @f() | ||
| br label %if.end | ||
|
|
||
| if.end: | ||
| switch i32 %i, label %sw.default [ | ||
| i32 1, label %sw.bb | ||
| i32 2, label %sw.bb1 | ||
| i32 3, label %sw.bb1 | ||
| ] | ||
|
|
||
| sw.bb: | ||
| call void @g() | ||
| br label %sw.epilog | ||
|
|
||
| sw.bb1: | ||
| call void @h() | ||
| br label %sw.epilog | ||
|
|
||
| sw.default: | ||
| call void @k() | ||
| br label %sw.epilog | ||
|
|
||
| sw.epilog: | ||
| %cmp2 = icmp sgt i32 %i, %n | ||
| br i1 %cmp2, label %if.then3, label %if.else | ||
|
|
||
| if.then3: | ||
| call void @l() | ||
| br label %if.end4 | ||
|
|
||
| if.else: | ||
| call void @m() | ||
| br label %if.end4 | ||
|
|
||
| if.end4: | ||
| ret void | ||
| } | ||
|
|
||
| declare void @f() | ||
| declare void @g() | ||
| declare void @h() | ||
| declare void @k() | ||
| declare void @l() | ||
| declare void @m() |
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.