Skip to content

Commit

Permalink
Use a SmallVector instead of std::vector for ResOperands.
Browse files Browse the repository at this point in the history
There's almost always a small number of instruction operands, so
use a SmallVector and save on heap allocations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155143 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
Jim Grosbach committed Apr 19, 2012
1 parent 8caecde commit b423d18
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions utils/TableGen/AsmMatcherEmitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ struct MatchableInfo {

/// ResOperands - This is the operand list that should be built for the result
/// MCInst.
std::vector<ResOperand> ResOperands;
SmallVector<ResOperand, 8> ResOperands;

/// AsmString - The assembly string for this instruction (with variants
/// removed), e.g. "movsx $src, $dst".
Expand All @@ -399,7 +399,7 @@ struct MatchableInfo {
/// annotated with a class and where in the OperandList they were defined.
/// This directly corresponds to the tokenized AsmString after the mnemonic is
/// removed.
SmallVector<AsmOperand, 4> AsmOperands;
SmallVector<AsmOperand, 8> AsmOperands;

/// Predicates - The required subtarget features to match this instruction.
SmallVector<SubtargetFeatureInfo*, 4> RequiredFeatures;
Expand Down

0 comments on commit b423d18

Please sign in to comment.