[PATCH] D105672: [SimpleLoopUnswitch] Don't non-trivially unswitch loops with catchswitch exits

David Majnemer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 8 19:21:02 PDT 2021


majnemer requested changes to this revision.
majnemer added inline comments.
This revision now requires changes to proceed.


================
Comment at: llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp:2778-2784
+  // We cannot unswitch if exit blocks contain a cleanuppad/catchswitch
+  // instruction as we don't know how to split those exit blocks.
   // FIXME: We should teach SplitBlock to handle this and remove this
   // restriction.
   for (auto *ExitBB : ExitBlocks) {
-    if (isa<CleanupPadInst>(ExitBB->getFirstNonPHI())) {
-      LLVM_DEBUG(
-          dbgs() << "Cannot unswitch because of cleanuppad in exit block\n");
+    auto *I = ExitBB->getFirstNonPHI();
+    if (isa<CleanupPadInst>(I) || isa<CatchSwitchInst>(I)) {
----------------
Why is splitting a block with a cleanuppad different from a block with a landingpad?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D105672/new/

https://reviews.llvm.org/D105672



More information about the llvm-commits mailing list