[PATCH] D64404: [SimpleLoopUnswitch] Don't consider unswitching `switch` insructions with one unique successor

Serguei Katkov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 9 22:49:47 PDT 2019


skatkov accepted this revision.
skatkov added inline comments.
This revision is now accepted and ready to land.


================
Comment at: llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp:2552
     if (auto *SI = dyn_cast<SwitchInst>(BB->getTerminator())) {
+      const bool HasAtLeastTwoSuccessors = BB->getUniqueSuccessor() == nullptr;
       // We can only consider fully loop-invariant switch conditions as we need
----------------
Do you really need "== nullptr"?


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

https://reviews.llvm.org/D64404





More information about the llvm-commits mailing list