Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Attributor][FIX] Register right new created BB. #84929

Merged
merged 1 commit into from
Mar 13, 2024

Conversation

lcvon007
Copy link
Contributor

@lcvon007 lcvon007 commented Mar 12, 2024

CBBB will keep same after the first iteration so registerManifestAddedBasicBlock would always register the same basic block later.

@llvmbot
Copy link
Collaborator

llvmbot commented Mar 12, 2024

@llvm/pr-subscribers-llvm-transforms

Author: None (lcvon007)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/84929.diff

1 Files Affected:

  • (modified) llvm/lib/Transforms/IPO/AttributorAttributes.cpp (+1-1)
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) {

@lcvon007 lcvon007 requested a review from jdoerfert March 12, 2024 15:18
Copy link
Contributor

@shiltian shiltian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG. No tests need to be updated?

@lcvon007
Copy link
Contributor Author

lcvon007 commented Mar 13, 2024

LG. No tests need to be updated?

yes, it doesn't affect the testcase. Your approval is removed by mistake by me, and please help give an approval again if it's easy to do it, thank you very much. @shiltian

CBBB will keep same after the first iteration, so
registerManifestAddedBasicBlock would always register the same
basic block later.
@lcvon007 lcvon007 requested a review from shiltian March 13, 2024 08:31
@lcvon007 lcvon007 merged commit 676c495 into llvm:main Mar 13, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants