}
if (progress) {
- invalidate_live_intervals();
+ invalidate_live_intervals(false);
for (unsigned i = 0; i < ARRAY_SIZE(delta_x); i++) {
if (delta_x[i].file == GRF && remap[delta_x[i].reg] != -1) {
}
if (progress)
- invalidate_live_intervals();
+ invalidate_live_intervals(false);
return progress;
}
* same time that both consider ‘r3’ as the target of their final writes.
*/
void
-fs_visitor::insert_gen4_pre_send_dependency_workarounds(fs_inst *inst)
+fs_visitor::insert_gen4_pre_send_dependency_workarounds(bblock_t *block,
+ fs_inst *inst)
{
int reg_size = dispatch_width / 8;
int write_len = inst->regs_written * reg_size;
if (scan_inst->is_control_flow()) {
for (int i = 0; i < write_len; i++) {
if (needs_dep[i]) {
- inst->insert_before(DEP_RESOLVE_MOV(first_write_grf + i));
+ inst->insert_before(block, DEP_RESOLVE_MOV(first_write_grf + i));
}
}
return;
if (reg >= first_write_grf &&
reg < first_write_grf + write_len &&
needs_dep[reg - first_write_grf]) {
- inst->insert_before(DEP_RESOLVE_MOV(reg));
+ inst->insert_before(block, DEP_RESOLVE_MOV(reg));
needs_dep[reg - first_write_grf] = false;
if (scan_inst_simd16)
needs_dep[reg - first_write_grf + 1] = false;
* instruction with a different destination register.
*/
void
-fs_visitor::insert_gen4_post_send_dependency_workarounds(fs_inst *inst)
+fs_visitor::insert_gen4_post_send_dependency_workarounds(bblock_t *block, fs_inst *inst)
{
int write_len = inst->regs_written * dispatch_width / 8;
int first_write_grf = inst->dst.reg;
if (scan_inst->is_control_flow()) {
for (int i = 0; i < write_len; i++) {
if (needs_dep[i])
- scan_inst->insert_before(DEP_RESOLVE_MOV(first_write_grf + i));
+ scan_inst->insert_before(block,
+ DEP_RESOLVE_MOV(first_write_grf + i));
}
return;
}
scan_inst->dst.reg >= first_write_grf &&
scan_inst->dst.reg < first_write_grf + write_len &&
needs_dep[scan_inst->dst.reg - first_write_grf]) {
- scan_inst->insert_before(DEP_RESOLVE_MOV(scan_inst->dst.reg));
+ scan_inst->insert_before(block, DEP_RESOLVE_MOV(scan_inst->dst.reg));
needs_dep[scan_inst->dst.reg - first_write_grf] = false;
}
assert(last_inst->eot);
for (int i = 0; i < write_len; i++) {
if (needs_dep[i])
- last_inst->insert_before(DEP_RESOLVE_MOV(first_write_grf + i));
+ last_inst->insert_before(block, DEP_RESOLVE_MOV(first_write_grf + i));
}
}
* have a .reg_offset of 0.
*/
- foreach_in_list_safe(fs_inst, inst, &instructions) {
+ calculate_cfg();
+
+ foreach_block_and_inst(block, fs_inst, inst, cfg) {
if (inst->mlen != 0 && inst->dst.file == GRF) {
- insert_gen4_pre_send_dependency_workarounds(inst);
- insert_gen4_post_send_dependency_workarounds(inst);
+ insert_gen4_pre_send_dependency_workarounds(block, inst);
+ insert_gen4_post_send_dependency_workarounds(block, inst);
progress = true;
}
}
if (progress)
- invalidate_live_intervals();
+ invalidate_live_intervals(false);
}
/**
bool virtual_grf_interferes(int a, int b);
void schedule_instructions(instruction_scheduler_mode mode);
void insert_gen4_send_dependency_workarounds();
- void insert_gen4_pre_send_dependency_workarounds(fs_inst *inst);
- void insert_gen4_post_send_dependency_workarounds(fs_inst *inst);
+ void insert_gen4_pre_send_dependency_workarounds(bblock_t *block,
+ fs_inst *inst);
+ void insert_gen4_post_send_dependency_workarounds(bblock_t *block,
+ fs_inst *inst);
void vfail(const char *msg, va_list args);
void fail(const char *msg, ...);
void no16(const char *msg, ...);