nv50/ir: avoid folding mul + add if the mul has a dnz
authorIlia Mirkin <imirkin@alum.mit.edu>
Sun, 13 Mar 2016 01:53:34 +0000 (20:53 -0500)
committerIlia Mirkin <imirkin@alum.mit.edu>
Sun, 13 Mar 2016 17:17:24 +0000 (13:17 -0400)
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp

index 6192c0665e4756fa1191e2dc82bd66132cf18a73..66e7b2e824394e436587b0a68f15f73ad7b948d6 100644 (file)
@@ -1635,11 +1635,10 @@ AlgebraicOpt::tryADDToMADOrSAD(Instruction *add, operation toOp)
    if (src->getUniqueInsn() && src->getUniqueInsn()->bb != add->bb)
       return false;
 
-   if (src->getInsn()->saturate)
+   if (src->getInsn()->saturate || src->getInsn()->postFactor ||
+       src->getInsn()->dnz)
       return false;
 
-   if (src->getInsn()->postFactor)
-      return false;
    if (toOp == OP_SAD) {
       ImmediateValue imm;
       if (!src->getInsn()->src(2).getImmediate(imm))