[PATCH] D63040: [Docs] [llvm-mca] Point out a caveat for using llvm-mca markers in source code.

Matt Davis via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 10 13:37:01 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL362979: [Docs] [llvm-mca] Point out a caveat for using llvm-mca markers in source code. (authored by mattd, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D63040?vs=203711&id=203890#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63040/new/

https://reviews.llvm.org/D63040

Files:
  llvm/trunk/docs/CommandGuide/llvm-mca.rst


Index: llvm/trunk/docs/CommandGuide/llvm-mca.rst
===================================================================
--- llvm/trunk/docs/CommandGuide/llvm-mca.rst
+++ llvm/trunk/docs/CommandGuide/llvm-mca.rst
@@ -241,8 +241,8 @@
 Note that multiple anonymous regions cannot overlap. Also, overlapping regions
 cannot have the same name.
 
-Inline assembly directives may be used from source code to annotate the
-assembly text:
+There is no support for marking regions from high-level source code, like C or
+C++. As a workaround, inline assembly directives may be used:
 
 .. code-block:: c++
 
@@ -254,6 +254,15 @@
     return a;
   }
 
+However, this interferes with optimizations like loop vectorization and may have
+an impact on the code generated. This is because the ``__asm`` statements are
+seen as real code having important side effects, which limits how the code
+around them can be transformed. If users want to make use of inline assembly
+to emit markers, then the recommendation is to always verify that the output
+assembly is equivalent to the assembly generated in the absence of markers.
+The `Clang options to emit optimization reports <https://clang.llvm.org/docs/UsersManual.html#options-to-emit-optimization-reports>`_
+can also help in detecting missed optimizations.
+
 HOW LLVM-MCA WORKS
 ------------------
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63040.203890.patch
Type: text/x-patch
Size: 1338 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190610/f507c240/attachment.bin>


More information about the llvm-commits mailing list