Skip to content
This repository was archived by the owner on Mar 28, 2020. It is now read-only.

Commit c61a590

Browse files
committed
[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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307146 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 501e515 commit c61a590

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

utils/TableGen/GlobalISelEmitter.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1274,7 +1274,7 @@ void RuleMatcher::emit(raw_ostream &OS) {
12741274
<< " };\n"
12751275
<< " State.MIs.clear();\n"
12761276
<< " State.MIs.push_back(&I);\n"
1277-
<< " DEBUG(dbgs() << \"Processing MatchTable" << NumPatternEmitted
1277+
<< " DEBUG(dbgs() << \"Processing MatchTable" << CurrentMatchTableID
12781278
<< "\\n\");\n"
12791279
<< " if (executeMatchTable(*this, State, MatcherInfo, MatchTable"
12801280
<< CurrentMatchTableID << ", MRI, TRI, RBI, AvailableFeatures)) {\n";
@@ -1335,15 +1335,15 @@ void RuleMatcher::emit(raw_ostream &OS) {
13351335
}
13361336
}
13371337

1338-
OS << " const static int64_t EmitTable" << NumPatternEmitted << "[] = {\n";
1338+
OS << " const static int64_t EmitTable" << CurrentMatchTableID << "[] = {\n";
13391339
for (const auto &MA : Actions)
13401340
MA->emitCxxActionStmts(OS, *this, 0);
13411341
OS << " GIR_Done,\n"
13421342
<< " };\n"
13431343
<< " NewMIVector OutMIs;\n"
1344-
<< " DEBUG(dbgs() << \"Processing EmitTable" << NumPatternEmitted
1344+
<< " DEBUG(dbgs() << \"Processing EmitTable" << CurrentMatchTableID
13451345
<< "\\n\");\n"
1346-
<< " executeEmitTable(OutMIs, State, EmitTable" << NumPatternEmitted
1346+
<< " executeEmitTable(OutMIs, State, EmitTable" << CurrentMatchTableID
13471347
<< ", TII, TRI, RBI);\n";
13481348

13491349
OS << " return true;\n";

0 commit comments

Comments
 (0)