diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp index e61480d7542d7..3d6b72e5775bd 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp @@ -1500,10 +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 Args; - Args.reserve(CI.arg_size()); - for (Value *Op : CI.args()) - Args.push_back(Op); + SmallVector Args(CI.args()); if (Value *V = simplifyCall(&CI, CI.getCalledOperand(), Args, SQ.getWithInstruction(&CI))) return replaceInstUsesWith(CI, V);