intel/fs: Rename PLACEHOLDER_HALT to HALT_TARGET
It's a bit more explicit and will play more nicely with what we're about to do. Reviewed-by: Francisco Jerez <currojerez@riseup.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5071>
This commit is contained in:
@@ -552,6 +552,13 @@ enum opcode {
|
||||
|
||||
SHADER_OPCODE_INTERLOCK,
|
||||
|
||||
/** Target for a HALT
|
||||
*
|
||||
* All HALT instructions in a shader must target the same jump point and
|
||||
* that point is denoted by a HALT_TARGET instruction.
|
||||
*/
|
||||
SHADER_OPCODE_HALT_TARGET,
|
||||
|
||||
VEC4_OPCODE_MOV_BYTES,
|
||||
VEC4_OPCODE_PACK_BYTES,
|
||||
VEC4_OPCODE_UNPACK_UNIFORM,
|
||||
@@ -581,7 +588,6 @@ enum opcode {
|
||||
FS_OPCODE_DISCARD_JUMP,
|
||||
FS_OPCODE_SET_SAMPLE_ID,
|
||||
FS_OPCODE_PACK_HALF_2x16_SPLIT,
|
||||
FS_OPCODE_PLACEHOLDER_HALT,
|
||||
FS_OPCODE_INTERPOLATE_AT_SAMPLE,
|
||||
FS_OPCODE_INTERPOLATE_AT_SHARED_OFFSET,
|
||||
FS_OPCODE_INTERPOLATE_AT_PER_SLOT_OFFSET,
|
||||
|
@@ -3035,21 +3035,21 @@ fs_visitor::opt_redundant_discard_jumps()
|
||||
|
||||
bblock_t *last_bblock = cfg->blocks[cfg->num_blocks - 1];
|
||||
|
||||
fs_inst *placeholder_halt = NULL;
|
||||
fs_inst *halt_target = NULL;
|
||||
foreach_inst_in_block_reverse(fs_inst, inst, last_bblock) {
|
||||
if (inst->opcode == FS_OPCODE_PLACEHOLDER_HALT) {
|
||||
placeholder_halt = inst;
|
||||
if (inst->opcode == SHADER_OPCODE_HALT_TARGET) {
|
||||
halt_target = inst;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!placeholder_halt)
|
||||
if (!halt_target)
|
||||
return false;
|
||||
|
||||
/* Delete any HALTs immediately before the placeholder halt. */
|
||||
for (fs_inst *prev = (fs_inst *) placeholder_halt->prev;
|
||||
/* Delete any HALTs immediately before the halt target. */
|
||||
for (fs_inst *prev = (fs_inst *) halt_target->prev;
|
||||
!prev->is_head_sentinel() && prev->opcode == FS_OPCODE_DISCARD_JUMP;
|
||||
prev = (fs_inst *) placeholder_halt->prev) {
|
||||
prev = (fs_inst *) halt_target->prev) {
|
||||
prev->remove(last_bblock);
|
||||
progress = true;
|
||||
}
|
||||
@@ -7943,7 +7943,7 @@ fs_visitor::fixup_3src_null_dest()
|
||||
* Find the first instruction in the program that might start a region of
|
||||
* divergent control flow due to a HALT jump. There is no
|
||||
* find_halt_control_flow_region_end(), the region of divergence extends until
|
||||
* the only FS_OPCODE_PLACEHOLDER_HALT in the program.
|
||||
* the only SHADER_OPCODE_HALT_TARGET in the program.
|
||||
*/
|
||||
static const fs_inst *
|
||||
find_halt_control_flow_region_start(const fs_visitor *v)
|
||||
@@ -7952,7 +7952,7 @@ find_halt_control_flow_region_start(const fs_visitor *v)
|
||||
brw_wm_prog_data(v->prog_data)->uses_kill) {
|
||||
foreach_block_and_inst(block, fs_inst, inst, v->cfg) {
|
||||
if (inst->opcode == FS_OPCODE_DISCARD_JUMP ||
|
||||
inst->opcode == FS_OPCODE_PLACEHOLDER_HALT)
|
||||
inst->opcode == SHADER_OPCODE_HALT_TARGET)
|
||||
return inst;
|
||||
}
|
||||
}
|
||||
@@ -8012,7 +8012,7 @@ fs_visitor::fixup_nomask_control_flow()
|
||||
|
||||
case BRW_OPCODE_WHILE:
|
||||
case BRW_OPCODE_ENDIF:
|
||||
case FS_OPCODE_PLACEHOLDER_HALT:
|
||||
case SHADER_OPCODE_HALT_TARGET:
|
||||
depth++;
|
||||
break;
|
||||
|
||||
@@ -8528,7 +8528,7 @@ fs_visitor::run_fs(bool allow_spilling, bool do_rep_send)
|
||||
return false;
|
||||
|
||||
if (wm_prog_data->uses_kill)
|
||||
bld.emit(FS_OPCODE_PLACEHOLDER_HALT);
|
||||
bld.emit(SHADER_OPCODE_HALT_TARGET);
|
||||
|
||||
if (wm_key->alpha_test_func)
|
||||
emit_alpha_test();
|
||||
|
@@ -562,7 +562,7 @@ private:
|
||||
struct brw_reg dst, struct brw_reg src,
|
||||
unsigned swiz);
|
||||
|
||||
bool patch_discard_jumps_to_fb_writes();
|
||||
bool patch_halt_jumps();
|
||||
|
||||
const struct brw_compiler *compiler;
|
||||
void *log_data; /* Passed to compiler->*_log functions */
|
||||
|
@@ -325,7 +325,7 @@ fs_visitor::opt_cse_local(const fs_live_variables &live, bblock_t *block, int &i
|
||||
* SHADER_OPCODE_FIND_LIVE_CHANNEL.
|
||||
*/
|
||||
if (inst->opcode == FS_OPCODE_DISCARD_JUMP ||
|
||||
inst->opcode == FS_OPCODE_PLACEHOLDER_HALT)
|
||||
inst->opcode == SHADER_OPCODE_HALT_TARGET)
|
||||
aeb.make_empty();
|
||||
|
||||
foreach_in_list_safe(aeb_entry, entry, &aeb) {
|
||||
|
@@ -222,7 +222,7 @@ public:
|
||||
};
|
||||
|
||||
bool
|
||||
fs_generator::patch_discard_jumps_to_fb_writes()
|
||||
fs_generator::patch_halt_jumps()
|
||||
{
|
||||
if (this->discard_halt_patches.is_empty())
|
||||
return false;
|
||||
@@ -2529,11 +2529,11 @@ fs_generator::generate_code(const cfg_t *cfg, int dispatch_width,
|
||||
generate_pack_half_2x16_split(inst, dst, src[0], src[1]);
|
||||
break;
|
||||
|
||||
case FS_OPCODE_PLACEHOLDER_HALT:
|
||||
case SHADER_OPCODE_HALT_TARGET:
|
||||
/* This is the place where the final HALT needs to be inserted if
|
||||
* we've emitted any discards. If not, this will emit no code.
|
||||
*/
|
||||
if (!patch_discard_jumps_to_fb_writes()) {
|
||||
if (!patch_halt_jumps()) {
|
||||
if (unlikely(debug_flag)) {
|
||||
disasm_info->use_tail = true;
|
||||
}
|
||||
|
@@ -76,7 +76,7 @@ namespace {
|
||||
case BRW_OPCODE_SYNC:
|
||||
case BRW_OPCODE_DO:
|
||||
case SHADER_OPCODE_UNDEF:
|
||||
case FS_OPCODE_PLACEHOLDER_HALT:
|
||||
case SHADER_OPCODE_HALT_TARGET:
|
||||
case FS_OPCODE_SCHEDULING_FENCE:
|
||||
return 0;
|
||||
default:
|
||||
|
@@ -1098,7 +1098,7 @@ namespace {
|
||||
}
|
||||
|
||||
case SHADER_OPCODE_UNDEF:
|
||||
case FS_OPCODE_PLACEHOLDER_HALT:
|
||||
case SHADER_OPCODE_HALT_TARGET:
|
||||
case FS_OPCODE_SCHEDULING_FENCE:
|
||||
return calculate_desc(info, unit_null, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0);
|
||||
@@ -1552,7 +1552,7 @@ namespace {
|
||||
|
||||
issue_instruction(st, s->devinfo, inst);
|
||||
|
||||
if (inst->opcode == FS_OPCODE_PLACEHOLDER_HALT && discard_count)
|
||||
if (inst->opcode == SHADER_OPCODE_HALT_TARGET && discard_count)
|
||||
st.weight /= discard_weight;
|
||||
|
||||
elapsed += (st.unit_ready[unit_fe] - clock0) * st.weight;
|
||||
|
@@ -1047,7 +1047,7 @@ instruction_scheduler::add_dep(schedule_node *before, schedule_node *after)
|
||||
static bool
|
||||
is_scheduling_barrier(const backend_instruction *inst)
|
||||
{
|
||||
return inst->opcode == FS_OPCODE_PLACEHOLDER_HALT ||
|
||||
return inst->opcode == SHADER_OPCODE_HALT_TARGET ||
|
||||
inst->is_control_flow() ||
|
||||
inst->has_side_effects();
|
||||
}
|
||||
|
@@ -453,8 +453,8 @@ brw_instruction_name(const struct gen_device_info *devinfo, enum opcode op)
|
||||
case FS_OPCODE_PACK_HALF_2x16_SPLIT:
|
||||
return "pack_half_2x16_split";
|
||||
|
||||
case FS_OPCODE_PLACEHOLDER_HALT:
|
||||
return "placeholder_halt";
|
||||
case SHADER_OPCODE_HALT_TARGET:
|
||||
return "halt_target";
|
||||
|
||||
case FS_OPCODE_INTERPOLATE_AT_SAMPLE:
|
||||
return "interp_sample";
|
||||
|
Reference in New Issue
Block a user