[PATCH] D21291: [SimplifyCFG] Range reduce switches

James Molloy via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 13 09:17:02 PDT 2016


jmolloy added inline comments.

================
Comment at: lib/Transforms/Utils/SimplifyCFG.cpp:4993
@@ +4992,3 @@
+  bool HasHoles = Values.back() != SI->getNumCases() - 1;
+  if (!HasHoles)
+    // This switch is already dense.
----------------
This should be @test3

================
Comment at: lib/Transforms/Utils/SimplifyCFG.cpp:5009
@@ +5008,3 @@
+      // The switch still has a hole.
+      return false;
+  
----------------
Uhhhhh, yes. Yes it should. Thanks for spotting this!

I've rewritten the code entirely.


Repository:
  rL LLVM

http://reviews.llvm.org/D21291





More information about the llvm-commits mailing list