mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-20 13:50:11 +01:00
r600/sfn: make sure that kill and update pred are not in the same group
The two don't seem to mix well. Signed-off-by: Gert Wollny <gert.wollny@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37096>
This commit is contained in:
parent
6ebda9ca52
commit
359bfc3138
1 changed files with 23 additions and 2 deletions
|
|
@ -616,6 +616,9 @@ BlockScheduler::schedule_alu(Shader::ShaderBlocks& out_blocks, ValueFactory& vf)
|
||||||
if (!alu_vec_ready.empty())
|
if (!alu_vec_ready.empty())
|
||||||
success |= schedule_alu_to_group_vec(group);
|
success |= schedule_alu_to_group_vec(group);
|
||||||
|
|
||||||
|
if (group->has_kill_op())
|
||||||
|
break;
|
||||||
|
|
||||||
/* Apparently one can't schedule a t-slot if there is already
|
/* Apparently one can't schedule a t-slot if there is already
|
||||||
* and LDS instruction scheduled.
|
* and LDS instruction scheduled.
|
||||||
* TODO: check whether this is only relevant for actual LDS instructions
|
* TODO: check whether this is only relevant for actual LDS instructions
|
||||||
|
|
@ -865,6 +868,8 @@ BlockScheduler::schedule_alu_to_group_vec(AluGroup *group)
|
||||||
bool success = false;
|
bool success = false;
|
||||||
auto i = alu_vec_ready.begin();
|
auto i = alu_vec_ready.begin();
|
||||||
auto e = alu_vec_ready.end();
|
auto e = alu_vec_ready.end();
|
||||||
|
bool group_has_kill = false;
|
||||||
|
bool group_has_update_pred = false;
|
||||||
while (i != e) {
|
while (i != e) {
|
||||||
sfn_log << SfnLog::schedule << "Try schedule to vec " << **i;
|
sfn_log << SfnLog::schedule << "Try schedule to vec " << **i;
|
||||||
|
|
||||||
|
|
@ -873,9 +878,21 @@ BlockScheduler::schedule_alu_to_group_vec(AluGroup *group)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// precausion: don't kill while we hae LDS queue reads in the pipeline
|
bool is_kill = (*i)->is_kill();
|
||||||
if ((*i)->is_kill() && m_current_block->lds_group_active())
|
bool does_update_pred = (*i)->has_alu_flag(alu_update_pred);
|
||||||
|
|
||||||
|
// don't kill while we hae LDS queue reads in the pipeline
|
||||||
|
if (is_kill && (m_current_block->lds_group_active())) {
|
||||||
|
++i;
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// don't put a kill and an update of the predicate into the
|
||||||
|
// same group
|
||||||
|
if ((group_has_kill && does_update_pred) || (group_has_update_pred && is_kill)) {
|
||||||
|
++i;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (!m_current_block->try_reserve_kcache(**i)) {
|
if (!m_current_block->try_reserve_kcache(**i)) {
|
||||||
sfn_log << SfnLog::schedule << " failed (kcache)\n";
|
sfn_log << SfnLog::schedule << " failed (kcache)\n";
|
||||||
|
|
@ -885,6 +902,7 @@ BlockScheduler::schedule_alu_to_group_vec(AluGroup *group)
|
||||||
|
|
||||||
if (group->add_vec_instructions(*i)) {
|
if (group->add_vec_instructions(*i)) {
|
||||||
(*i)->pin_dest_to_chan();
|
(*i)->pin_dest_to_chan();
|
||||||
|
group_has_update_pred |= (*i)->has_alu_flag(alu_update_pred);
|
||||||
auto old_i = i;
|
auto old_i = i;
|
||||||
++i;
|
++i;
|
||||||
if ((*old_i)->has_alu_flag(alu_is_lds)) {
|
if ((*old_i)->has_alu_flag(alu_is_lds)) {
|
||||||
|
|
@ -924,6 +942,9 @@ BlockScheduler::schedule_alu_to_group_vec(AluGroup *group)
|
||||||
|
|
||||||
alu_vec_ready.erase(old_i);
|
alu_vec_ready.erase(old_i);
|
||||||
success = true;
|
success = true;
|
||||||
|
|
||||||
|
group_has_kill |= is_kill;
|
||||||
|
|
||||||
sfn_log << SfnLog::schedule << " success\n";
|
sfn_log << SfnLog::schedule << " success\n";
|
||||||
} else {
|
} else {
|
||||||
++i;
|
++i;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue