Left over from removing inheritance with sed instead of coccinelle.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11936>
bi_block_terminates_helpers(bi_block *block)
{
/* Can't terminate if a successor needs helpers */
- bi_foreach_successor((block), succ) {
- if (((bi_block *) succ)->pass_flags & 1)
+ bi_foreach_successor(block, succ) {
+ if (succ->pass_flags & 1)
return false;
}
_mesa_hash_pointer,
_mesa_key_pointer_equal);
- bi_foreach_block(ctx, _block) {
- bi_block *block = (bi_block *) _block;
+ bi_foreach_block(ctx, block) {
block->pass_flags = bi_block_uses_helpers(block) ? 1 : 0;
if (block->pass_flags & 1)
- _mesa_set_add(worklist, _block);
+ _mesa_set_add(worklist, block);
}
/* Next, propagate back. Since there are a finite number of blocks, the
/* Its predecessors also require helpers */
bi_foreach_predecessor(blk, pred) {
if (!_mesa_set_search(visited, pred)) {
- ((bi_block *) pred)->pass_flags |= 1;
+ pred->pass_flags |= 1;
_mesa_set_add(worklist, pred);
}
}
_mesa_set_destroy(worklist, NULL);
/* Finally, mark clauses requiring helpers */
- bi_foreach_block(ctx, _block) {
- bi_block *block = (bi_block *) _block;
-
+ bi_foreach_block(ctx, block) {
/* At the end, there are helpers iff we don't terminate */
bool helpers = !bi_block_terminates_helpers(block);
bi_block *blk = (struct bi_block *) cur->key;
_mesa_set_remove(work_list, cur);
- bool progress = bi_helper_block_update(deps, (bi_block *) blk);
+ bool progress = bi_helper_block_update(deps, blk);
if (progress || !_mesa_set_search(visited, blk)) {
bi_foreach_predecessor(blk, pred)
/* We then need to jump through every clause of every following
* block until the target */
- bi_foreach_block_from(ctx, start->block, _blk) {
- bi_block *blk = (bi_block *) _blk;
-
+ bi_foreach_block_from(ctx, start->block, blk) {
/* Don't double-count the first block */
if (blk == start->block)
continue;
/* And jump back every clause of preceding blocks up through
* and including the target to get to the beginning of the
* target */
- bi_foreach_block_from_rev(ctx, start->block, _blk) {
- bi_block *blk = (bi_block *) _blk;
-
+ bi_foreach_block_from_rev(ctx, start->block, blk) {
if (blk == start->block)
continue;
bi_index *replacement = calloc(sizeof(bi_index), ((ctx->ssa_alloc + 1) << 2));
_mesa_set_clear(instr_set, NULL);
- bi_foreach_instr_in_block((bi_block *) block, instr) {
+ bi_foreach_instr_in_block(block, instr) {
/* Rewrite before trying to CSE anything so we converge
* locally in one iteration */
bi_foreach_src(instr, s) {
bi_invalidate_liveness(ctx);
bi_compute_liveness(ctx);
- bi_foreach_block_rev(ctx, _block) {
- bi_block *block = (bi_block *) _block;
- uint16_t *live = rzalloc_array(_block, uint16_t, temp_count);
+ bi_foreach_block_rev(ctx, block) {
+ uint16_t *live = rzalloc_array(block, uint16_t, temp_count);
- bi_foreach_successor(_block, succ) {
+ bi_foreach_successor(block, succ) {
for (unsigned i = 0; i < temp_count; ++i)
live[i] |= succ->live_in[i];
}
static bool
bi_postra_liveness_block(bi_block *blk)
{
- bi_foreach_successor((blk), _succ) {
- bi_block *succ = (bi_block *) _succ;
+ bi_foreach_successor(blk, succ)
blk->reg_live_out |= succ->reg_live_in;
- }
uint64_t live = blk->reg_live_out;
struct set_entry *cur;
cur = _mesa_set_add(work_list, pan_exit_block(&ctx->blocks));
- bi_foreach_block(ctx, _block) {
- bi_block *block = (bi_block *) _block;
+ bi_foreach_block(ctx, block) {
block->reg_live_out = block->reg_live_in = 0;
}
{
bi_postra_liveness(ctx);
- bi_foreach_block_rev(ctx, _block) {
- bi_block *block = (bi_block *) _block;
+ bi_foreach_block_rev(ctx, block) {
uint64_t live = block->reg_live_out;
bi_foreach_instr_in_block_rev(block, ins) {
{
unsigned previous_size = emission->size;
- bi_foreach_block(ctx, _block) {
- bi_block *block = (bi_block *) _block;
-
+ bi_foreach_block(ctx, block) {
bi_assign_branch_offset(ctx, block);
bi_foreach_clause_in_block(block, clause) {
next = bi_next_clause(ctx, block->successors[0], NULL);
next_2 = bi_next_clause(ctx, block->successors[1], NULL);
} else {
- next = bi_next_clause(ctx, _block, clause);
+ next = bi_next_clause(ctx, block, clause);
}
bi_print_shader(bi_context *ctx, FILE *fp)
{
bi_foreach_block(ctx, block)
- bi_print_block((bi_block *) block, fp);
+ bi_print_block(block, fp);
}
bi_compute_liveness(ctx);
bi_postra_liveness(ctx);
- bi_foreach_block_rev(ctx, _blk) {
- bi_block *blk = (bi_block *) _blk;
- uint16_t *live = mem_dup(_blk->live_out, node_count * sizeof(uint16_t));
+ bi_foreach_block_rev(ctx, blk) {
+ uint16_t *live = mem_dup(blk->live_out, node_count * sizeof(uint16_t));
bi_mark_interference(blk, l, live, blk->reg_live_out,
node_count, ctx->inputs->is_blend, !full_regs);
bi_postra_liveness(ctx);
bi_foreach_block(ctx, block) {
- bi_block *bblock = (bi_block *) block;
- bi_schedule_block(ctx, bblock);
+ bi_schedule_block(ctx, block);
}
bi_opt_dce_post_ra(ctx);
struct bi_scoreboard_state st = {};
/* Assign slots */
- bi_foreach_block(ctx, _block) {
- bi_block *block = (bi_block *) _block;
-
+ bi_foreach_block(ctx, block) {
bi_foreach_clause_in_block(block, clause) {
unsigned slot = bi_choose_scoreboard_slot(&st, clause->message);
clause->scoreboard_id = slot;
- bi_clause *next = bi_next_clause(ctx, _block, clause);
+ bi_clause *next = bi_next_clause(ctx, block, clause);
if (next)
next->dependencies |= (1 << slot);
}
for (unsigned i = 0; i < ARRAY_SIZE(block->successors); ++i) {
if (block->successors[i]) {
- if (block->successors[i] == (bi_block *) successor)
+ if (block->successors[i] == successor)
return;
else
continue;
}
- block->successors[i] = (void *) successor;
+ block->successors[i] = successor;
_mesa_set_add(successor->predecessors, block);
return;
}
* cycle counts are surely more complicated.
*/
- bi_foreach_block(ctx, _block) {
- bi_block *block = (bi_block *) _block;
-
+ bi_foreach_block(ctx, block) {
bi_foreach_clause_in_block(block, clause) {
stats.nr_clauses++;
stats.nr_tuples += clause->tuple_count;
unsigned block_source_count = 0;
- bi_foreach_block(ctx, _block) {
- bi_block *block = (bi_block *) _block;
-
+ bi_foreach_block(ctx, block) {
/* Name blocks now that we're done emitting so the order is
* consistent */
block->name = block_source_count++;
if (need_dummy_atest) {
bi_block *end = list_last_entry(&ctx->blocks, bi_block, link);
- bi_builder b = bi_init_builder(ctx, bi_after_block((bi_block *) end));
+ bi_builder b = bi_init_builder(ctx, bi_after_block(end));
bi_emit_atest(&b, bi_zero());
}
bi_opt_cse(ctx);
bi_opt_dead_code_eliminate(ctx);
- bi_foreach_block(ctx, _block) {
- bi_block *block = (bi_block *) _block;
+ bi_foreach_block(ctx, block) {
bi_lower_branch(block);
}
return NULL;
/* Try the first clause in this block if we're starting from scratch */
- if (!clause && !list_is_empty(&((bi_block *) block)->clauses))
- return list_first_entry(&((bi_block *) block)->clauses, bi_clause, link);
+ if (!clause && !list_is_empty(&block->clauses))
+ return list_first_entry(&block->clauses, bi_clause, link);
/* Try the next clause in this block */
- if (clause && clause->link.next != &((bi_block *) block)->clauses)
+ if (clause && clause->link.next != &block->clauses)
return list_first_entry(&(clause->link), bi_clause, link);
/* Try the next block, or the one after that if it's empty, etc .*/
bi_block *next_block = bi_next_block(block);
bi_foreach_block_from(ctx, next_block, block) {
- bi_block *blk = (bi_block *) block;
-
- if (!list_is_empty(&blk->clauses))
- return list_first_entry(&(blk->clauses), bi_clause, link);
+ if (!list_is_empty(&block->clauses))
+ return list_first_entry(&block->clauses, bi_clause, link);
}
return NULL;