Mesa (master): gallivm: added some assertions in loop-gen code

Brian Paul brianp at kemper.freedesktop.org
Thu Apr 22 00:22:48 UTC 2010


Module: Mesa
Branch: master
Commit: 7fe93f831d74ce46a161c0b0c89f00b9c18caa2b
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=7fe93f831d74ce46a161c0b0c89f00b9c18caa2b

Author: Brian Paul <brianp at vmware.com>
Date:   Wed Apr 21 18:22:15 2010 -0600

gallivm: added some assertions in loop-gen code

We're hitting these assertions with nested loops...

---

 src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
index f70e96d..44f8aec 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
@@ -172,6 +172,7 @@ static void lp_exec_mask_update(struct lp_exec_mask *mask)
       /*for loops we need to update the entire mask at
        * runtime */
       LLVMValueRef tmp;
+      assert(mask->break_mask);
       tmp = LLVMBuildAnd(mask->bld->builder,
                          mask->cont_mask,
                          mask->break_mask,
@@ -279,8 +280,12 @@ static void lp_exec_endloop(struct lp_exec_mask *mask)
    LLVMBasicBlockRef endloop;
    LLVMTypeRef reg_type = LLVMIntType(mask->bld->type.width*
                                       mask->bld->type.length);
+   LLVMValueRef i1cond;
+
+   assert(mask->break_mask);
+
    /* i1cond = (mask == 0) */
-   LLVMValueRef i1cond = LLVMBuildICmp(
+   i1cond = LLVMBuildICmp(
       mask->bld->builder,
       LLVMIntNE,
       LLVMBuildBitCast(mask->bld->builder, mask->break_mask, reg_type, ""),




More information about the mesa-commit mailing list