Skip to content

Commit

Permalink
MCInst: decrease inline element count to 6. NFC
Browse files Browse the repository at this point in the history
MCInst is primarily used in local variables and MCRelaxableFragment
(mostly JMP/JCC for x86). Reducing the inline element count can make
MCRelaxableFragment smaller, potentially leading to a lower peak RSS.

When compiling sqlite3.c, x86-64 has the largest maximum numOperands.

aarch64: 5; ppc64: 6; riscv64: 3; s390x: 6; x86-64: 8

Here is the frequency table for x86-64:

max getNumOperands: 8
0: 676
1: 37892
2: 84046
3: 26767
4: 1640
5: 1222
6: 80794
7: 768
8: 22

Pull Request: #94913
  • Loading branch information
MaskRay authored Jun 9, 2024
1 parent 54373e0 commit acf6721
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion llvm/include/llvm/MC/MCInst.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ class MCInst {
unsigned Flags = 0;

SMLoc Loc;
SmallVector<MCOperand, 10> Operands;
SmallVector<MCOperand, 6> Operands;

public:
MCInst() = default;
Expand Down

0 comments on commit acf6721

Please sign in to comment.