[PATCH] D21291: [SimplifyCFG] Range reduce switches

Hans Wennborg via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 20 09:57:01 PDT 2016


hans added a subscriber: hans.

================
Comment at: lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:1971
@@ +1970,3 @@
+    //
+    //   Idx = rotr(Sub, Shift)
+    //
----------------
I was going to comment that the code in the patch summary could use rotation instead, but it seems you're already on it :-)

================
Comment at: lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:8434
@@ -8358,3 +8433,3 @@
       // Try building a partition from Clusters[i..j].
       if (isDense(Clusters, &TotalCases[0], i, j, MinDensity)) {
         unsigned NumPartitions = 1 + (j == N - 1 ? 0 : MinPartitions[j + 1]);
----------------
This code doesn't take into account that a range of cases could be transformed to become dense, so I'm not sure your patch will actually find any more jump table lowerings that don't cover the whole switch?


Repository:
  rL LLVM

http://reviews.llvm.org/D21291





More information about the llvm-commits mailing list