[PATCH] D134490: [NFC] check for UnreachableInst first as it is cheaper compared to getTerminatingDeoptimizeCall

Aditya Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 6 15:02:09 PDT 2023


hiraditya updated this revision to Diff 511541.
hiraditya added a comment.

Fixed a typo and ran check-llvm


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

https://reviews.llvm.org/D134490

Files:
  llvm/lib/Transforms/Utils/BasicBlockUtils.cpp


Index: llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
===================================================================
--- llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
+++ llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
@@ -600,8 +600,7 @@
   unsigned Depth = 0;
   while (BB && Depth++ < MaxDeoptOrUnreachableSuccessorCheckDepth &&
          VisitedBlocks.insert(BB).second) {
-    if (BB->getTerminatingDeoptimizeCall() ||
-        isa<UnreachableInst>(BB->getTerminator()))
+    if (isa<UnreachableInst>(BB->getTerminator()) || BB->getTerminatingDeoptimizeCall())
       return true;
     BB = BB->getUniqueSuccessor();
   }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D134490.511541.patch
Type: text/x-patch
Size: 629 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230406/47a53f74/attachment.bin>


More information about the llvm-commits mailing list