Mesa (main): aco: Determine whether a few more instructions need exec.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue May 18 11:59:49 UTC 2021


Module: Mesa
Branch: main
Commit: 662bbf6ad4948caa364bda2c8e3a1edc3a2f961a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=662bbf6ad4948caa364bda2c8e3a1edc3a2f961a

Author: Timur Kristóf <timur.kristof at gmail.com>
Date:   Fri May  7 09:37:59 2021 +0200

aco: Determine whether a few more instructions need exec.

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 at gmail.com>
Reviewed-by: Tony Wasserka <tony.wasserka at gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10691>

---

 src/amd/compiler/aco_ir.cpp | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/amd/compiler/aco_ir.cpp b/src/amd/compiler/aco_ir.cpp
index 458bf7981e4..8aab589a458 100644
--- a/src/amd/compiler/aco_ir.cpp
+++ b/src/amd/compiler/aco_ir.cpp
@@ -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;



More information about the mesa-commit mailing list