From 49eadda15f9ff82980eb9d0b93b8815b51cfbe8f Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Sat, 27 Jul 2024 23:29:29 -0700 Subject: [PATCH] [InstCombine] Use more inline elements in a SmallVector The 4 inline elements only cover 58% of cases encountered here during the compilation of X86ISelLowering.cpp.ll, a .ll version of X86ISelLowering.cpp. The 8 inline elements cover 96% and save 0.27% of heap allocations. --- llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp index f6c4b6e180937..e61480d7542d7 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp @@ -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 Args; + SmallVector Args; Args.reserve(CI.arg_size()); for (Value *Op : CI.args()) Args.push_back(Op);