[Mesa-dev] [PATCH] nv50: check for and delete no-op instructions when flattening conditional jumps

Bryan Cain bryancain3 at gmail.com
Mon Apr 4 19:20:16 PDT 2011


Fixes an assertion failure encountered in the pipe-video branch.
---
 src/gallium/drivers/nv50/nv50_pc_optimize.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/gallium/drivers/nv50/nv50_pc_optimize.c b/src/gallium/drivers/nv50/nv50_pc_optimize.c
index 281ccf7..68730d5 100644
--- a/src/gallium/drivers/nv50/nv50_pc_optimize.c
+++ b/src/gallium/drivers/nv50/nv50_pc_optimize.c
@@ -985,6 +985,11 @@ nv_pass_flatten(struct nv_pass *ctx, struct nv_basic_block *b)
       }
 
       if (!nvi && n0 < 12 && n1 < 12) { /* 12 as arbitrary limit */
+         /* free any no-op instructions such as UNDEF at the end of the block */
+         assert(b->exit);
+         while(nvi_isnop(b->exit))
+            nv_nvi_delete(b->exit);
+         
          assert(b->exit && b->exit->flags_src);
          pred = b->exit->flags_src->value;
 
-- 
1.7.1



More information about the mesa-dev mailing list