glsl: Eliminate ir_assignment::condition

Reformatting is left for the next commit.

v2: Remove assignments from the contructors. :face_palm:

Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14573>
This commit is contained in:
Ian Romanick
2022-01-14 19:10:04 -08:00
committed by Marge Bot
parent fb630cd783
commit 912299cb39
18 changed files with 9 additions and 114 deletions
@@ -175,7 +175,6 @@ process_assignment(void *lin_ctx, ir_assignment *ir, exec_list *assignments)
bool progress = false;
kill_for_derefs_visitor v(assignments);
if (ir->get_condition() == NULL) {
/* If this is an assignment of the form "foo = foo;", remove the whole
* instruction and be done with it.
*/
@@ -184,13 +183,9 @@ process_assignment(void *lin_ctx, ir_assignment *ir, exec_list *assignments)
ir->remove();
return true;
}
}
/* Kill assignment entries for things used to produce this assignment. */
ir->rhs->accept(&v);
if (ir->get_condition()) {
ir->get_condition()->accept(&v);
}
/* Kill assignment enties used as array indices.
*/
@@ -199,7 +194,6 @@ process_assignment(void *lin_ctx, ir_assignment *ir, exec_list *assignments)
assert(var);
/* Now, check if we did a whole-variable assignment. */
if (!ir->get_condition()) {
ir_dereference_variable *deref_var = ir->lhs->as_dereference_variable();
/* If it's a vector type, we can do per-channel elimination of
@@ -287,7 +281,6 @@ process_assignment(void *lin_ctx, ir_assignment *ir, exec_list *assignments)
}
}
}
}
/* Add this instruction to the assignment list available to be removed. */
assignment_entry *entry = new(lin_ctx) assignment_entry(var, ir);