These are already stripped by opt_constant_folding.cpp.
{
acp_entry *entry;
- if (ir->condition) {
- ir_constant *condition = ir->condition->as_constant();
- if (!condition || !condition->value.b[0])
- return;
- }
+ if (ir->condition)
+ return;
if (!ir->write_mask)
return;
/* OK, now find if we actually have all the right conditions for
* this to be a constant value assigned to the var.
*/
- if (ir->condition) {
- constval = ir->condition->constant_expression_value();
- if (!constval || !constval->value.b[0])
- return visit_continue;
- }
+ if (ir->condition)
+ return visit_continue;
ir_variable *var = ir->whole_variable_written();
if (!var)
{
acp_entry *entry;
- if (ir->condition) {
- ir_constant *condition = ir->condition->as_constant();
- if (!condition || !condition->value.b[0])
- return;
- }
+ if (ir->condition)
+ return;
ir_variable *lhs_var = ir->whole_variable_written();
ir_variable *rhs_var = ir->rhs->whole_variable_referenced();
int orig_swizzle[4] = {0, 1, 2, 3};
int swizzle[4];
- if (ir->condition) {
- ir_constant *condition = ir->condition->as_constant();
- if (!condition || !condition->value.b[0])
- return;
- }
+ if (ir->condition)
+ return;
ir_dereference_variable *lhs = ir->lhs->as_dereference_variable();
if (!lhs || !(lhs->type->is_scalar() || lhs->type->is_vector()))
var = ir->lhs->variable_referenced();
assert(var);
- bool always_assign = true;
- if (ir->condition) {
- ir_constant *condition = ir->condition->as_constant();
- if (!condition || !condition->value.b[0])
- always_assign = false;
- }
-
/* Now, check if we did a whole-variable assignment. */
- if (always_assign && (ir->whole_variable_written() != NULL)) {
+ if (!ir->condition && (ir->whole_variable_written() != NULL)) {
/* We did a whole-variable assignment. So, any instruction in
* the assignment list with the same LHS is dead.
*/