summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-04-28 06:02:19 +0000
committerChris Lattner <sabre@nondot.org>2008-04-28 06:02:19 +0000
commit8c7f5ad9686823d1db910ea0c31a5f7abd339d85 (patch)
treec1378c413e6a5c912d5c14837b122c3b7770e043 /llvm/lib/CodeGen/SelectionDAG
parent84836144d93016d3663a415d004a1cf05d17057d (diff)
downloadbcm5719-llvm-8c7f5ad9686823d1db910ea0c31a5f7abd339d85.tar.gz
bcm5719-llvm-8c7f5ad9686823d1db910ea0c31a5f7abd339d85.zip
switch RegsForValue::Regs to be a SmallVector to avoid
heap thrash on tiny (usually single-element) vectors. llvm-svn: 50335
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index d82f0d613a2..507b2d731a3 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -125,7 +125,7 @@ namespace {
/// Regs - This list holds the register (for legal and promoted values)
/// or register set (for expanded values) that the value should be assigned
/// to.
- std::vector<unsigned> Regs;
+ SmallVector<unsigned, 4> Regs;
/// RegVTs - The value types of the registers. This is the same size
/// as ValueVTs; every register contributing to a given value must
@@ -146,11 +146,11 @@ namespace {
unsigned Reg, MVT::ValueType regvt, MVT::ValueType valuevt)
: TLI(&tli), Regs(1, Reg), RegVTs(1, regvt), ValueVTs(1, valuevt) {}
RegsForValue(const TargetLowering &tli,
- const std::vector<unsigned> &regs,
+ const SmallVectorImpl<unsigned> &regs,
MVT::ValueType regvt, MVT::ValueType valuevt)
: TLI(&tli), Regs(regs), RegVTs(1, regvt), ValueVTs(1, valuevt) {}
RegsForValue(const TargetLowering &tli,
- const std::vector<unsigned> &regs,
+ const SmallVectorImpl<unsigned> &regs,
const SmallVector<MVT::ValueType, 4> &regvts,
const SmallVector<MVT::ValueType, 4> &valuevts)
: TLI(&tli), Regs(regs), RegVTs(regvts), ValueVTs(valuevts) {}
@@ -3600,7 +3600,7 @@ GetRegistersForValue(SDISelAsmOperandInfo &OpInfo, bool HasEarlyClobber,
MachineFunction &MF = DAG.getMachineFunction();
- std::vector<unsigned> Regs;
+ SmallVector<unsigned, 8> Regs;
// If this is a constraint for a single physreg, or a constraint for a
// register class, find it.
OpenPOWER on IntegriCloud