nvir: run replaceZero() before replaceCvt()
authorBen Skeggs <bskeggs@redhat.com>
Mon, 8 Jun 2020 23:52:47 +0000 (09:52 +1000)
committerMarge Bot <eric+marge@anholt.net>
Wed, 10 Jun 2020 22:52:41 +0000 (22:52 +0000)
replaceCvt() will miss some cases otherwise.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5377>

src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp

index ccdc2f98ef6fa42f5ee3828afb1e8d1b06a49869..8e6b9775d79b959cfe48419adaddee4447d33122 100644 (file)
@@ -867,11 +867,11 @@ NVC0LegalizePostRA::visit(BasicBlock *bb)
                next = hi;
          }
 
-         if (i->op == OP_SAT || i->op == OP_NEG || i->op == OP_ABS)
-            replaceCvt(i);
-
          if (i->op != OP_MOV && i->op != OP_PFETCH)
             replaceZero(i);
+
+         if (i->op == OP_SAT || i->op == OP_NEG || i->op == OP_ABS)
+            replaceCvt(i);
       }
    }
    if (!bb->getEntry())