Skip to content
Merged
Changes from all commits
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
2 changes: 1 addition & 1 deletion llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1500,7 +1500,7 @@ Instruction *InstCombinerImpl::visitCallInst(CallInst &CI) {
// Don't try to simplify calls without uses. It will not do anything useful,
// but will result in the following folds being skipped.
if (!CI.use_empty()) {
SmallVector<Value *, 4> Args;
SmallVector<Value *, 8> Args;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can this be rewritten as

SmallVector<Value *, 8> Args(CI.arg_begin(), CI.arg_end());

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, thank you for bringing this up. It can actually be even shorter:

SmallVector<Value *, 8> Args(CI.args());

I'll post a follow-up PR.

Args.reserve(CI.arg_size());
for (Value *Op : CI.args())
Args.push_back(Op);
Expand Down