[llvm] a17f8fe - [InstCombine] Use more inline elements in a SmallVector (#100942)
via llvm-commits
llvm-commits at lists.llvm.org
Sun Jul 28 13:19:47 PDT 2024
Author: Kazu Hirata
Date: 2024-07-28T13:19:44-07:00
New Revision: a17f8fe7d46e1708331df2dec733203de356b0cf
URL: https://github.com/llvm/llvm-project/commit/a17f8fe7d46e1708331df2dec733203de356b0cf
DIFF: https://github.com/llvm/llvm-project/commit/a17f8fe7d46e1708331df2dec733203de356b0cf.diff
LOG: [InstCombine] Use more inline elements in a SmallVector (#100942)
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.
Added:
Modified:
llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
Removed:
################################################################################
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<Value *, 4> Args;
+ SmallVector<Value *, 8> Args;
Args.reserve(CI.arg_size());
for (Value *Op : CI.args())
Args.push_back(Op);
More information about the llvm-commits
mailing list