[llvm] 8ed1291 - [MachineCopyPropagation] Make a SmallVector larger (NFC) (#79106)

via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 23 09:27:22 PST 2024


Author: Kazu Hirata
Date: 2024-01-23T09:27:18-08:00
New Revision: 8ed1291d96eaf230ce289c9e62d28df3851d4372

URL: https://github.com/llvm/llvm-project/commit/8ed1291d96eaf230ce289c9e62d28df3851d4372
DIFF: https://github.com/llvm/llvm-project/commit/8ed1291d96eaf230ce289c9e62d28df3851d4372.diff

LOG: [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.

Added: 
    

Modified: 
    llvm/lib/CodeGen/MachineCopyPropagation.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/MachineCopyPropagation.cpp b/llvm/lib/CodeGen/MachineCopyPropagation.cpp
index 51e944d0279f27..9a0ab300b21b7a 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())


        


More information about the llvm-commits mailing list