[PATCH] D25212: Moderate the number of jump tables

Evandro Menezes via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 21 12:54:29 PDT 2016


evandro marked 8 inline comments as done.
evandro added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:8489
+  enum PartitionScoreEnum : unsigned {
+    None = 0,
+    Table = 1,
----------------
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.


================
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].
----------------
hans wrote:
> Why change > to >= here?
Otherwise single case partitions will not be considered.


Repository:
  rL LLVM

https://reviews.llvm.org/D25212





More information about the llvm-commits mailing list