Skip to content
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