-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add testdata for a function with two conditionals that eventually join
PiperOrigin-RevId: 696656402
- Loading branch information
1 parent
cd89d70
commit 7baae70
Showing
6 changed files
with
461 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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 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,140 @@ | ||
## CFG Proto for two functions: Function foo has two exception handling landing | ||
## pads. One is cold, the other is hot. | ||
## | ||
## | ||
## 10 | ||
## +-----------------+ | ||
## | | | ||
## v 20 | | ||
## foo -------------> bar | ||
## / \ | ||
## 10 / \ 10 | ||
## v v | ||
## foo.1 foo.2 ----+ | ||
## / \ | | ||
## 10 / \ 0 | | ||
## v v | | ||
## foo.4 foo.3 [eh pad] | | ||
## \ / | 10 | ||
## 10 \ /0 | | ||
## \ / | | ||
## v v | | ||
## foo.5 <--------------+ | ||
## | ||
|
||
cfg { | ||
name: "foo" | ||
function_index: 10 | ||
node { | ||
bb_id: 0 | ||
size: 10 | ||
out_edges { | ||
sink: { | ||
function_index: 10 | ||
bb_index: 1 | ||
} | ||
weight: 10 | ||
kind: BRANCH_OR_FALLTHROUGH | ||
} | ||
out_edges { | ||
sink: { | ||
function_index: 10 | ||
bb_index: 2 | ||
} | ||
weight: 10 | ||
kind: BRANCH_OR_FALLTHROUGH | ||
} | ||
out_edges { | ||
sink: { | ||
function_index: 20 | ||
bb_index: 0 | ||
} | ||
weight: 20 | ||
kind: CALL | ||
} | ||
} | ||
node { | ||
bb_id: 1 | ||
size: 10 | ||
out_edges { | ||
sink: { | ||
function_index: 10 | ||
bb_index: 4 | ||
} | ||
weight: 10 | ||
kind: BRANCH_OR_FALLTHROUGH | ||
} | ||
out_edges { | ||
sink: { | ||
function_index: 10 | ||
bb_index: 3 | ||
} | ||
weight: 0 | ||
kind: BRANCH_OR_FALLTHROUGH | ||
} | ||
} | ||
node { | ||
bb_id: 2 | ||
size: 10 | ||
metadata { | ||
is_landing_pad : true | ||
} | ||
out_edges { | ||
sink: { | ||
function_index: 10 | ||
bb_index: 5 | ||
} | ||
weight: 10 | ||
kind: BRANCH_OR_FALLTHROUGH | ||
} | ||
} | ||
node { | ||
bb_id: 3 | ||
size: 10 | ||
metadata { | ||
is_landing_pad: true | ||
} | ||
out_edges { | ||
sink: { | ||
function_index: 10 | ||
bb_index: 5 | ||
} | ||
weight: 0 | ||
kind: BRANCH_OR_FALLTHROUGH | ||
} | ||
} | ||
node { | ||
bb_id: 4 | ||
size: 10 | ||
out_edges { | ||
sink: { | ||
function_index: 10 | ||
bb_index: 5 | ||
} | ||
weight: 10 | ||
kind: BRANCH_OR_FALLTHROUGH | ||
} | ||
} | ||
node { | ||
bb_id: 5 | ||
size: 10 | ||
} | ||
} | ||
|
||
cfg { | ||
name: "bar" | ||
function_index: 20 | ||
node { | ||
bb_id: 0 | ||
size: 10 | ||
out_edges { | ||
sink: { | ||
function_index: 10 | ||
bb_index: 0 | ||
} | ||
weight: 10 | ||
kind: RETURN | ||
} | ||
} | ||
} | ||
|
This file contains 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,71 @@ | ||
## CFG Proto for a function consisting of a simple loop with cold entry and exit | ||
## edges. | ||
## | ||
## foo | ||
## | | ||
## |0 | ||
## V | ||
## a.BB.foo <--+ | ||
## | | | ||
## | |45 | ||
## |40 | | ||
## | | | ||
## v | | ||
## aa.BB.foo ---+ | ||
## | | ||
## | 0 | ||
## v | ||
## raa.BB.foo | ||
|
||
cfg { | ||
name: "foo" | ||
function_index: 0 | ||
node { | ||
bb_id: 0 | ||
size: 10 | ||
out_edges { | ||
sink: { | ||
function_index: 0 | ||
bb_index: 1 | ||
} | ||
weight: 0 | ||
kind: BRANCH_OR_FALLTHROUGH | ||
} | ||
} | ||
node { | ||
bb_id: 1 | ||
size: 6 | ||
out_edges { | ||
sink: { | ||
function_index: 0 | ||
bb_index: 2 | ||
} | ||
weight: 40 | ||
kind: BRANCH_OR_FALLTHROUGH | ||
} | ||
} | ||
node { | ||
bb_id: 2 | ||
size: 4 | ||
out_edges { | ||
sink: { | ||
function_index: 0 | ||
bb_index: 3 | ||
} | ||
weight: 0 | ||
kind: BRANCH_OR_FALLTHROUGH | ||
} | ||
out_edges { | ||
sink: { | ||
function_index: 0 | ||
bb_index: 1 | ||
} | ||
weight: 45 | ||
kind: BRANCH_OR_FALLTHROUGH | ||
} | ||
} | ||
node { | ||
bb_id: 3 | ||
size: 3 | ||
} | ||
} |
This file contains 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,41 @@ | ||
## CFG Proto for a function consisting of three cold blocks and two hot blocks. | ||
## | ||
## foo | ||
## | ||
## foo.2 foo.4 | ||
## | ||
## 40 | ||
## foo.3 -----> foo.1 | ||
|
||
cfg { | ||
name: "foo" | ||
function_index: 999 | ||
node { | ||
bb_id: 0 | ||
size: 10 | ||
} | ||
node { | ||
bb_id: 1 | ||
size: 6 | ||
} | ||
node { | ||
bb_id: 2 | ||
size: 5 | ||
} | ||
node { | ||
bb_id: 3 | ||
size: 4 | ||
out_edges { | ||
sink : { | ||
function_index: 999 | ||
bb_index: 1 | ||
} | ||
weight: 40 | ||
kind: BRANCH_OR_FALLTHROUGH | ||
} | ||
} | ||
node { | ||
bb_id: 4 | ||
size: 3 | ||
} | ||
} |
This file contains 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,111 @@ | ||
## CFG Proto for a function consisting of a nested loop. | ||
## Ordinals are intentionally out-of-order. | ||
## | ||
## [1] foo | ||
## | | ||
## |5 | ||
## V | ||
## [4] ara.BB.foo <-----+ | ||
## | | | ||
## 60 | | | ||
## V | | ||
## [2] a.BB.foo <--+ | | ||
## | | | | ||
## 600 | 550 | | 40 | ||
## V | | | ||
## [5] aara.BB.foo ---+ | | ||
## | | | ||
## 55 | | | ||
## V | | ||
## [6] aaara.BB.foo -------+ | ||
## | | ||
## 10 | | ||
## V | ||
## [3] ra.BB.foo | ||
## | ||
cfg { | ||
name: "foo" | ||
function_index: 1 | ||
node { | ||
bb_id: 0 | ||
size: 10 | ||
out_edges { | ||
sink: { | ||
function_index: 1 | ||
bb_index: 3 | ||
} | ||
weight: 5 | ||
kind: BRANCH_OR_FALLTHROUGH | ||
} | ||
} | ||
node { | ||
bb_id: 1 | ||
size: 10 | ||
out_edges { | ||
sink: { | ||
function_index: 1 | ||
bb_index: 4 | ||
} | ||
weight: 600 | ||
kind: BRANCH_OR_FALLTHROUGH | ||
} | ||
} | ||
node { | ||
bb_id: 2 | ||
size: 10 | ||
} | ||
node { | ||
bb_id: 3 | ||
size: 10 | ||
out_edges { | ||
sink: { | ||
function_index: 1 | ||
bb_index: 1 | ||
} | ||
weight: 60 | ||
kind: BRANCH_OR_FALLTHROUGH | ||
} | ||
} | ||
|
||
node { | ||
bb_id: 4 | ||
size: 10 | ||
out_edges { | ||
sink: { | ||
function_index: 1 | ||
bb_index: 5 | ||
} | ||
weight: 55 | ||
kind: BRANCH_OR_FALLTHROUGH | ||
} | ||
out_edges { | ||
sink: { | ||
function_index: 1 | ||
bb_index: 1 | ||
} | ||
weight: 550 | ||
kind: BRANCH_OR_FALLTHROUGH | ||
} | ||
} | ||
node { | ||
bb_id: 5 | ||
size: 10 | ||
out_edges { | ||
sink: { | ||
function_index: 1 | ||
bb_index: 3 | ||
} | ||
weight: 40 | ||
kind: BRANCH_OR_FALLTHROUGH | ||
} | ||
out_edges { | ||
sink: { | ||
function_index: 1 | ||
bb_index: 2 | ||
} | ||
weight: 10 | ||
kind: BRANCH_OR_FALLTHROUGH | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.