[PATCH] D152052: Skip deadblocks in cycle saving computation

Mingming Liu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 2 20:51:30 PDT 2023


mingmingl created this revision.
Herald added subscribers: ChuanqiXu, haicheng, hiraditya.
Herald added a project: All.
mingmingl requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D152052

Files:
  llvm/lib/Analysis/InlineCost.cpp


Index: llvm/lib/Analysis/InlineCost.cpp
===================================================================
--- llvm/lib/Analysis/InlineCost.cpp
+++ llvm/lib/Analysis/InlineCost.cpp
@@ -844,6 +844,9 @@
     APInt CycleSavings(128, 0);
 
     for (auto &BB : F) {
+      // Skip dead blocks since they are going to be simplified away.
+      if (DeadBlocks.count(&BB))
+       continue;
       APInt CurrentSavings(128, 0);
       for (auto &I : BB) {
         if (BranchInst *BI = dyn_cast<BranchInst>(&I)) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D152052.528070.patch
Type: text/x-patch
Size: 509 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230603/2aea4c3d/attachment.bin>


More information about the llvm-commits mailing list