Skip to content

Commit

Permalink
Add testdata for a function that consists of two large basic blocks
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 696656397
  • Loading branch information
dhoekwater authored and copybara-github committed Nov 14, 2024
1 parent 423af57 commit 4a12d59
Show file tree
Hide file tree
Showing 13 changed files with 1,204 additions and 0 deletions.
12 changes: 12 additions & 0 deletions propeller/testdata/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,31 @@ _LLVM_PROPELLER_TESTDATA_TOOLCHAINS = [
]

exports_files([
"all_cold_landing_pads.protobuf",
"bimodal_sample.bin",
"bimodal_sample.x.bin",
"call_from_simple_loop.protobuf",
"clang_v0_labels.binary",
"hot_and_cold_landing_pads.protobuf",
"llvm_function_samples.binary",
"llvm_function_samples_perf.data",
"loop_no_entry_no_exit.protobuf",
"multiple_cold_blocks.protobuf",
"nested_loop.protobuf",
"propeller_sample.protobuf",
"propeller_sample_1.bin",
"sample.bin",
"sample.c",
"sample_section.bin",
"simple_conditionals_join.protobuf",
"simple_loop.protobuf",
"simple_multi_function.protobuf",
"test_comdat.h",
"test_comdat_1.cc",
"test_comdat_2.cc",
"three_branches.protobuf",
"two_conditionals_in_loop.protobuf",
"two_large_blocks.protobuf",
])

# This rule generates a binary with comdat functions.
Expand Down
139 changes: 139 additions & 0 deletions propeller/testdata/all_cold_landing_pads.protobuf
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
## CFG Proto for two functions: Function foo has two exception handling landing
## pads which are both cold.
##
##
## 20
## +-----------------+
## | |
## v 20 |
## foo -------------> bar
## / \
## 20 / \ 0
## v v [eh pad]
## foo.1 foo.2 ----+
## / \ |
## 20 / \ 0 |
## v v |
## foo.4 foo.3 [eh pad] |
## \ / | 0
## 20 \ /0 |
## \ / |
## v v |
## foo.5 <-------------+
##

cfg {
name: "foo"
function_index: 100
node {
bb_id: 0
size: 10
out_edges {
sink : {
function_index: 100
bb_index: 1
}
weight: 20
kind: BRANCH_OR_FALLTHROUGH
}
out_edges {
sink : {
function_index: 100
bb_index: 2
}
weight: 0
kind: BRANCH_OR_FALLTHROUGH
}
out_edges {
sink : {
function_index: 200
bb_index: 0
}
weight: 20
kind: CALL
}
}
node {
bb_id: 1
size: 10
out_edges {
sink : {
function_index: 100
bb_index: 4
}
weight: 20
kind: BRANCH_OR_FALLTHROUGH
}
out_edges {
sink : {
function_index: 100
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: 100
bb_index: 5
}
weight: 0
kind: BRANCH_OR_FALLTHROUGH
}
}
node {
bb_id: 3
size: 10
metadata {
is_landing_pad: true
} out_edges {
sink : {
function_index: 100
bb_index: 5
}
weight: 0
kind: BRANCH_OR_FALLTHROUGH
}
}
node {
bb_id: 4
size: 10
out_edges {
sink : {
function_index: 100
bb_index: 5
}
weight: 20
kind: BRANCH_OR_FALLTHROUGH
}
}
node {
bb_id: 5
size: 10
}
}

cfg {
name: "bar"
function_index: 200
node {
bb_id: 0
size: 10
out_edges {
sink : {
function_index: 100
bb_index: 0
}
weight: 20
kind: RETURN
}
}
}

87 changes: 87 additions & 0 deletions propeller/testdata/call_from_simple_loop.protobuf
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
## CFG consisting of a function calling another function in a simple loop.
##
## foo <------- baz
## | 100
## 5 |
## |
## v 100
## +---> foo.1 -------> bar
## | |
## | 100 |100
## | |
## | v
## +--- foo.2
##

cfg {
name: "foo"
function_index: 1
node {
bb_id: 0
size: 10
out_edges {
sink : {
function_index: 1
bb_index: 1
}
weight: 5
kind: BRANCH_OR_FALLTHROUGH
}
}
node {
bb_id: 1
size: 4
out_edges {
sink : {
function_index: 1
bb_index: 2
}
weight: 100
kind: BRANCH_OR_FALLTHROUGH
}
out_edges {
sink : {
function_index: 2
bb_index: 0
}
weight: 100
kind: CALL
}
}
node {
bb_id: 2
size: 6
out_edges {
sink : {
function_index: 1
bb_index: 1
}
weight: 100
kind: BRANCH_OR_FALLTHROUGH
}
}
}
cfg {
name: "bar"
function_index: 2
node {
bb_id: 0
size: 2
}
}
cfg {
name: "baz"
function_index: 3
node {
bb_id: 0
size: 6
out_edges {
sink : {
function_index: 1
bb_index: 0
}
weight: 100
kind: CALL
}
}
}
Loading

0 comments on commit 4a12d59

Please sign in to comment.