void calculate_register_pressure();
bool opt_algebraic();
bool opt_cse();
- bool opt_cse_local(bblock_t *block, exec_list *aeb);
+ bool opt_cse_local(bblock_t *block);
bool opt_copy_propagate();
bool try_copy_propagate(fs_inst *inst, int arg, acp_entry *entry);
bool opt_copy_propagate_local(void *mem_ctx, bblock_t *block,
}
bool
-fs_visitor::opt_cse_local(bblock_t *block, exec_list *aeb)
+fs_visitor::opt_cse_local(bblock_t *block)
{
bool progress = false;
+ exec_list aeb;
void *cse_ctx = ralloc_context(NULL);
{
bool found = false;
- foreach_in_list_use_after(aeb_entry, entry, aeb) {
+ foreach_in_list_use_after(aeb_entry, entry, &aeb) {
/* Match current instruction's expression against those in AEB. */
if (instructions_match(inst, entry->generator)) {
found = true;
aeb_entry *entry = ralloc(cse_ctx, aeb_entry);
entry->tmp = reg_undef;
entry->generator = inst;
- aeb->push_tail(entry);
+ aeb.push_tail(entry);
} else {
/* This is at least our second sighting of this expression.
* If we don't have a temporary already, make one.
}
}
- foreach_in_list_safe(aeb_entry, entry, aeb) {
+ foreach_in_list_safe(aeb_entry, entry, &aeb) {
/* Kill all AEB entries that write a different value to or read from
* the flag register if we just wrote it.
*/
for (int b = 0; b < cfg.num_blocks; b++) {
bblock_t *block = cfg.blocks[b];
- exec_list aeb;
- progress = opt_cse_local(block, &aeb) || progress;
+ progress = opt_cse_local(block) || progress;
}
return progress;