mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-19 04:29:21 +00:00
Switch promoted/expanded ops over to using a DenseMap. Vector related maps
aren't worth it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33860 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
414e37f9a3
commit
40030bfa75
@ -99,12 +99,12 @@ class VISIBILITY_HIDDEN SelectionDAGLegalize {
|
|||||||
/// PromotedNodes - For nodes that are below legal width, and that have more
|
/// PromotedNodes - For nodes that are below legal width, and that have more
|
||||||
/// than one use, this map indicates what promoted value to use. This allows
|
/// than one use, this map indicates what promoted value to use. This allows
|
||||||
/// us to avoid promoting the same thing more than once.
|
/// us to avoid promoting the same thing more than once.
|
||||||
std::map<SDOperand, SDOperand> PromotedNodes;
|
DenseMap<SDOperand, SDOperand> PromotedNodes;
|
||||||
|
|
||||||
/// ExpandedNodes - For nodes that need to be expanded this map indicates
|
/// ExpandedNodes - For nodes that need to be expanded this map indicates
|
||||||
/// which which operands are the expanded version of the input. This allows
|
/// which which operands are the expanded version of the input. This allows
|
||||||
/// us to avoid expanding the same node more than once.
|
/// us to avoid expanding the same node more than once.
|
||||||
std::map<SDOperand, std::pair<SDOperand, SDOperand> > ExpandedNodes;
|
DenseMap<SDOperand, std::pair<SDOperand, SDOperand> > ExpandedNodes;
|
||||||
|
|
||||||
/// SplitNodes - For vector nodes that need to be split, this map indicates
|
/// SplitNodes - For vector nodes that need to be split, this map indicates
|
||||||
/// which which operands are the split version of the input. This allows us
|
/// which which operands are the split version of the input. This allows us
|
||||||
@ -123,7 +123,7 @@ class VISIBILITY_HIDDEN SelectionDAGLegalize {
|
|||||||
LegalizedNodes.insert(std::make_pair(To, To));
|
LegalizedNodes.insert(std::make_pair(To, To));
|
||||||
}
|
}
|
||||||
void AddPromotedOperand(SDOperand From, SDOperand To) {
|
void AddPromotedOperand(SDOperand From, SDOperand To) {
|
||||||
bool isNew = PromotedNodes.insert(std::make_pair(From, To)).second;
|
bool isNew = PromotedNodes.insert(std::make_pair(From, To));
|
||||||
assert(isNew && "Got into the map somehow?");
|
assert(isNew && "Got into the map somehow?");
|
||||||
// If someone requests legalization of the new node, return itself.
|
// If someone requests legalization of the new node, return itself.
|
||||||
LegalizedNodes.insert(std::make_pair(To, To));
|
LegalizedNodes.insert(std::make_pair(To, To));
|
||||||
@ -3103,7 +3103,7 @@ SDOperand SelectionDAGLegalize::PromoteOp(SDOperand Op) {
|
|||||||
SDOperand Result;
|
SDOperand Result;
|
||||||
SDNode *Node = Op.Val;
|
SDNode *Node = Op.Val;
|
||||||
|
|
||||||
std::map<SDOperand, SDOperand>::iterator I = PromotedNodes.find(Op);
|
DenseMap<SDOperand, SDOperand>::iterator I = PromotedNodes.find(Op);
|
||||||
if (I != PromotedNodes.end()) return I->second;
|
if (I != PromotedNodes.end()) return I->second;
|
||||||
|
|
||||||
switch (Node->getOpcode()) {
|
switch (Node->getOpcode()) {
|
||||||
@ -4584,7 +4584,7 @@ void SelectionDAGLegalize::ExpandOp(SDOperand Op, SDOperand &Lo, SDOperand &Hi){
|
|||||||
"Cannot expand to FP value or to larger int value!");
|
"Cannot expand to FP value or to larger int value!");
|
||||||
|
|
||||||
// See if we already expanded it.
|
// See if we already expanded it.
|
||||||
std::map<SDOperand, std::pair<SDOperand, SDOperand> >::iterator I
|
DenseMap<SDOperand, std::pair<SDOperand, SDOperand> >::iterator I
|
||||||
= ExpandedNodes.find(Op);
|
= ExpandedNodes.find(Op);
|
||||||
if (I != ExpandedNodes.end()) {
|
if (I != ExpandedNodes.end()) {
|
||||||
Lo = I->second.first;
|
Lo = I->second.first;
|
||||||
@ -5268,8 +5268,7 @@ void SelectionDAGLegalize::ExpandOp(SDOperand Op, SDOperand &Lo, SDOperand &Hi){
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Remember in a map if the values will be reused later.
|
// Remember in a map if the values will be reused later.
|
||||||
bool isNew =
|
bool isNew = ExpandedNodes.insert(std::make_pair(Op, std::make_pair(Lo, Hi)));
|
||||||
ExpandedNodes.insert(std::make_pair(Op, std::make_pair(Lo, Hi))).second;
|
|
||||||
assert(isNew && "Value already expanded?!?");
|
assert(isNew && "Value already expanded?!?");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5396,7 +5395,7 @@ void SelectionDAGLegalize::SplitVectorOp(SDOperand Op, SDOperand &Lo,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Remember in a map if the values will be reused later.
|
// Remember in a map if the values will be reused later.
|
||||||
bool isNew =
|
bool isNew =
|
||||||
SplitNodes.insert(std::make_pair(Op, std::make_pair(Lo, Hi))).second;
|
SplitNodes.insert(std::make_pair(Op, std::make_pair(Lo, Hi))).second;
|
||||||
assert(isNew && "Value already expanded?!?");
|
assert(isNew && "Value already expanded?!?");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user