From 3737942efbb800228342b72746b090658e96077c Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Sun, 28 Jul 2024 13:44:27 -0700 Subject: [PATCH] [InstCombine] Initialize a SmallVector with a range (NFC) --- llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) 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);