[PATCH] D158609: [IR] Treat callbr as special terminator (PR64215)

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 24 05:59:15 PDT 2023


nikic added inline comments.


================
Comment at: llvm/lib/Transforms/Coroutines/CoroElide.cpp:230
     if (TIs.count(BB)) {
-      if (!BB->getTerminator()->isExceptionalTerminator() || PotentiallyEscaped)
+      if (isa<ReturnInst>(BB->getTerminator()) || PotentiallyEscaped)
         return true;
----------------
Context for this change: `TIs` contains "terminators" that have no successors and are not unreachable. The only such terminator are ret, resume, and (sometimes) cleanupret. The isExceptionalTerminator check excludes resume and cleanupret, so we are left with just ret.

If found it more obvious to just spell that out, because the isExceptionalTerminator check was a bit overly vague here (e.g. things like invoke are not relevant at all).


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

https://reviews.llvm.org/D158609



More information about the llvm-commits mailing list