Skip to content

Commit

Permalink
Add a testdata proto for a function with both hot and cold EH landing…
Browse files Browse the repository at this point in the history
… pads

PiperOrigin-RevId: 696891138
  • Loading branch information
dhoekwater authored and copybara-github committed Nov 15, 2024
1 parent cd89d70 commit afd57b2
Show file tree
Hide file tree
Showing 2 changed files with 141 additions and 0 deletions.
1 change: 1 addition & 0 deletions propeller/testdata/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ exports_files([
"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",
"propeller_sample.protobuf",
Expand Down
140 changes: 140 additions & 0 deletions propeller/testdata/hot_and_cold_landing_pads.protobuf
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
}
}
}

0 comments on commit afd57b2

Please sign in to comment.