i965/fs: Change try_opt_frontfacing_ternary to eliminate asserts
authorIan Romanick <ian.d.romanick@intel.com>
Sat, 28 Feb 2015 16:26:37 +0000 (08:26 -0800)
committerIan Romanick <ian.d.romanick@intel.com>
Tue, 17 Mar 2015 22:00:28 +0000 (15:00 -0700)
If we check for the case that is actually necessary, the asserts
become superfluous.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/drivers/dri/i965/brw_fs_visitor.cpp

index 5d4b166a8fb7460f387fd9e281fff1f5109a8652..91dd212d0f9a5d952506b27d81a8a1a9265fccaf 100644 (file)
@@ -2735,11 +2735,8 @@ fs_visitor::try_opt_frontfacing_ternary(ir_if *ir)
    if (!then_rhs || !else_rhs)
       return false;
 
-   if ((then_rhs->is_one() || then_rhs->is_negative_one()) &&
-       (else_rhs->is_one() || else_rhs->is_negative_one())) {
-      assert(then_rhs->is_one() == else_rhs->is_negative_one());
-      assert(else_rhs->is_one() == then_rhs->is_negative_one());
-
+   if ((then_rhs->is_one() && else_rhs->is_negative_one()) ||
+       (else_rhs->is_one() && then_rhs->is_negative_one())) {
       then_assign->lhs->accept(this);
       fs_reg dst = this->result;
       dst.type = BRW_REGISTER_TYPE_D;