[PATCH] D91632: [TableGen] [ISel Matcher Emitter] Rework with two passes: one to size, one to emit

Paul C. Anagnostopoulos via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 17 09:10:00 PST 2020


Paul-C-Anagnostopoulos added a comment.

I'll get this in as soon as there is some more review *and* I manage to reinstate my building ability. I just updated Visual Studio and can't build anything. Sigh.



================
Comment at: llvm/utils/TableGen/DAGISelMatcherEmitter.cpp:51
 
+  SmallVector<unsigned, Matcher::HighestKind+1> OpcodeCounts;
+
----------------
foad wrote:
> Did you mean to include this in this patch? It seems unrelated.
This part of the update eliminates the extra pass over the matcher tree just to count the matcher kinds for the histogram. The counting was merged into the new first pass for sizing.


================
Comment at: llvm/utils/TableGen/DAGISelMatcherEmitter.cpp:978
 
-static void BuildHistogram(const Matcher *M, std::vector<unsigned> &OpcodeFreq){
-  for (; M != nullptr; M = M->getNext()) {
----------------
foad wrote:
> Seems unrelated?
This part of the update eliminates the extra pass over the matcher tree just to count the matcher kinds for the histogram. The counting was merged into the new first pass for sizing.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91632/new/

https://reviews.llvm.org/D91632



More information about the llvm-commits mailing list