[PATCH] D21291: [SimplifyCFG] Range reduce switches

Sanjoy Das via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 13 09:51:59 PDT 2016


sanjoy added inline comments.

================
Comment at: lib/Transforms/Utils/SimplifyCFG.cpp:4992
@@ +4991,3 @@
+
+  bool HasHoles = Values.back() != SI->getNumCases() - 1;
+  if (!HasHoles)
----------------
sanjoy wrote:
> How about `{-2, 0, 2, 4}`?  That's sparse and can benefit from this pass, but here you'll conclude that it has no holes.
Bad example, I meant cases like `{-3, -1, 1, 3}`.


Repository:
  rL LLVM

http://reviews.llvm.org/D21291





More information about the llvm-commits mailing list