-
Notifications
You must be signed in to change notification settings - Fork 13.4k
ObjCARC: Drop pointer bitcast handling #134274
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
Merged
arsenm
merged 1 commit into
main
from
users/arsenm/objc-arc-drop-pointer-bitcast-handling
Apr 8, 2025
Merged
ObjCARC: Drop pointer bitcast handling #134274
arsenm
merged 1 commit into
main
from
users/arsenm/objc-arc-drop-pointer-bitcast-handling
Apr 8, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@llvm/pr-subscribers-llvm-transforms Author: Matt Arsenault (arsenm) ChangesThere is more in the file to drop, but this looks like the easier Full diff: https://github.com/llvm/llvm-project/pull/134274.diff 1 Files Affected:
diff --git a/llvm/lib/Transforms/ObjCARC/ObjCARCContract.cpp b/llvm/lib/Transforms/ObjCARC/ObjCARCContract.cpp
index 311d3b1cfc0a0..e11748b2c9dbb 100644
--- a/llvm/lib/Transforms/ObjCARC/ObjCARCContract.cpp
+++ b/llvm/lib/Transforms/ObjCARC/ObjCARCContract.cpp
@@ -660,7 +660,6 @@ bool ObjCARCContract::run(Function &F, AAResults *A, DominatorTree *D) {
};
Value *Arg = cast<CallInst>(Inst)->getArgOperand(0);
- Value *OrigArg = Arg;
// TODO: Change this to a do-while.
for (;;) {
@@ -687,24 +686,6 @@ bool ObjCARCContract::run(Function &F, AAResults *A, DominatorTree *D) {
break;
}
}
-
- // Replace bitcast users of Arg that are dominated by Inst.
- SmallVector<BitCastInst *, 2> BitCastUsers;
-
- // Add all bitcast users of the function argument first.
- for (User *U : OrigArg->users())
- if (auto *BC = dyn_cast<BitCastInst>(U))
- BitCastUsers.push_back(BC);
-
- // Replace the bitcasts with the call return. Iterate until list is empty.
- while (!BitCastUsers.empty()) {
- auto *BC = BitCastUsers.pop_back_val();
- for (User *U : BC->users())
- if (auto *B = dyn_cast<BitCastInst>(U))
- BitCastUsers.push_back(B);
-
- ReplaceArgUses(BC);
- }
}
// If this function has no escaping allocas or suspicious vararg usage,
|
There is more in the file to drop, but this looks like the easier part.
14866ad
to
f0c5f77
Compare
This was referenced Apr 7, 2025
fhahn
approved these changes
Apr 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There is more in the file to drop, but this looks like the easier
part.