summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-09-02 20:32:45 +0000
committerChris Lattner <sabre@nondot.org>2005-09-02 20:32:45 +0000
commit1a570f1fe4cacc29bdc43f892c1c72fe6277fa90 (patch)
tree5f90246a6dbc01b871d817e77c9a3b0226365004 /llvm/lib/CodeGen
parent630226697fb79f21640dafac65a562453de63e72 (diff)
downloadbcm5719-llvm-1a570f1fe4cacc29bdc43f892c1c72fe6277fa90.tar.gz
bcm5719-llvm-1a570f1fe4cacc29bdc43f892c1c72fe6277fa90.zip
Clean up some code from the last checkin
llvm-svn: 23229
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp36
1 files changed, 12 insertions, 24 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
index 34048f8a4b6..55dcbd9ffdd 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
@@ -1996,12 +1996,8 @@ SDOperand SelectionDAGLegalize::PromoteOp(SDOperand Op) {
SDOperand Result;
SDNode *Node = Op.Val;
- if (1 || !Node->hasOneUse()) {
- std::map<SDOperand, SDOperand>::iterator I = PromotedNodes.find(Op);
- if (I != PromotedNodes.end()) return I->second;
- } else {
- assert(!PromotedNodes.count(Op) && "Repromoted this node??");
- }
+ std::map<SDOperand, SDOperand>::iterator I = PromotedNodes.find(Op);
+ if (I != PromotedNodes.end()) return I->second;
// 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
@@ -2845,19 +2841,13 @@ void SelectionDAGLegalize::ExpandOp(SDOperand Op, SDOperand &Lo, SDOperand &Hi){
assert(MVT::isInteger(NVT) && NVT < VT &&
"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.
- // There is no use remembering values that only have a single use, as the map
- // entries will never be reused.
- if (1 || !Node->hasOneUse()) {
- std::map<SDOperand, std::pair<SDOperand, SDOperand> >::iterator I
- = ExpandedNodes.find(Op);
- if (I != ExpandedNodes.end()) {
- Lo = I->second.first;
- Hi = I->second.second;
- return;
- }
- } else {
- assert(!ExpandedNodes.count(Op) && "Re-expanding a node!");
+ // See if we already expanded it.
+ std::map<SDOperand, std::pair<SDOperand, SDOperand> >::iterator I
+ = ExpandedNodes.find(Op);
+ if (I != ExpandedNodes.end()) {
+ Lo = I->second.first;
+ Hi = I->second.second;
+ return;
}
// 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.
- if (1 || !Node->hasOneUse()) {
- bool isNew = ExpandedNodes.insert(std::make_pair(Op,
- std::make_pair(Lo, Hi))).second;
- assert(isNew && "Value already expanded?!?");
- }
+ bool isNew = ExpandedNodes.insert(std::make_pair(Op,
+ std::make_pair(Lo, Hi))).second;
+ assert(isNew && "Value already expanded?!?");
}
OpenPOWER on IntegriCloud