unsigned predicates_count, predicates_sz;
struct ir3_instruction **predicates;
- /* Track instructions which do not write a register but other-
- * wise must not be discarded (such as kill, stg, etc)
- */
- unsigned keeps_count, keeps_sz;
- struct ir3_instruction **keeps;
-
/* Track texture sample instructions which need texture state
* patched in (for astc-srgb workaround):
*/
uint16_t start_ip, end_ip;
+ /* Track instructions which do not write a register but other-
+ * wise must not be discarded (such as kill, stg, etc)
+ */
+ unsigned keeps_count, keeps_sz;
+ struct ir3_instruction **keeps;
+
/* used for per-pass extra block data. Mainly used right
* now in RA step to track livein/liveout.
*/
kill = ir3_KILL(b, cond, 0);
array_insert(ctx->ir, ctx->ir->predicates, kill);
- array_insert(ctx->ir, ctx->ir->keeps, kill);
+ array_insert(b, b->keeps, kill);
ctx->so->has_kill = true;
break;
stg->cat6.type = TYPE_U32;
stg->cat6.dst_offset = (strmout->output[i].dst_offset + j) * 4;
- array_insert(ctx->ir, ctx->ir->keeps, stg);
+ array_insert(ctx->block, ctx->block->keeps, stg);
}
}
}
}
- for (unsigned i = 0; i < ir->keeps_count; i++) {
- instr_cp(&ctx, ir->keeps[i]);
- ir->keeps[i] = eliminate_output_mov(ir->keeps[i]);
- }
-
list_for_each_entry (struct ir3_block, block, &ir->block_list, node) {
if (block->condition) {
instr_cp(&ctx, block->condition);
block->condition = eliminate_output_mov(block->condition);
}
+
+ for (unsigned i = 0; i < block->keeps_count; i++) {
+ instr_cp(&ctx, block->keeps[i]);
+ block->keeps[i] = eliminate_output_mov(block->keeps[i]);
+ }
}
}
if (ir->outputs[i])
ir3_instr_depth(ir->outputs[i]);
- for (i = 0; i < ir->keeps_count; i++)
- ir3_instr_depth(ir->keeps[i]);
-
- /* We also need to account for if-condition: */
list_for_each_entry (struct ir3_block, block, &ir->block_list, node) {
+ for (i = 0; i < block->keeps_count; i++)
+ ir3_instr_depth(block->keeps[i]);
+
+ /* We also need to account for if-condition: */
if (block->condition)
ir3_instr_depth(block->condition);
}
}
}
- for (i = 0; i < ir->keeps_count; i++) {
- struct ir3_instruction *instr = ir->keeps[i];
- instr_find_neighbors(instr);
+ list_for_each_entry (struct ir3_block, block, &ir->block_list, node) {
+ for (i = 0; i < block->keeps_count; i++) {
+ struct ir3_instruction *instr = block->keeps[i];
+ instr_find_neighbors(instr);
+ }
}
}