/* 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;
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) {
/* 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.
*/
/* 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);
}