Skip to contentSkip to conversation

nv50/ir: we can't replace 0x0 with zero reg for SHLADD

PATCH In review Karol Herbst 2 participants 3 messages Apr 29, 2017 2 messages not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nv50/ir: we can't replace 0x0 with zero reg for SHLADD

fixes a crash in Alien Isolation

---
 src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp +1 -1
index 732e1a93b4..4815d6df07 100644
@@ -740,7 +740,7 @@ NVC0LegalizePostRA::visit(BasicBlock *bb)
                next = hi;
          }
 
-         if (i->op != OP_MOV && i->op != OP_PFETCH)
+         if (i->op != OP_MOV && i->op != OP_PFETCH && i->op != OP_SHLADD)
             replaceZero(i);
       }
    }
Signature · 6 lines
2.12.2

_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau

A message that is not in the archive (sent off-list or not yet received): 20170429144146.3905-1-karolherbst-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

#2 lore raw
Quoted 1 line · Karol Herbst

fixes a crash in Alien Isolation

What crash? How did the zero get there? Does this only happen if you do your optimization loop thing?

In either case, we still want the replaceZero() logic. However that logic should be aware that the middle argument of a SHLADD is not to be touched. Otherwise we could end up with an un-emittable instruction.

Quoted 20 lines
---
 src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp +1 -2
index 732e1a93b4..4815d6df07 100644
@@ -740,7 +740,7 @@ NVC0LegalizePostRA::visit(BasicBlock *bb)
                next = hi;
          }
 
-         if (i->op != OP_MOV && i->op != OP_PFETCH)
+         if (i->op != OP_MOV && i->op != OP_PFETCH && i->op != OP_SHLADD)
             replaceZero(i);
       }
    }
--
Quoted 2 lines

2.12.2

_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau

A message that is not in the archive (sent off-list or not yet received): CAKb7UvgBwo6nfq8Gxz56C0SqdcA9NTX729ekJexNPuu60d=ZyQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#4 lore raw

2017-04-29 17:18 GMT+02:00 Ilia Mirkin <[email protected]>:

Quoted 4 lines · Karol Herbst
Quoted 1 line

fixes a crash in Alien Isolation

What crash?

assertion, because shladd requires an immediate, there can't be a reg at src1

"shladd u32 $r0 $r0 $r63 $r36" is invalid for the emiter so we have to use 0x0 here

Quoted 1 line

How did the zero get there?

by replaceZero

Quoted 1 line

Does this only happen if you do your optimization loop thing?

no, it happens on master and the stable branches without any modifications

Quoted 5 lines

In either case, we still want the replaceZero() logic. However that logic should be aware that the middle argument of a SHLADD is not to be touched. Otherwise we could end up with an un-emittable instruction.

ohh right, you mean for the other args... true.

Quoted 15 lines
Quoted 15 lines
---
 src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp +0 -0
index 732e1a93b4..4815d6df07 100644
@@ -740,7 +740,7 @@ NVC0LegalizePostRA::visit(BasicBlock *bb)
                next = hi;
          }
 
Quoted 8 lines
Quoted 8 lines
src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp +1 -2
-         if (i->op != OP_MOV && i->op != OP_PFETCH)
+         if (i->op != OP_MOV && i->op != OP_PFETCH && i->op != OP_SHLADD)
             replaceZero(i);
       }
    }
--

2.12.2

_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau