aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-03-01 07:43:08 +0000
committerChris Lattner <sabre@nondot.org>2010-03-01 07:43:08 +0000
commit7d892d6e6d451e9a0d0f9db839a943a256126c05 (patch)
tree778b43d9451f107f1a2b9f25558e8e2b93f8e96f /lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
parentbd8965a7d9e0ed34bc3a357c2f710de5fbdda36f (diff)
some trivial microoptimizations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97441 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index f1e6b960ee..03cbe22c0c 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -1760,7 +1760,7 @@ SelectCodeCommon(SDNode *NodeToMatch, const unsigned char *MatcherTable,
case OPC_SwitchOpcode: {
unsigned CurNodeOpcode = N.getOpcode();
- unsigned SwitchStart = MatcherIndex-1;
+ unsigned SwitchStart = MatcherIndex-1; (void)SwitchStart;
unsigned CaseSize;
while (1) {
@@ -2060,8 +2060,15 @@ SelectCodeCommon(SDNode *NodeToMatch, const unsigned char *MatcherTable,
if (EmitNodeInfo & OPFL_FlagOutput)
VTs.push_back(MVT::Flag);
- // FIXME: Use faster version for the common 'one VT' case?
- SDVTList VTList = CurDAG->getVTList(VTs.data(), VTs.size());
+ // This is hot code, so optimize the two most common cases of 1 and 2
+ // results.
+ SDVTList VTList;
+ if (VTs.size() == 1)
+ VTList = CurDAG->getVTList(VTs[0]);
+ else if (VTs.size() == 2)
+ VTList = CurDAG->getVTList(VTs[0], VTs[1]);
+ else
+ VTList = CurDAG->getVTList(VTs.data(), VTs.size());
// Get the operand list.
unsigned NumOps = MatcherTable[MatcherIndex++];