nv50/ir: copy over value's register id when resolving merge of a phi
authorIlia Mirkin <imirkin@alum.mit.edu>
Mon, 10 Oct 2016 20:57:50 +0000 (16:57 -0400)
committerIlia Mirkin <imirkin@alum.mit.edu>
Wed, 12 Oct 2016 17:18:14 +0000 (13:18 -0400)
The offset needs to be properly copied over to the phi value, otherwise
it will get assigned to the base of the merge instead of the proper
location.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Cc: mesa-stable@lists.freedesktop.org
src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp

index 7e64f7ce92c1e315bd08693bebaa982134d990ac..d36c8531a275bc921092cb47845d511e851a251f 100644 (file)
@@ -1905,8 +1905,10 @@ GCRA::resolveSplitsAndMerges()
          // their registers should be identical.
          if (v->getInsn()->op == OP_PHI || v->getInsn()->op == OP_UNION) {
             Instruction *phi = v->getInsn();
-            for (int phis = 0; phi->srcExists(phis); ++phis)
+            for (int phis = 0; phi->srcExists(phis); ++phis) {
                phi->getSrc(phis)->join = v;
+               phi->getSrc(phis)->reg.data.id = v->reg.data.id;
+            }
          }
          reg += v->reg.size;
       }