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

Matt Davis via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 10 13:38:56 PDT 2019


Author: mattd
Date: Mon Jun 10 13:38:56 2019
New Revision: 362979

URL: http://llvm.org/viewvc/llvm-project?rev=362979&view=rev
Log:
[Docs] [llvm-mca] Point out a caveat for using llvm-mca markers in source code.

Summary: See: https://bugs.llvm.org/show_bug.cgi?id=42173

Reviewers: andreadb, mattd, RKSimon, spatel

Reviewed By: andreadb

Subscribers: tschuett, gbedwell, llvm-commits, andreadb

Tags: #llvm

Patch by Max Marrone (maxpm)! Thanks!

Differential Revision: https://reviews.llvm.org/D63040

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

Modified: llvm/trunk/docs/CommandGuide/llvm-mca.rst
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CommandGuide/llvm-mca.rst?rev=362979&r1=362978&r2=362979&view=diff
==============================================================================
--- llvm/trunk/docs/CommandGuide/llvm-mca.rst (original)
+++ llvm/trunk/docs/CommandGuide/llvm-mca.rst Mon Jun 10 13:38:56 2019
@@ -241,8 +241,8 @@ Example of overlapping regions:
 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 @@ assembly text:
     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
 ------------------
 




More information about the llvm-commits mailing list