nir/opt_move_to_top: check can_reorder & can_speculate
No effect now, but may be needed in the future. Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36099>
This commit is contained in:
@@ -80,6 +80,18 @@ can_move_src_to_top(nir_src *src, void *_state)
|
||||
instr->pass_flags |= PASS_FLAG_CANT_MOVE;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (instr->block == nir_start_block(state->impl) &&
|
||||
!nir_intrinsic_can_reorder(nir_instr_as_intrinsic(instr))) {
|
||||
instr->pass_flags |= PASS_FLAG_CANT_MOVE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (instr->block != nir_start_block(state->impl) &&
|
||||
!nir_instr_can_speculate(instr)) {
|
||||
instr->pass_flags |= PASS_FLAG_CANT_MOVE;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!nir_foreach_src(instr, can_move_src_to_top, state)) {
|
||||
|
||||
Reference in New Issue
Block a user