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

[ArgPromotion] Consider InvokeInst in Caller alias analysis #110335

Merged
merged 2 commits into from
Oct 4, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -491,10 +491,8 @@ static bool isArgUnmodifiedByAllCalls(Argument *Arg,
FunctionAnalysisManager &FAM) {
for (User *U : Arg->getParent()->users()) {

// Bail if we find an unexpected (non CallInst) use of the function.
auto *Call = dyn_cast<CallInst>(U);
if (!Call)
return false;
assert(isa<CallBase>(U) && "Expected all users of Function to be CallBase");
CallBase *Call = cast<CallBase>(U);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
assert(isa<CallBase>(U) && "Expected all users of Function to be CallBase");
CallBase *Call = cast<CallBase>(U);
auto *Call = cast<CallBase>(U);

cast performs an implicit isa assert.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice - updated to remove the superfluous assert(), and added some tests for invoke instructions.


MemoryLocation Loc =
MemoryLocation::getForArgument(Call, Arg->getArgNo(), nullptr);
Expand Down
Loading