Skip to content

Commit 4a9a962

Browse files
committed
[llvm][docs] Update old metadata syntax in examples
This patch updates examples in the documentation to match the existing convention. Calls to intrinsics that have metadata arguments were not included. Reviewed By: dexonsmith Differential Revision: https://reviews.llvm.org/D142651
1 parent 8db31e9 commit 4a9a962

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

llvm/docs/BlockFrequencyTerminology.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ For example, consider this IR:
3737
br i1 %cond, label %B, label %C, !prof !0
3838
; ...
3939
}
40-
!0 = metadata !{metadata !"branch_weights", i32 7, i32 8}
40+
!0 = !{!"branch_weights", i32 7, i32 8}
4141
4242
and this simple graph representation::
4343

llvm/docs/BranchWeightMetadata.rst

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ operands for the true and the false branch.
3131

3232
.. code-block:: none
3333
34-
!0 = metadata !{
35-
metadata !"branch_weights",
34+
!0 = !{
35+
!"branch_weights",
3636
i32 <TRUE_BRANCH_WEIGHT>,
3737
i32 <FALSE_BRANCH_WEIGHT>
3838
}
@@ -45,8 +45,8 @@ is always case #0).
4545

4646
.. code-block:: none
4747
48-
!0 = metadata !{
49-
metadata !"branch_weights",
48+
!0 = !{
49+
!"branch_weights",
5050
i32 <DEFAULT_BRANCH_WEIGHT>
5151
[ , i32 <CASE_BRANCH_WEIGHT> ... ]
5252
}
@@ -58,8 +58,8 @@ Branch weights are assigned to every destination.
5858

5959
.. code-block:: none
6060
61-
!0 = metadata !{
62-
metadata !"branch_weights",
61+
!0 = !{
62+
!"branch_weights",
6363
i32 <LABEL_BRANCH_WEIGHT>
6464
[ , i32 <LABEL_BRANCH_WEIGHT> ... ]
6565
}
@@ -73,8 +73,8 @@ block and entry counts which may not be accurate with sampling.
7373

7474
.. code-block:: none
7575
76-
!0 = metadata !{
77-
metadata !"branch_weights",
76+
!0 = !{
77+
!"branch_weights",
7878
i32 <CALL_BRANCH_WEIGHT>
7979
}
8080
@@ -93,8 +93,8 @@ is used.
9393

9494
.. code-block:: none
9595
96-
!0 = metadata !{
97-
metadata !"branch_weights",
96+
!0 = !{
97+
!"branch_weights",
9898
i32 <INVOKE_NORMAL_WEIGHT>
9999
[ , i32 <INVOKE_UNWIND_WEIGHT> ]
100100
}

0 commit comments

Comments
 (0)