1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-18 18:42:46 +02:00
llvm-mirror/tools
Andrea Di Biagio 66e474bb74 [llvm-mca] Add the ability to mark regions of code for analysis (PR36875)
This patch teaches llvm-mca how to parse code comments in search for special
"markers" used to select regions of code.

Example:

# LLVM-MCA-BEGIN My Code Region
  ....
# LLVM-MCA-END

The MCAsmLexer now delegates to an object of class MCACommentParser (i.e. an
AsmCommentConsumer) the parsing of code comments to search for begin/end code
region markers.

A comment starting with substring "LLVM-MCA-BEGIN" marks the beginning of a new
region of code.  A comment starting with substring "LLVM-MCA-END" marks the end
of the last region.

This implementation doesn't allow regions to overlap. Each region can have a
optional description; internally, each region is identified by a range of source
code locations (SMLoc).

MCInst objects are added to a region R only if the source location for the
MCInst is in the range of locations specified by R.

By default, the tool allocates an implicit "Default" code region which contains
every source location.  See new tests llvm-mca-marker-*.s for a few examples.

A new Backend object is created for every region. So, the analysis is conducted
on every parsed code region.  The final report is the union of the reports
generated for every code region.  Note that empty regions are skipped.

Special "[#] Code Region - ..." strings are used in the report to mark the
portion which is specific to a code region only. For example, see
llvm-mca-markers-5.s.

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

llvm-svn: 329590
2018-04-09 16:39:52 +00:00
..
bugpoint Fix a couple of layering violations in Transforms 2018-03-21 22:34:23 +00:00
bugpoint-passes Remove redundant includes from tools. 2017-12-13 21:31:10 +00:00
dsymutil [dsymutil] Remove trailing colon. NFC 2018-04-09 09:10:34 +00:00
gold Revert r324557, "gold-plugin: Do not set codegen opt level based on LTO opt level." 2018-04-06 21:14:33 +00:00
llc Pass a module reference to CloneModule. 2018-02-14 19:50:40 +00:00
lli [ORC] Create a new SymbolStringPool by default in ExecutionSession constructor. 2018-04-02 20:57:56 +00:00
llvm-ar [llvm-ar] Support multiple dashed options 2018-03-28 17:21:14 +00:00
llvm-as Pass a reference to a module to the bitcode writer. 2018-02-14 19:11:32 +00:00
llvm-as-fuzzer cmake: Invent add_llvm_fuzzer to set up fuzzer targets 2017-08-31 00:36:33 +00:00
llvm-bcanalyzer [ThinLTO/CFI] Include TYPE_ID summaries into GLOBALVAL_SUMMARY_BLOCK 2018-02-14 22:41:15 +00:00
llvm-c-test [LLVM-C] Move DIBuilder Bindings For Block Scopes 2018-04-07 06:07:55 +00:00
llvm-cat Pass a reference to a module to the bitcode writer. 2018-02-14 19:11:32 +00:00
llvm-cfi-verify Fix broken builds due to mismatched min/max types 2018-02-02 00:07:14 +00:00
llvm-config [tools] Change std::sort to llvm::sort in response to r327219 2018-04-01 21:24:53 +00:00
llvm-cov [llvm-cov] Implement -ignore-filename-regex= option for excluding source files. 2018-04-09 15:20:35 +00:00
llvm-cvtres llvm-cvtres: Mention ARM64 as a supported machine type in the help text. NFC. 2018-02-27 20:44:33 +00:00
llvm-cxxdump Fix more inconsistent line endings. NFC. 2017-12-18 19:46:56 +00:00
llvm-cxxfilt Add opt-viewer testing 2017-11-29 17:07:41 +00:00
llvm-demangle-fuzzer llvm-demangle-fuzzer: Link in Support 2017-11-17 20:46:55 +00:00
llvm-diff Remove redundant includes from tools. 2017-12-13 21:31:10 +00:00
llvm-dis [Support] Rename tool_output_file to ToolOutputFile, NFC 2017-09-23 01:03:17 +00:00
llvm-dwarfdump [DebugInfo/AccelTable] Fix inconsistency in getDIEOffset implementations 2018-03-09 11:58:59 +00:00
llvm-dwp DWARF: Unify form size handling code 2018-03-14 09:39:54 +00:00
llvm-exegesis [llvm-exegesis] Fix unused return value warning and add a useful error message for event counter reads. 2018-04-07 11:37:21 +00:00
llvm-extract [llvm-extract] Support extracting basic blocks 2018-01-23 21:51:34 +00:00
llvm-go Update some code.google.com links 2017-11-13 23:47:58 +00:00
llvm-isel-fuzzer [llvm-opt-fuzzer] Avoid adding incorrect inputs to the fuzzer corpus 2018-02-05 11:05:47 +00:00
llvm-jitlistener Search for llvm-symbolizer binary in the same directory as argv[0], before 2016-06-09 00:53:21 +00:00
llvm-link Revert "[IRMover] Implement name based structure type mapping" 2018-02-21 20:12:18 +00:00
llvm-lto [ThinLTO] Added a couple of C LTO API interfaces to control the cache policy. 2018-03-02 03:51:27 +00:00
llvm-lto2 [ThinLTO] Always create linked objects file for --thinlto-index-only= 2018-02-22 19:06:15 +00:00
llvm-mc Reapply "[DWARFv5] Emit file 0 to the line table." 2018-03-29 17:16:41 +00:00
llvm-mc-assemble-fuzzer Rename MCTargetOptionsCommandFlags.h to .def as it is not a normal/modular header as much as it is for stamping out some global/static variables 2017-11-27 19:55:16 +00:00
llvm-mc-disassemble-fuzzer cmake: Invent add_llvm_fuzzer to set up fuzzer targets 2017-08-31 00:36:33 +00:00
llvm-mca [llvm-mca] Add the ability to mark regions of code for analysis (PR36875) 2018-04-09 16:39:52 +00:00
llvm-modextract Pass a reference to a module to the bitcode writer. 2018-02-14 19:11:32 +00:00
llvm-mt [Option] Add 'findNearest' method to catch typos 2018-01-05 17:10:39 +00:00
llvm-nm [tools] Change std::sort to llvm::sort in response to r327219 2018-04-01 21:24:53 +00:00
llvm-objcopy [llvm-objcopy] Implement support for section groups 2018-03-21 19:53:44 +00:00
llvm-objdump [tools] Change std::sort to llvm::sort in response to r327219 2018-04-01 21:24:53 +00:00
llvm-opt-fuzzer Pass a reference to a module to the bitcode writer. 2018-02-14 19:11:32 +00:00
llvm-opt-report Don't call exit from cl::PrintHelpMessage. 2017-09-07 23:30:48 +00:00
llvm-pdbutil [llvm-pdbutil] Display types from MSVC precompiled header object files. 2018-04-05 18:18:12 +00:00
llvm-profdata [llvm-profdata] Don't treat non-fatal merge errors as fatal 2017-11-17 21:18:32 +00:00
llvm-rc Fix typos of occurred and occurrence 2018-01-24 10:33:39 +00:00
llvm-readobj [llvm-pdbutil] Display types from MSVC precompiled header object files. 2018-04-05 18:18:12 +00:00
llvm-rtdyld [llvm-rtdyld] Fix the InputFileList cl::opt description: it accepts multiple 2018-03-31 16:01:01 +00:00
llvm-shlib Rename llvm library from libLLVM-X.Y to libLLVM-X 2018-03-29 09:44:09 +00:00
llvm-size Fix more inconsistent line endings. NFC. 2017-12-18 19:46:56 +00:00
llvm-special-case-list-fuzzer [llvm-special-case-list-fuzzer] Add fuzz target. 2017-10-17 17:43:34 +00:00
llvm-split Pass a reference to a module to the bitcode writer. 2018-02-14 19:11:32 +00:00
llvm-stress [Support] Rename tool_output_file to ToolOutputFile, NFC 2017-09-23 01:03:17 +00:00
llvm-strings [llvm-strings] Add support for the -a/--all options 2017-11-14 19:58:36 +00:00
llvm-symbolizer Use itaniumDemangle in llvm-symbolizer 2018-03-07 23:07:34 +00:00
llvm-xray [tools] Change std::sort to llvm::sort in response to r327219 2018-04-01 21:24:53 +00:00
lto [ThinLTO] Added a couple of C LTO API interfaces to control the cache policy. 2018-03-02 03:51:27 +00:00
msbuild Create msbuild only when using MSVC 2017-03-16 20:24:14 +00:00
obj2yaml [WebAssembly] Identify COMDATs by index rather than string. NFC 2018-03-14 15:44:45 +00:00
opt Re-land r329273: [Plugins] Add a slim plugin API to work together with the new PM 2018-04-05 15:04:13 +00:00
opt-viewer [opt-viewer] Kill parser processes before moving onto rendering 2018-02-26 21:15:51 +00:00
sancov Remove redundant includes from tools. 2017-12-13 21:31:10 +00:00
sanstats Fix broken links to the Itanium CXX ABI 2017-09-12 00:19:11 +00:00
verify-uselistorder Pass a reference to a module to the bitcode writer. 2018-02-14 19:11:32 +00:00
xcode-toolchain [llvm] Add stripped installation targets 2017-11-30 21:48:26 +00:00
yaml2obj [tools] Change std::sort to llvm::sort in response to r327219 2018-04-01 21:24:53 +00:00
CMakeLists.txt Fixup r271533, or check-clang didn't find llvm-lto as the target. 2016-06-02 20:39:24 +00:00
LLVMBuild.txt Re-land r329156 "Add llvm-exegesis tool." 2018-04-04 11:37:06 +00:00