[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 27 11:42:29 PDT 2023


hiraditya updated this revision to Diff 517661.
hiraditya added a comment.
Herald added a subscriber: hoy.

clang-format


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,8 @@
   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.517661.patch
Type: text/x-patch
Size: 638 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230427/4593e5fe/attachment.bin>


More information about the llvm-commits mailing list