aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2024-01-23 09:27:18 -0800
committerGitHub <noreply@github.com>2024-01-23 09:27:18 -0800
commit8ed1291d96eaf230ce289c9e62d28df3851d4372 (patch)
treeccf4aca75865dd3711ccffe66b61c439f633a05b
parent2531a15dfd4eafda21622e3a828a93fc9a27e3b6 (diff)
downloadllvm-8ed1291d96eaf230ce289c9e62d28df3851d4372.zip
llvm-8ed1291d96eaf230ce289c9e62d28df3851d4372.tar.gz
llvm-8ed1291d96eaf230ce289c9e62d28df3851d4372.tar.bz2
[MachineCopyPropagation] Make a SmallVector larger (NFC) (#79106)
This patch makes a SmallVector slightly larger. We encounter quite a few instructions with 3 or 4 defs but very few beyond that on X86. This saves 0.39% of heap allocations during the compilation of a large preprocessed file, namely X86ISelLowering.cpp, for the X86 target.
-rw-r--r--llvm/lib/CodeGen/MachineCopyPropagation.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MachineCopyPropagation.cpp b/llvm/lib/CodeGen/MachineCopyPropagation.cpp
index 51e944d..9a0ab30 100644
--- a/llvm/lib/CodeGen/MachineCopyPropagation.cpp
+++ b/llvm/lib/CodeGen/MachineCopyPropagation.cpp
@@ -853,7 +853,7 @@ void MachineCopyPropagation::ForwardCopyPropagateBlock(MachineBasicBlock &MBB) {
forwardUses(MI);
// Not a copy.
- SmallVector<Register, 2> Defs;
+ SmallVector<Register, 4> Defs;
const MachineOperand *RegMask = nullptr;
for (const MachineOperand &MO : MI.operands()) {
if (MO.isRegMask())