aco/gfx11: don't use bfe for local_invocation_id if the others are always 0
Foz-DB GFX1100: Totals from 4469 (3.37% of 132657) affected shaders: Instrs: 3895053 -> 3893529 (-0.04%); split: -0.04%, +0.00% CodeSize: 20244128 -> 20220952 (-0.11%); split: -0.11%, +0.00% Latency: 37864147 -> 37862227 (-0.01%); split: -0.01%, +0.00% InvThroughput: 5578100 -> 5576469 (-0.03%); split: -0.03%, +0.00% SClause: 108336 -> 108343 (+0.01%); split: -0.00%, +0.01% Copies: 275897 -> 275900 (+0.00%); split: -0.00%, +0.00% Reviewed-by: Timur Kristóf <timur.kristof@gmail.com> Reviewed-by: Rhys Perry <pendingchaos02@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24514>
This commit is contained in:
@@ -8212,9 +8212,20 @@ visit_intrinsic(isel_context* ctx, nir_intrinsic_instr* instr)
|
||||
|
||||
/* Thread IDs are packed in VGPR0, 10 bits per component. */
|
||||
for (uint32_t i = 0; i < 3; i++) {
|
||||
local_ids[i] = bld.vop3(aco_opcode::v_bfe_u32, bld.def(v1),
|
||||
get_arg(ctx, ctx->args->local_invocation_ids),
|
||||
Operand::c32(i * 10u), Operand::c32(10u));
|
||||
if (i == 0 && ctx->shader->info.workgroup_size[1] == 1 &&
|
||||
ctx->shader->info.workgroup_size[2] == 1 &&
|
||||
!ctx->shader->info.workgroup_size_variable) {
|
||||
local_ids[i] = get_arg(ctx, ctx->args->local_invocation_ids);
|
||||
} else if (i == 2 || (i == 1 && ctx->shader->info.workgroup_size[2] == 1 &&
|
||||
!ctx->shader->info.workgroup_size_variable)) {
|
||||
local_ids[i] =
|
||||
bld.vop2(aco_opcode::v_lshrrev_b32, bld.def(v1), Operand::c32(i * 10u),
|
||||
get_arg(ctx, ctx->args->local_invocation_ids));
|
||||
} else {
|
||||
local_ids[i] = bld.vop3(aco_opcode::v_bfe_u32, bld.def(v1),
|
||||
get_arg(ctx, ctx->args->local_invocation_ids),
|
||||
Operand::c32(i * 10u), Operand::c32(10u));
|
||||
}
|
||||
}
|
||||
|
||||
bld.pseudo(aco_opcode::p_create_vector, Definition(dst), local_ids[0], local_ids[1],
|
||||
|
||||
Reference in New Issue
Block a user