Mesa (master): nv50/ir/ra: don't coalesce contraint-moves

Christoph Bumiller chrisbmr at kemper.freedesktop.org
Mon Jan 9 23:44:38 UTC 2012


Module: Mesa
Branch: master
Commit: 4021979182d3a6eb2bed1e9d784e218eb88bfa28
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=4021979182d3a6eb2bed1e9d784e218eb88bfa28

Author: Christoph Bumiller <e0425955 at student.tuwien.ac.at>
Date:   Sat Jan  7 21:00:51 2012 +0100

nv50/ir/ra: don't coalesce contraint-moves

This could lead to incorrect code when fixed regs are involved.

Surprisingly, the increased freedom actually leads to lower
register usage in some cases. Still want to find a better way
to treat constraints though ...

---

 src/gallium/drivers/nv50/codegen/nv50_ir_ra.cpp |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/gallium/drivers/nv50/codegen/nv50_ir_ra.cpp b/src/gallium/drivers/nv50/codegen/nv50_ir_ra.cpp
index ff6d966..f08026c 100644
--- a/src/gallium/drivers/nv50/codegen/nv50_ir_ra.cpp
+++ b/src/gallium/drivers/nv50/codegen/nv50_ir_ra.cpp
@@ -513,6 +513,10 @@ RegAlloc::coalesceValues(unsigned int mask)
       case OP_MOV:
          if (!(mask & JOIN_MASK_MOV))
             break;
+         i = insn->getDef(0)->uses ? insn->getDef(0)->uses->getInsn() : NULL;
+         // if this is a contraint-move there will only be a single use
+         if (i && i->op == OP_CONSTRAINT)
+            break;
          i = insn->getSrc(0)->getUniqueInsn();
          if (i && !i->constrainedDefs())
             insn->getDef(0)->coalesce(insn->getSrc(0), false);




More information about the mesa-commit mailing list