summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarol Herbst <kherbst@redhat.com>2020-01-15 20:37:27 +0100
committerMarge Bot <eric+marge@anholt.net>2020-06-22 12:29:49 +0000
commitb8c77d4765dcf347bb106ee446811b5df2f9f941 (patch)
treede9cd0fad4d6f99d6d56ab35e8aa67ff606501ed
parent361fb38662f80e645e9087781faa4bec10dd6ac7 (diff)
nv50/ir/ra: convert some for loops to Range-based for loops
I will touch them in the next commit Signed-off-by: Karol Herbst <kherbst@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5277>
-rw-r--r--src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp
index 4e5b21d9176..0cde9794efc 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp
@@ -954,9 +954,8 @@ GCRA::coalesceValues(Value *dst, Value *src, bool force)
rep->id, rep->reg.data.id, val->id);
// set join pointer of all values joined with val
- for (Value::DefIterator def = val->defs.begin(); def != val->defs.end();
- ++def)
- (*def)->get()->join = rep;
+ for (ValueDef *def : val->defs)
+ def->get()->join = rep;
assert(rep->join == rep && val->join == rep);
// add val's definitions to rep and extend the live interval of its RIG node
@@ -1261,10 +1260,8 @@ GCRA::calculateSpillWeights()
if (!val->noSpill) {
int rc = 0;
- for (Value::DefIterator it = val->defs.begin();
- it != val->defs.end();
- ++it)
- rc += (*it)->get()->refCount();
+ for (ValueDef *def : val->defs)
+ rc += def->get()->refCount();
nodes[i].weight =
(float)rc * (float)rc / (float)nodes[i].livei.extent();
@@ -1372,10 +1369,10 @@ GCRA::checkInterference(const RIG_Node *node, Graph::EdgeIterator& ei)
if (vA->compound | vB->compound) {
// NOTE: this only works for >aligned< register tuples !
- for (Value::DefCIterator D = vA->defs.begin(); D != vA->defs.end(); ++D) {
- for (Value::DefCIterator d = vB->defs.begin(); d != vB->defs.end(); ++d) {
- const LValue *vD = (*D)->get()->asLValue();
- const LValue *vd = (*d)->get()->asLValue();
+ for (const ValueDef *D : vA->defs) {
+ for (const ValueDef *d : vB->defs) {
+ const LValue *vD = D->get()->asLValue();
+ const LValue *vd = d->get()->asLValue();
if (!vD->livei.overlaps(vd->livei)) {
INFO_DBG(prog->dbgFlags, REG_ALLOC, "(%%%i) X (%%%i): no overlap\n",