nv50/ir: don't flip SHL(ADD) into ADD(SHL) if ADD sources have modifiers
authorIlia Mirkin <imirkin@alum.mit.edu>
Wed, 20 Jan 2016 22:59:34 +0000 (17:59 -0500)
committerIlia Mirkin <imirkin@alum.mit.edu>
Wed, 20 Jan 2016 23:03:36 +0000 (18:03 -0500)
Fixes: 31fde8fa (nv50/ir: flip shl(add, imm) into add(shl, imm))
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp

index 7577355384071762e9ea6df569d4a451ba3e94a1..95e9fdfc57da5fd5b7374af4475d421a743c7415 100644 (file)
@@ -1229,6 +1229,8 @@ ConstantFolding::opnd(Instruction *i, ImmediateValue &imm0, int s)
             adds = 1;
          else
             return;
+         if (si->src(!adds).mod != Modifier(0))
+            return;
          // SHL(ADD(x, y), z) = ADD(SHL(x, z), SHL(y, z))
 
          // This is more operations, but if one of x, y is an immediate, then