[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
Chris Lattner
lattner at cs.uiuc.edu
Fri Sep 2 13:32:56 PDT 2005
Changes in directory llvm/lib/CodeGen/SelectionDAG:
LegalizeDAG.cpp updated: 1.184 -> 1.185
---
Log message:
Clean up some code from the last checkin
---
Diffs of the changes: (+12 -24)
LegalizeDAG.cpp | 36 ++++++++++++------------------------
1 files changed, 12 insertions(+), 24 deletions(-)
Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.184 llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.185
--- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.184 Fri Sep 2 15:26:58 2005
+++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Fri Sep 2 15:32:45 2005
@@ -1996,12 +1996,8 @@
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 @@
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 @@
}
// 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?!?");
}
More information about the llvm-commits
mailing list