diff options
author | Daniel Sanders <daniel_l_sanders@apple.com> | 2019-02-11 23:02:02 +0000 |
---|---|---|
committer | Daniel Sanders <daniel_l_sanders@apple.com> | 2019-02-11 23:02:02 +0000 |
commit | 6cbc92915ae8f5cb1d5b265e15858e79c718e7ba (patch) | |
tree | 013b8351b4d99773bd86c6bace699922763ab01b /llvm/utils/TableGen/TableGen.cpp | |
parent | 88fccbdea70d988f360baa7b6b0cea618518ee07 (diff) | |
download | bcm5719-llvm-6cbc92915ae8f5cb1d5b265e15858e79c718e7ba.tar.gz bcm5719-llvm-6cbc92915ae8f5cb1d5b265e15858e79c718e7ba.zip |
[tblgen] Add a timer covering the time spent reading the Instruction defs
This patch adds a -time-regions option to tablegen that can enable timers
(currently only one) that assess the performance of tablegen itself. This
can be useful for identifying scaling problems with tablegen backends.
This particular timer has allowed me to ignore time that is not attributed
the GISel combiner pass. It's useful by itself but it is particularly
useful in combination with https://reviews.llvm.org/D52954 which causes
this period of time to be annotated within Xcode Instruments which in turn
allows profile samples and recorded allocations attributed to reading
instructions to be filtered out.
llvm-svn: 353763
Diffstat (limited to 'llvm/utils/TableGen/TableGen.cpp')
-rw-r--r-- | llvm/utils/TableGen/TableGen.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/utils/TableGen/TableGen.cpp b/llvm/utils/TableGen/TableGen.cpp index 38f81dc396c..c485ed2feb7 100644 --- a/llvm/utils/TableGen/TableGen.cpp +++ b/llvm/utils/TableGen/TableGen.cpp @@ -55,6 +55,12 @@ enum ActionType { GenExegesis, }; +namespace llvm { +/// Storage for TimeRegionsOpt as a global so that backends aren't required to +/// include CommandLine.h +bool TimeRegions = false; +} // end namespace llvm + namespace { cl::opt<ActionType> Action(cl::desc("Action to perform:"), @@ -126,6 +132,11 @@ namespace { Class("class", cl::desc("Print Enum list for this class"), cl::value_desc("class name"), cl::cat(PrintEnumsCat)); +cl::opt<bool, true> + TimeRegionsOpt("time-regions", + cl::desc("Time regions of tablegens execution"), + cl::location(TimeRegions)); + bool LLVMTableGenMain(raw_ostream &OS, RecordKeeper &Records) { switch (Action) { case PrintRecords: |