nv50/ir: allow load propagation when flags are defined
authorIlia Mirkin <imirkin@alum.mit.edu>
Sat, 3 May 2014 04:26:14 +0000 (00:26 -0400)
committerIlia Mirkin <imirkin@alum.mit.edu>
Thu, 8 May 2014 00:40:46 +0000 (20:40 -0400)
The old condition disallowed load propagation any time flags were
defined, even with e.g. set and a constbuf reference. The new condition
disallows it only with immediate propagation. (There are no opcodes that
set the condition flag and have an immediate argument.)

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/gallium/drivers/nouveau/codegen/nv50_ir_target_nv50.cpp

index 0b2f27a..32ba5c8 100644 (file)
@@ -275,9 +275,10 @@ TargetNV50::insnCanLoad(const Instruction *i, int s,
       return false;
 
    // NOTE: don't rely on flagsDef
-   for (int d = 0; i->defExists(d); ++d)
-      if (i->def(d).getFile() == FILE_FLAGS)
-         return false;
+   if (sf == FILE_IMMEDIATE)
+      for (int d = 0; i->defExists(d); ++d)
+         if (i->def(d).getFile() == FILE_FLAGS)
+            return false;
 
    unsigned mode = 0;