diff options
author | Timur Kristóf <timur.kristof@gmail.com> | 2023-04-03 00:03:37 +0200 |
---|---|---|
committer | Marge Bot <emma+marge@anholt.net> | 2023-04-03 14:36:07 +0000 |
commit | 739bd03c375ff09b6af240866adfa98920457510 (patch) | |
tree | d19a1bcf419d078d72eb4d3c0185928ad310bc50 /src/amd/compiler/aco_ssa_elimination.cpp | |
parent | 9eb04d8f969c86238b33513adbff56e0a0557c49 (diff) | |
download | mesa-739bd03c375ff09b6af240866adfa98920457510.tar.gz |
aco: Don't verify branch exec read when eliminating exec writes.
Verifying that the branch instruction reads exec is not actually
necessary because the pattern that we look for already implies that.
This prepares for the next commit which will remove the exec operand
from branches that have the same target. These branches will no
longer read exec, but they should still get the same optimization.
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21493>
Diffstat (limited to 'src/amd/compiler/aco_ssa_elimination.cpp')
-rw-r--r-- | src/amd/compiler/aco_ssa_elimination.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/amd/compiler/aco_ssa_elimination.cpp b/src/amd/compiler/aco_ssa_elimination.cpp index 39c33cc19d5..a1c3c4ac3bf 100644 --- a/src/amd/compiler/aco_ssa_elimination.cpp +++ b/src/amd/compiler/aco_ssa_elimination.cpp @@ -570,7 +570,6 @@ eliminate_useless_exec_writes_in_block(ssa_elimination_ctx& ctx, Block& block) /* Collect information about the branching sequence. */ bool logical_end_found = false; - bool branch_reads_exec = false; bool branch_exec_val_found = false; int branch_exec_val_idx = -1; int branch_exec_copy_idx = -1; @@ -591,8 +590,6 @@ eliminate_useless_exec_writes_in_block(ssa_elimination_ctx& ctx, Block& block) bool writes_exec = instr_writes_exec(instr.get()); logical_end_found |= instr->opcode == aco_opcode::p_logical_end; - branch_reads_exec |= i == (int)(block.instructions.size() - 1) && instr->isBranch() && - instr->operands.size() && instr->operands[0].physReg() == exec; /* See if we found an unused exec write. */ if (writes_exec && !exec_write_used) { @@ -610,8 +607,7 @@ eliminate_useless_exec_writes_in_block(ssa_elimination_ctx& ctx, Block& block) /* For a newly encountered exec write, clear the used flag. */ if (writes_exec) { - if (!logical_end_found && branch_reads_exec && instr->operands.size() && - !branch_exec_val_found) { + if (!logical_end_found && instr->operands.size() && !branch_exec_val_found) { /* We are in a branch that jumps according to exec. * We just found the instruction that copies to exec before the branch. */ @@ -649,8 +645,7 @@ eliminate_useless_exec_writes_in_block(ssa_elimination_ctx& ctx, Block& block) /* See if we can optimize the instruction that produces the exec mask. */ if (branch_exec_val_idx != -1) { - assert(logical_end_found && branch_reads_exec && branch_exec_tempid && - branch_exec_copy_idx != -1); + assert(logical_end_found && branch_exec_tempid && branch_exec_copy_idx != -1); try_optimize_branching_sequence(ctx, block, branch_exec_val_idx, branch_exec_copy_idx); } |