aco: Determine whether a few more instructions need exec.
authorTimur Kristóf <timur.kristof@gmail.com>
Fri, 7 May 2021 07:37:59 +0000 (09:37 +0200)
committerMarge Bot <eric+marge@anholt.net>
Tue, 18 May 2021 11:48:22 +0000 (11:48 +0000)
These don't really need the exec mask (and never have), but we haven't
needed to include them in needs_exec_mask yet.

No Fossil DB changes.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Tony Wasserka <tony.wasserka@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10691>

src/amd/compiler/aco_ir.cpp

index 458bf79..8aab589 100644 (file)
@@ -447,9 +447,9 @@ uint32_t get_reduction_identity(ReduceOp op, unsigned idx)
 }
 
 bool needs_exec_mask(const Instruction* instr) {
-   if (instr->isSALU())
+   if (instr->isSALU() || instr->isBranch())
       return instr->reads_exec();
-   if (instr->isSMEM() || instr->isSALU())
+   if (instr->isSMEM())
       return false;
    if (instr->isBarrier())
       return false;
@@ -459,6 +459,8 @@ bool needs_exec_mask(const Instruction* instr) {
       case aco_opcode::p_create_vector:
       case aco_opcode::p_extract_vector:
       case aco_opcode::p_split_vector:
+      case aco_opcode::p_phi:
+      case aco_opcode::p_parallelcopy:
          for (Definition def : instr->definitions) {
             if (def.getTemp().type() == RegType::vgpr)
                return true;
@@ -466,6 +468,9 @@ bool needs_exec_mask(const Instruction* instr) {
          return false;
       case aco_opcode::p_spill:
       case aco_opcode::p_reload:
+      case aco_opcode::p_logical_start:
+      case aco_opcode::p_logical_end:
+      case aco_opcode::p_startpgm:
          return false;
       default:
          break;