diff options
author | Andrea Di Biagio <Andrea_DiBiagio@sn.scee.net> | 2019-05-09 15:18:09 +0000 |
---|---|---|
committer | Andrea Di Biagio <Andrea_DiBiagio@sn.scee.net> | 2019-05-09 15:18:09 +0000 |
commit | 4e62554bfae2703b797ddff64e583aed0c4a7e35 (patch) | |
tree | ee12951bd5d713feca753fed7c926773509513e1 /llvm/docs/CommandGuide | |
parent | dcdb3c6650e67c99e9f5df079044dbbf412514e9 (diff) | |
download | bcm5719-llvm-4e62554bfae2703b797ddff64e583aed0c4a7e35.tar.gz bcm5719-llvm-4e62554bfae2703b797ddff64e583aed0c4a7e35.zip |
[MCA] Add support for nested and overlapping region markers
This patch fixes PR41523
https://bugs.llvm.org/show_bug.cgi?id=41523
Regions can now nest/overlap provided that they have different names.
Anonymous regions cannot overlap.
Region end markers must specify the region name. The only exception is for when
there is only one user-defined region; in that particular case, the region end
marker doesn't need to specify a name.
Incorrect region end markers are no longer ignored. Instead, the tool reports an
error and we exit with an error code.
Added test cases to verify the new diagnostic error messages.
Updated the llvm-mca docs to reflect this feature change.
Differential Revision: https://reviews.llvm.org/D61676
llvm-svn: 360351
Diffstat (limited to 'llvm/docs/CommandGuide')
-rw-r--r-- | llvm/docs/CommandGuide/llvm-mca.rst | 52 |
1 files changed, 45 insertions, 7 deletions
diff --git a/llvm/docs/CommandGuide/llvm-mca.rst b/llvm/docs/CommandGuide/llvm-mca.rst index 5d504a9f9cb..5b30a8a532a 100644 --- a/llvm/docs/CommandGuide/llvm-mca.rst +++ b/llvm/docs/CommandGuide/llvm-mca.rst @@ -192,16 +192,54 @@ example: .. code-block:: none - # LLVM-MCA-BEGIN My Code Region + # LLVM-MCA-BEGIN ... # LLVM-MCA-END -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, -then :program:`llvm-mca` assumes a default region which contains every -instruction in the input file. Every region is analyzed in isolation, and the -final performance report is the union of all the reports generated for every -code region. +If no user-defined region is specified, then :program:`llvm-mca` assumes a +default region which contains every instruction in the input file. Every region +is analyzed in isolation, and the final performance report is the union of all +the reports generated for every code region. + +Code regions can have names. For example: + +.. code-block:: none + + # LLVM-MCA-BEGIN A simple example + add %eax, %eax + # LLVM-MCA-END + +The code from the example above defines a region named "A simple example" with a +single instruction in it. Note how the region name doesn't have to be repeated +in the ``LLVM-MCA-END`` directive. In the absence of overlapping regions, +an anonymous ``LLVM-MCA-END`` directive always ends the currently active user +defined region. + +Example of nesting regions: + +.. code-block:: none + + # LLVM-MCA-BEGIN foo + add %eax, %edx + # LLVM-MCA-BEGIN bar + sub %eax, %edx + # LLVM-MCA-END bar + # LLVM-MCA-END foo + +Example of overlapping regions: + +.. code-block:: none + + # LLVM-MCA-BEGIN foo + add %eax, %edx + # LLVM-MCA-BEGIN bar + sub %eax, %edx + # LLVM-MCA-END foo + add %eax, %edx + # LLVM-MCA-END bar + +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: |