Clean up some code from the last checkin

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23229 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2005-09-02 20:32:45 +00:00
parent 99c25b86aa
commit 6fdcb250d5

View File

@ -1996,12 +1996,8 @@ SDOperand SelectionDAGLegalize::PromoteOp(SDOperand Op) {
SDOperand Result; SDOperand Result;
SDNode *Node = Op.Val; SDNode *Node = Op.Val;
if (1 || !Node->hasOneUse()) { std::map<SDOperand, SDOperand>::iterator I = PromotedNodes.find(Op);
std::map<SDOperand, SDOperand>::iterator I = PromotedNodes.find(Op); if (I != PromotedNodes.end()) return I->second;
if (I != PromotedNodes.end()) return I->second;
} else {
assert(!PromotedNodes.count(Op) && "Repromoted this node??");
}
// Promotion needs an optimization step to clean up after it, and is not // Promotion needs an optimization step to clean up after it, and is not
// careful to avoid operations the target does not support. Make sure that // careful to avoid operations the target does not support. Make sure that
@ -2845,19 +2841,13 @@ void SelectionDAGLegalize::ExpandOp(SDOperand Op, SDOperand &Lo, SDOperand &Hi){
assert(MVT::isInteger(NVT) && NVT < VT && assert(MVT::isInteger(NVT) && NVT < VT &&
"Cannot expand to FP value or to larger int value!"); "Cannot expand to FP value or to larger int value!");
// If there is more than one use of this, see if we already expanded it. // See if we already expanded it.
// There is no use remembering values that only have a single use, as the map std::map<SDOperand, std::pair<SDOperand, SDOperand> >::iterator I
// entries will never be reused. = ExpandedNodes.find(Op);
if (1 || !Node->hasOneUse()) { if (I != ExpandedNodes.end()) {
std::map<SDOperand, std::pair<SDOperand, SDOperand> >::iterator I Lo = I->second.first;
= ExpandedNodes.find(Op); Hi = I->second.second;
if (I != ExpandedNodes.end()) { return;
Lo = I->second.first;
Hi = I->second.second;
return;
}
} else {
assert(!ExpandedNodes.count(Op) && "Re-expanding a node!");
} }
// Expanding to multiple registers needs to perform an optimization step, and // Expanding to multiple registers needs to perform an optimization step, and
@ -3262,11 +3252,9 @@ 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.
if (1 || !Node->hasOneUse()) { bool isNew = ExpandedNodes.insert(std::make_pair(Op,
bool isNew = ExpandedNodes.insert(std::make_pair(Op, std::make_pair(Lo, Hi))).second;
std::make_pair(Lo, Hi))).second; assert(isNew && "Value already expanded?!?");
assert(isNew && "Value already expanded?!?");
}
} }