[PATCH] D21291: [SimplifyCFG] Range reduce switches

Hans Wennborg via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 20 10:30:53 PDT 2016


hans added inline comments.

================
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]);
----------------
hans wrote:
> 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?
I guess what I was saying with this comment is that since you're not going to get the benefit of transforming parts of the switch, it there a point in doing this in the DAG instead of in the IR? I think the rotation trick should work in the IR too..


Repository:
  rL LLVM

http://reviews.llvm.org/D21291





More information about the llvm-commits mailing list