Skip to content

Commit 0ca426d

Browse files
committed
[llvm-mca] Improve barriers for strict region marking (PR52198)
As suggested on the bug, to help (but not completely....) stop folded instructions crossing the inline asm barriers used for llvm-mca analysis, we should recommend tagging with memory captures/attributes. Differential Revision: https://reviews.llvm.org/D117788
1 parent 9c5b856 commit 0ca426d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/docs/CommandGuide/llvm-mca.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -299,9 +299,9 @@ C++. As a workaround, inline assembly directives may be used:
299299
.. code-block:: c++
300300

301301
int foo(int a, int b) {
302-
__asm volatile("# LLVM-MCA-BEGIN foo");
302+
__asm volatile("# LLVM-MCA-BEGIN foo":::"memory");
303303
a += 42;
304-
__asm volatile("# LLVM-MCA-END");
304+
__asm volatile("# LLVM-MCA-END":::"memory");
305305
a *= b;
306306
return a;
307307
}

0 commit comments

Comments
 (0)