X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FCodeGen%2FSelectionDAG%2FSelectionDAG.cpp;h=db315380865225503ccabf052ac10dcf0062ba2c;hb=dddc6291fb5274282a20d5923b50535d456d34a4;hp=fc70c19ff6d2bb980304496116c09bb0db3524bd;hpb=1ea58a52a4296afff10e9db1e54928f38e6d74c6;p=oota-llvm.git diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index fc70c19ff6d..db315380865 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -3749,7 +3749,6 @@ void SDNode::MorphNodeTo(unsigned Opc, SDVTList L, OperandList[i].setUser(this); SDNode *N = OperandList[i].getVal(); N->addUser(i, this); - ++N->UsesSize; DeadNodeSet.erase(N); } @@ -4394,18 +4393,9 @@ const MVT *SDNode::getValueTypeList(MVT VT) { bool SDNode::hasNUsesOfValue(unsigned NUses, unsigned Value) const { assert(Value < getNumValues() && "Bad value!"); - // If there is only one value, this is easy. - if (getNumValues() == 1) - return use_size() == NUses; - if (use_size() < NUses) return false; - - SDOperand TheValue(const_cast(this), Value); - - SmallPtrSet UsersHandled; - // TODO: Only iterate over uses of a given value of the node for (SDNode::use_iterator UI = use_begin(), E = use_end(); UI != E; ++UI) { - if (*UI == TheValue) { + if (UI->getSDOperand().ResNo == Value) { if (NUses == 0) return false; --NUses; @@ -4422,21 +4412,9 @@ bool SDNode::hasNUsesOfValue(unsigned NUses, unsigned Value) const { bool SDNode::hasAnyUseOfValue(unsigned Value) const { assert(Value < getNumValues() && "Bad value!"); - if (use_empty()) return false; - - SDOperand TheValue(const_cast(this), Value); - - SmallPtrSet UsersHandled; - - for (SDNode::use_iterator UI = use_begin(), E = use_end(); UI != E; ++UI) { - SDNode *User = UI->getUser(); - if (User->getNumOperands() == 1 || - UsersHandled.insert(User)) // First time we've seen this? - for (unsigned i = 0, e = User->getNumOperands(); i != e; ++i) - if (User->getOperand(i) == TheValue) { - return true; - } - } + for (SDNode::use_iterator UI = use_begin(), E = use_end(); UI != E; ++UI) + if (UI->getSDOperand().ResNo == Value) + return true; return false; } @@ -4848,7 +4826,7 @@ void SDNode::dump(const SelectionDAG *G) const { } if (const ConstantSDNode *CSDN = dyn_cast(this)) { - cerr << "<" << CSDN->getValue() << ">"; + cerr << "<" << CSDN->getAPIntValue().toStringUnsigned() << ">"; } else if (const ConstantFPSDNode *CSDN = dyn_cast(this)) { if (&CSDN->getValueAPF().getSemantics()==&APFloat::IEEEsingle) cerr << "<" << CSDN->getValueAPF().convertToFloat() << ">";