[PATCH] D25212: Moderate the number of jump tables

Hans Wennborg via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 21 12:59:35 PDT 2016


hans added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:8489
+  enum PartitionScoreEnum : unsigned {
+    None = 0,
+    Table = 1,
----------------
evandro wrote:
> hans wrote:
> > Hmm, "None" doesn't seem like a great name. Maybe "Default" is better?
> > 
> > This would be used for partitions that are too small to be a table, but not small enough to get a better score. I'm not sure what to name that though..
> > 
> > How about something like:
> > 
> > NoTable = 0
> > FewCases = 1
> > Table = 2
> > SingleCase = 2
> OK, but my understanding is that a few cases are as good as a table.
Sorry, I must have slipped while typing :-) I meant FewCases and Table would be = 1, and SingleCase = 2.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:8509
     // Search for a solution that results in fewer partitions.
-    for (int64_t j = N - 1; j > i; j--) {
+    for (int64_t j = N - 1; j >= i; j--) {
       // Try building a partition from Clusters[i..j].
----------------
evandro wrote:
> hans wrote:
> > Why change > to >= here?
> Otherwise single case partitions will not be considered.
But the code is considering it above, under "Baseline: Put Clusters[i] into a partition on its own."


Repository:
  rL LLVM

https://reviews.llvm.org/D25212





More information about the llvm-commits mailing list