mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-03 17:32:59 +00:00
[llvm-mca] fix formatting
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329729 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
538b65888c
commit
6592e3d4b5
@ -41,20 +41,20 @@ assembly text:
|
|||||||
|
|
||||||
.. code-block:: c++
|
.. code-block:: c++
|
||||||
|
|
||||||
int foo(int a, int b) {
|
int foo(int a, int b) {
|
||||||
__asm volatile("# LLVM-MCA-BEGIN foo");
|
__asm volatile("# LLVM-MCA-BEGIN foo");
|
||||||
a += 42;
|
a += 42;
|
||||||
__asm volatile("# LLVM-MCA-END");
|
__asm volatile("# LLVM-MCA-END");
|
||||||
a *= b;
|
a *= b;
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
So for example, you can compile code with clang, output assembly, and pipe it
|
So for example, you can compile code with clang, output assembly, and pipe it
|
||||||
directly into llvm-mca for analysis:
|
directly into llvm-mca for analysis:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ clang foo.cpp -O2 -target x86_64-unknown-unknown -S -o - | llvm-mca -mcpu=btver2
|
$ clang foo.cpp -O2 -target x86_64-unknown-unknown -S -o - | llvm-mca -mcpu=btver2
|
||||||
|
|
||||||
Multiple regions can be specified provided that they do not overlap. A code
|
Multiple regions can be specified provided that they do not overlap. A code
|
||||||
region can have an optional description. If no user defined region is specified,
|
region can have an optional description. If no user defined region is specified,
|
||||||
|
Loading…
Reference in New Issue
Block a user