interval->is_killed = true;
}
+static void
+ra_file_unmark_killed(struct ra_file *file, struct ra_interval *interval)
+{
+ assert(!interval->interval.parent);
+
+ for (physreg_t i = interval->physreg_start; i < interval->physreg_end; i++) {
+ BITSET_CLEAR(file->available, i);
+ }
+
+ interval->is_killed = false;
+}
+
static physreg_t
ra_interval_get_physreg(const struct ra_interval *interval)
{
*/
physreg_t dst_fixed = (physreg_t)~0u;
- for (unsigned i = 0; i < instr->srcs_count; i++) {
- if (!ra_reg_is_src(instr->srcs[i]))
- continue;
-
- if (instr->srcs[i]->flags & IR3_REG_FIRST_KILL) {
- mark_src_killed(ctx, instr->srcs[i]);
+ ra_foreach_src (src, instr) {
+ if (src->flags & IR3_REG_FIRST_KILL) {
+ mark_src_killed(ctx, src);
}
- struct ir3_register *src = instr->srcs[i];
struct ra_interval *interval = &ctx->intervals[src->def->name];
if (src->def->merge_set != dst_set || interval->is_killed)
allocate_dst(ctx, instr->dsts[0]);
/* Remove the temporary is_killed we added */
- for (unsigned i = 0; i < instr->srcs_count; i++) {
- if (!ra_reg_is_src(instr->srcs[i]))
- continue;
-
- struct ir3_register *src = instr->srcs[i];
+ ra_foreach_src (src, instr) {
struct ra_interval *interval = &ctx->intervals[src->def->name];
while (interval->interval.parent != NULL) {
interval = ir3_reg_interval_to_ra_interval(interval->interval.parent);
/* Filter out cases where it actually should be killed */
if (interval != &ctx->intervals[src->def->name] ||
- !(src->flags & IR3_REG_KILL))
- interval->is_killed = false;
+ !(src->flags & IR3_REG_KILL)) {
+ ra_file_unmark_killed(ra_get_file(ctx, src), interval);
+ }
}
ra_foreach_src_rev (src, instr) {