[llvm] r307146 - [globalisel][tablegen] Fix the misuse of STATISTICS() on release builds (like r307088) after r307133.
Daniel Sanders via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 5 05:14:18 PDT 2017
Author: dsanders
Date: Wed Jul 5 05:14:18 2017
New Revision: 307146
URL: http://llvm.org/viewvc/llvm-project?rev=307146&view=rev
Log:
[globalisel][tablegen] Fix the misuse of STATISTICS() on release builds (like r307088) after r307133.
r307133 brought back a couple instances of the same mistake that was already
fixed by r307088. Fixed it again.
Using NumPatternEmitted as a unique id for the tables is not valid on release
builds since the counters don't count in that case.
Modified:
llvm/trunk/utils/TableGen/GlobalISelEmitter.cpp
Modified: llvm/trunk/utils/TableGen/GlobalISelEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/GlobalISelEmitter.cpp?rev=307146&r1=307145&r2=307146&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/GlobalISelEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/GlobalISelEmitter.cpp Wed Jul 5 05:14:18 2017
@@ -1274,7 +1274,7 @@ void RuleMatcher::emit(raw_ostream &OS)
<< " };\n"
<< " State.MIs.clear();\n"
<< " State.MIs.push_back(&I);\n"
- << " DEBUG(dbgs() << \"Processing MatchTable" << NumPatternEmitted
+ << " DEBUG(dbgs() << \"Processing MatchTable" << CurrentMatchTableID
<< "\\n\");\n"
<< " if (executeMatchTable(*this, State, MatcherInfo, MatchTable"
<< CurrentMatchTableID << ", MRI, TRI, RBI, AvailableFeatures)) {\n";
@@ -1335,15 +1335,15 @@ void RuleMatcher::emit(raw_ostream &OS)
}
}
- OS << " const static int64_t EmitTable" << NumPatternEmitted << "[] = {\n";
+ OS << " const static int64_t EmitTable" << CurrentMatchTableID << "[] = {\n";
for (const auto &MA : Actions)
MA->emitCxxActionStmts(OS, *this, 0);
OS << " GIR_Done,\n"
<< " };\n"
<< " NewMIVector OutMIs;\n"
- << " DEBUG(dbgs() << \"Processing EmitTable" << NumPatternEmitted
+ << " DEBUG(dbgs() << \"Processing EmitTable" << CurrentMatchTableID
<< "\\n\");\n"
- << " executeEmitTable(OutMIs, State, EmitTable" << NumPatternEmitted
+ << " executeEmitTable(OutMIs, State, EmitTable" << CurrentMatchTableID
<< ", TII, TRI, RBI);\n";
OS << " return true;\n";
More information about the llvm-commits
mailing list