[PATCH] D11953: [LowerSwitch] Skip dead blocks for processSwitchInst()

Hans Wennborg via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 11 12:40:22 PDT 2015


hans added inline comments.

================
Comment at: lib/Transforms/Utils/LowerSwitch.cpp:127
@@ +126,3 @@
+    // In either case, skip it and don't waste time processing it.
+    if (Cur != &F.getEntryBlock() && pred_begin(Cur) == pred_end(Cur)) {
+      continue;
----------------
Seems we're ending up with both the DeleteList and checking for dead blocks in the loop? It would be nice if we only had to check in one place.

Perhaps one solution would be to make DeleteList a SmallPtrSet instead, and in the loop we could do "if (DeleteSet.contains(Cur)) continue;"


http://reviews.llvm.org/D11953





More information about the llvm-commits mailing list