if (value == refVal)
return;
if (value)
- value->uses.remove(this);
+ value->uses.erase(this);
if (refVal)
- refVal->uses.push_back(this);
+ refVal->uses.insert(this);
value = refVal;
}
return;
while (!value->uses.empty()) {
- ValueRef *ref = value->uses.front();
+ ValueRef *ref = *value->uses.begin();
ref->set(repVal.get());
ref->mod *= repVal.mod;
}
#include <deque>
#include <list>
#include <vector>
+#include <tr1/unordered_set>
#include "codegen/nv50_ir_util.h"
#include "codegen/nv50_ir_graph.h"
static inline Value *get(Iterator&);
- std::list<ValueRef *> uses;
+ std::tr1::unordered_set<ValueRef *> uses;
std::list<ValueDef *> defs;
- typedef std::list<ValueRef *>::iterator UseIterator;
- typedef std::list<ValueRef *>::const_iterator UseCIterator;
+ typedef std::tr1::unordered_set<ValueRef *>::iterator UseIterator;
+ typedef std::tr1::unordered_set<ValueRef *>::const_iterator UseCIterator;
typedef std::list<ValueDef *>::iterator DefIterator;
typedef std::list<ValueDef *>::const_iterator DefCIterator;
// b = mul a, imm
// d = mul b, c -> d = mul_x_imm a, c
int s2, t2;
- insn = mul2->getDef(0)->uses.front()->getInsn();
+ insn = (*mul2->getDef(0)->uses.begin())->getInsn();
if (!insn)
return;
mul1 = mul2;
break;
i = NULL;
if (!insn->getDef(0)->uses.empty())
- i = insn->getDef(0)->uses.front()->getInsn();
+ i = (*insn->getDef(0)->uses.begin())->getInsn();
// if this is a contraint-move there will only be a single use
if (i && i->op == OP_MERGE) // do we really still need this ?
break;
// Unspill at each use *before* inserting spill instructions,
// we don't want to have the spill instructions in the use list here.
while (!dval->uses.empty()) {
- ValueRef *u = dval->uses.front();
+ ValueRef *u = *dval->uses.begin();
Instruction *usei = u->getInsn();
assert(usei);
if (usei->isPseudo()) {