From 7e653b2eb112dd3bc614c93ff491a24480f510c0 Mon Sep 17 00:00:00 2001 From: M Henning Date: Sun, 5 Jun 2022 16:59:00 -0400 Subject: [PATCH] nv50_ir_ra: Remove an assign to lval->compMask This code previously stored two rather different masks in compMask: 1. from merge/splits (calculated in makeCompound), and 2. in the join root for whatever register was assigned Since we were already calculating the second type as intfMask where it is used in checkInterference(), change that function to unconditionally use intfMask and only use compMask for the first type. This is functionally equavalent and keeps the types of masks separate. Part-of: --- src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp index c1af7c80248..1cb312ec4f7 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp @@ -1303,7 +1303,7 @@ GCRA::checkInterference(const RIG_Node *node, Graph::EdgeIterator& ei) LValue *vA = node->getValue(); LValue *vB = intf->getValue(); - const uint8_t intfMask = ((1 << intf->colors) - 1) << (intf->reg & 7); + const uint8_t intfMask = intf->getCompMask(); if (vA->compound | vB->compound) { // NOTE: this only works for >aligned< register tuples ! @@ -1320,11 +1320,9 @@ GCRA::checkInterference(const RIG_Node *node, Graph::EdgeIterator& ei) uint8_t mask = vD->compound ? vD->compMask : ~0; if (vd->compound) { - assert(vB->compound); - mask &= vd->compMask & vB->compMask; - } else { - mask &= intfMask; + mask &= vd->compMask; } + mask &= intfMask; INFO_DBG(prog->dbgFlags, REG_ALLOC, "(%%%i)%02x X (%%%i)%02x & %02x: $r%i.%02x\n", @@ -1383,7 +1381,6 @@ GCRA::selectRegisters() bool ret = regs.assign(node->reg, node->f, node->colors, node->maxReg); if (ret) { INFO_DBG(prog->dbgFlags, REG_ALLOC, "assigned reg %i\n", node->reg); - lval->compMask = node->getCompMask(); } else { INFO_DBG(prog->dbgFlags, REG_ALLOC, "must spill: %%%i (size %u)\n", lval->id, lval->reg.size);