nv50: loops part 2
[mesa.git] / src / gallium / drivers / nv50 / nv50_pc_optimize.c
index 64ffeaf430d04d6d3ef5f03f9558c63d1c152e79..daf63a3d20576e77d9fd3f8e8eb45561e09e4466 100644 (file)
@@ -89,7 +89,7 @@ inst_cullable(struct nv_instruction *nvi)
 static INLINE boolean
 nvi_isnop(struct nv_instruction *nvi)
 {
-   if (nvi->opcode == NV_OP_EXPORT)
+   if (nvi->opcode == NV_OP_EXPORT || nvi->opcode == NV_OP_UNDEF)
       return TRUE;
 
    if (nvi->fixed ||
@@ -849,7 +849,7 @@ nv_pass_dce(struct nv_pass_dce *ctx, struct nv_basic_block *b)
    int j;
    struct nv_instruction *nvi, *next;
 
-   for (nvi = b->entry; nvi; nvi = next) {
+   for (nvi = b->phi ? b->phi : b->entry; nvi; nvi = next) {
       next = nvi->next;
 
       if (inst_cullable(nvi)) {