i965: Add cases for ir_binop_vector_extract that assert.
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 17 May 2013 17:33:40 +0000 (10:33 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Mon, 20 May 2013 17:19:30 +0000 (10:19 -0700)
do_vec_index_to_swizzle() should remove any vector extract operations
with a constant index.  It's unconditionally called from
do_common_optimization().

do_vec_index_to_cond_assign() should remove the rest, and it is
unconditionally called from brw_link_shader().  This means that we
should never see ir_binop_vector_extract in the backend.

Silences compiler warnings.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/drivers/dri/i965/brw_fs_channel_expressions.cpp
src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp

index 0f3d4abdd2678bb691c5b6fa165b21c20b5c42ae..ea714ec47ea016789c1c4dd89a7395c4272e23a9 100644 (file)
@@ -402,6 +402,7 @@ ir_channel_expressions_visitor::visit_leave(ir_assignment *ir)
    case ir_unop_unpack_unorm_2x16:
    case ir_unop_unpack_unorm_4x8:
    case ir_unop_unpack_half_2x16:
+   case ir_binop_vector_extract:
    case ir_quadop_bitfield_insert:
    case ir_quadop_vector:
       assert(!"should have been lowered");
index f14529af80f952e365c5caa5597db2116dfe13bb..f7dd33304c07138c16551bfe8547e04d49e7f7db 100644 (file)
@@ -1671,6 +1671,10 @@ vec4_visitor::visit(ir_expression *ir)
       break;
    }
 
+   case ir_binop_vector_extract:
+      assert(!"should have been lowered by vec_index_to_cond_assign");
+      break;
+
    case ir_triop_lrp:
       op[0] = fix_3src_operand(op[0]);
       op[1] = fix_3src_operand(op[1]);