gallivm: Eliminate redundant lp_build_select calls.
authorJosé Fonseca <jfonseca@vmware.com>
Fri, 5 Jul 2013 10:53:09 +0000 (11:53 +0100)
committerJosé Fonseca <jfonseca@vmware.com>
Fri, 12 Jul 2013 14:40:16 +0000 (15:40 +0100)
lp_build_cmp already returns 0 / ~0, so the lp_build_select call is
unnecessary.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
src/gallium/auxiliary/gallivm/lp_bld_tgsi_action.c

index e65035219ba8d90cee748b5282da859a1ba46e06..68bd1243ecedbd8868ddceb3022e691739fc638f 100644 (file)
@@ -1161,14 +1161,9 @@ iset_emit_cpu(
    struct lp_build_emit_data * emit_data,
    unsigned pipe_func)
 {
-   LLVMValueRef nz = lp_build_const_vec(bld_base->base.gallivm,
-                                       bld_base->int_bld.type, ~0U);
    LLVMValueRef cond = lp_build_cmp(&bld_base->int_bld, pipe_func,
                                     emit_data->args[0], emit_data->args[1]);
-   emit_data->output[emit_data->chan] = lp_build_select(&bld_base->int_bld,
-                                          cond,
-                                          nz,
-                                          bld_base->int_bld.zero);
+   emit_data->output[emit_data->chan] = cond;
 }
 
 /* TGSI_OPCODE_IMAX (CPU Only) */
@@ -1620,14 +1615,9 @@ uset_emit_cpu(
    struct lp_build_emit_data * emit_data,
    unsigned pipe_func)
 {
-   LLVMValueRef nz = lp_build_const_vec(bld_base->base.gallivm,
-                                       bld_base->uint_bld.type, ~0U);
    LLVMValueRef cond = lp_build_cmp(&bld_base->uint_bld, pipe_func,
                                     emit_data->args[0], emit_data->args[1]);
-   emit_data->output[emit_data->chan] = lp_build_select(&bld_base->uint_bld,
-                                          cond,
-                                         nz,
-                                          bld_base->uint_bld.zero);
+   emit_data->output[emit_data->chan] = cond;
 }