class assignment_entry : public exec_node
{
public:
+ /* override operator new from exec_node */
+ DECLARE_LINEAR_ZALLOC_CXX_OPERATORS(assignment_entry)
+
assignment_entry(ir_variable *lhs, ir_assignment *ir)
{
assert(lhs);
int used = 0;
used |= 1 << ir->mask.x;
- used |= 1 << ir->mask.y;
- used |= 1 << ir->mask.z;
- used |= 1 << ir->mask.w;
+ if (ir->mask.num_components > 1)
+ used |= 1 << ir->mask.y;
+ if (ir->mask.num_components > 2)
+ used |= 1 << ir->mask.z;
+ if (ir->mask.num_components > 3)
+ used |= 1 << ir->mask.w;
use_channels(deref->var, used);
* of a variable to a variable.
*/
static bool
-process_assignment(void *ctx, ir_assignment *ir, exec_list *assignments)
+process_assignment(void *lin_ctx, ir_assignment *ir, exec_list *assignments)
{
ir_variable *var = NULL;
bool progress = false;
}
/* Add this instruction to the assignment list available to be removed. */
- assignment_entry *entry = new(ctx) assignment_entry(var, ir);
+ assignment_entry *entry = new(lin_ctx) assignment_entry(var, ir);
assignments->push_tail(entry);
if (debug) {
bool progress = false;
void *ctx = ralloc_context(NULL);
+ void *lin_ctx = linear_alloc_parent(ctx, 0);
+
/* Safe looping, since process_assignment */
for (ir = first, ir_next = (ir_instruction *)first->next;;
ir = ir_next, ir_next = (ir_instruction *)ir->next) {
}
if (ir_assign) {
- progress = process_assignment(ctx, ir_assign, &assignments) || progress;
+ progress = process_assignment(lin_ctx, ir_assign, &assignments) ||
+ progress;
} else {
kill_for_derefs_visitor kill(&assignments);
ir->accept(&kill);