[llvm] [Attributor][FIX] Register right new created BB. (PR #84929)

via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 12 18:32:21 PDT 2024


https://github.com/lcvon007 updated https://github.com/llvm/llvm-project/pull/84929

>From d84ab1069e23ba514f259eceac76f6c6096aca3b Mon Sep 17 00:00:00 2001
From: laichunfeng <laichunfeng at tencent.com>
Date: Tue, 12 Mar 2024 23:04:55 +0800
Subject: [PATCH] [Attributor][FIX] Register right new created BB.

CBBB will keep same after the first iteration, so
registerManifestAddedBasicBlock would always register the same
basic block later.
---
 llvm/lib/Transforms/IPO/AttributorAttributes.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/lib/Transforms/IPO/AttributorAttributes.cpp b/llvm/lib/Transforms/IPO/AttributorAttributes.cpp
index 488a6f0bb153a4..f98833bd119891 100644
--- a/llvm/lib/Transforms/IPO/AttributorAttributes.cpp
+++ b/llvm/lib/Transforms/IPO/AttributorAttributes.cpp
@@ -12371,7 +12371,7 @@ struct AAIndirectCallInfoCallSite : public AAIndirectCallInfo {
           SplitBlockAndInsertIfThen(LastCmp, IP, /* Unreachable */ false);
       BasicBlock *CBBB = CB->getParent();
       A.registerManifestAddedBasicBlock(*ThenTI->getParent());
-      A.registerManifestAddedBasicBlock(*CBBB);
+      A.registerManifestAddedBasicBlock(*IP->getParent());
       auto *SplitTI = cast<BranchInst>(LastCmp->getNextNode());
       BasicBlock *ElseBB;
       if (&*IP == CB) {



More information about the llvm-commits mailing list