diff options
author | Volkan Keles <vkeles@apple.com> | 2018-01-25 00:18:52 +0000 |
---|---|---|
committer | Volkan Keles <vkeles@apple.com> | 2018-01-25 00:18:52 +0000 |
commit | 4f3fa79842adb5570efa5eb89bd7d577537aec51 (patch) | |
tree | 1ac4a327fb1388ed1a4b926cfd46fc2c3d5e752b /llvm/utils/TableGen/GlobalISelEmitter.cpp | |
parent | d053b5973057f2a4c9cd7c76e61b34ad60d3caea (diff) | |
download | bcm5719-llvm-4f3fa79842adb5570efa5eb89bd7d577537aec51.tar.gz bcm5719-llvm-4f3fa79842adb5570efa5eb89bd7d577537aec51.zip |
[GlobalISel][TableGen] Fix the statistics for emitted patters
Collected statistics for the number of patterns emitted can be
incorrect because rules can be grouped if OptimizeMatchTable
is enabled. Increase the counter in RuleMatcher::emit(...)
to avoid that.
llvm-svn: 323391
Diffstat (limited to 'llvm/utils/TableGen/GlobalISelEmitter.cpp')
-rw-r--r-- | llvm/utils/TableGen/GlobalISelEmitter.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/utils/TableGen/GlobalISelEmitter.cpp b/llvm/utils/TableGen/GlobalISelEmitter.cpp index b350618e5ab..865a01a868e 100644 --- a/llvm/utils/TableGen/GlobalISelEmitter.cpp +++ b/llvm/utils/TableGen/GlobalISelEmitter.cpp @@ -2488,6 +2488,7 @@ void RuleMatcher::emit(MatchTable &Table) { Table << MatchTable::Opcode("GIR_Done", -1) << MatchTable::LineBreak << MatchTable::Label(LabelID); + ++NumPatternEmitted; } bool RuleMatcher::isHigherPriorityThan(const RuleMatcher &B) const { @@ -3949,10 +3950,9 @@ void GlobalISelEmitter::run(raw_ostream &OS) { : InputRules; MatchTable Table(0); - for (Matcher *Rule : OptRules) { + for (Matcher *Rule : OptRules) Rule->emit(Table); - ++NumPatternEmitted; - } + Table << MatchTable::Opcode("GIM_Reject") << MatchTable::LineBreak; Table.emitDeclaration(OS); OS << " if (executeMatchTable(*this, OutMIs, State, ISelInfo, "; |