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

Fix #86269: remove unused variable #86927

Merged
merged 2 commits into from
Mar 28, 2024

Conversation

Apochens
Copy link
Contributor

Remove the unused variable BI introduced in #86269.

@llvmbot
Copy link
Collaborator

llvmbot commented Mar 28, 2024

@llvm/pr-subscribers-debuginfo

@llvm/pr-subscribers-llvm-transforms

Author: Shan Huang (Apochens)

Changes

Remove the unused variable BI introduced in #86269.


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

1 Files Affected:

  • (modified) llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp (+1-1)
diff --git a/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp b/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp
index 34d39f3fe6dcac..10c92395b4777a 100644
--- a/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp
+++ b/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp
@@ -509,7 +509,7 @@ void TailRecursionEliminator::createTailRecurseLoopHeader(CallInst *CI) {
   BasicBlock *NewEntry = BasicBlock::Create(F.getContext(), "", &F, HeaderBB);
   NewEntry->takeName(HeaderBB);
   HeaderBB->setName("tailrecurse");
-  BranchInst *BI = BranchInst::Create(HeaderBB, NewEntry);
+  BranchInst::Create(HeaderBB, NewEntry);
   // If the new branch preserves the debug location of CI, it could result in
   // misleading stepping, if CI is located in a conditional branch.
   // So, here we don't give any debug location to BI.

@@ -509,7 +509,7 @@ void TailRecursionEliminator::createTailRecurseLoopHeader(CallInst *CI) {
BasicBlock *NewEntry = BasicBlock::Create(F.getContext(), "", &F, HeaderBB);
NewEntry->takeName(HeaderBB);
HeaderBB->setName("tailrecurse");
BranchInst *BI = BranchInst::Create(HeaderBB, NewEntry);
BranchInst::Create(HeaderBB, NewEntry);
// If the new branch preserves the debug location of CI, it could result in
// misleading stepping, if CI is located in a conditional branch.
// So, here we don't give any debug location to BI.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since there is no "BI" variable anymore it's confusing to reference it in the comment.
Perhaps change "BI" to "the new branch"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Refinement is committed.

Copy link
Collaborator

@mikaelholmen mikaelholmen left a comment

Choose a reason for hiding this comment

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

LGTM

@Apochens
Copy link
Contributor Author

Please help in merging this PR if it's ready, cause I don't have the permission. Thanks!

@mikaelholmen mikaelholmen merged commit 8963a47 into llvm:main Mar 28, 2024
3 of 4 checks passed
@Apochens Apochens deleted the #86262_drop_debugloc_of_entry_branch branch March 28, 2024 10:24
@mikaelholmen
Copy link
Collaborator

Please help in merging this PR if it's ready, cause I don't have the permission. Thanks!

Done. Thanks :)

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

4 participants