You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The *branch hints section* is a custom section whose name string is "branchHints".
52
52
The branch hints section should appear only once in a module, and only before the code section.
53
53
54
-
The purpose of this section is to aid the compilation of conditional branch instructions, by providing a hint that a branch is very likely (or unlikely) to be taken.
54
+
The purpose of this section is to aid the compilation of conditional branch instructions,
55
+
by providing a hint that a branch is very likely (or unlikely) to be taken.
55
56
56
57
An implementation is not required to follow the hints, and this section can be entirely ignored.
57
58
@@ -63,6 +64,9 @@ Each *function hints* structure consists of
63
64
* a single 0 byte
64
65
* a vector of *branch hints* for the function.
65
66
67
+
Elements of the *function hints* vector must appear in increasing function index order,
68
+
and a function index can appear at most once.
69
+
66
70
Each *branch hint* structure consists of
67
71
68
72
* a u32 indicating the meaning of the hint:
@@ -72,5 +76,9 @@ Each *branch hint* structure consists of
72
76
| 0 | likely not taken |
73
77
| 1 | likely taken |
74
78
75
-
* the u32 byte offset of the hinted instruction from the first instruction of the function
79
+
* the u32 byte offset of the hinted instruction from the first instruction of the function.
80
+
81
+
Elements of the *branch hints* vector must appear in increasing byte offset order,
82
+
and a byte offset can appear at most once. A `br_if` or `if` instruction must be present
0 commit comments