summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimur Kristóf <timur.kristof@gmail.com>2023-04-02 22:08:51 +0200
committerDylan Baker <dylan.c.baker@intel.com>2023-04-05 10:13:57 -0700
commit1ea135b8420c1f68a02b15f5defd515e9de6356a (patch)
tree734f97aeb5447a21b8e95697522685626738044b
parentd55ee3cf60e59559b9c275920f95770dbc8ac2e9 (diff)
downloadmesa-1ea135b8420c1f68a02b15f5defd515e9de6356a.tar.gz
aco: Consider p_cbranch_nz as divergent branch too.
A p_cbranch_nz instruction that reads exec is divergent too. Fixes: f030b75b7d2c359b90c18ee4ed83fa05265c12e0 Reviewed-by: Daniel Schürmann <daniel@schuermann.dev> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21493> (cherry picked from commit 54da8639569776486db1ae11c53c94263ed5edf5)
-rw-r--r--.pick_status.json2
-rw-r--r--src/amd/compiler/aco_lower_to_hw_instr.cpp3
2 files changed, 3 insertions, 2 deletions
diff --git a/.pick_status.json b/.pick_status.json
index ed84e34bc50..1b2b8ccc3ac 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -85,7 +85,7 @@
"description": "aco: Consider p_cbranch_nz as divergent branch too.",
"nominated": true,
"nomination_type": 1,
- "resolution": 0,
+ "resolution": 1,
"main_sha": null,
"because_sha": "f030b75b7d2c359b90c18ee4ed83fa05265c12e0"
},
diff --git a/src/amd/compiler/aco_lower_to_hw_instr.cpp b/src/amd/compiler/aco_lower_to_hw_instr.cpp
index 97bace94960..4b03df5c73d 100644
--- a/src/amd/compiler/aco_lower_to_hw_instr.cpp
+++ b/src/amd/compiler/aco_lower_to_hw_instr.cpp
@@ -2622,7 +2622,8 @@ lower_to_hw_instr(Program* program)
} else if (instr->isBranch()) {
Pseudo_branch_instruction* branch = &instr->branch();
const uint32_t target = branch->target[0];
- const bool uniform_branch = !(branch->opcode == aco_opcode::p_cbranch_z &&
+ const bool uniform_branch = !((branch->opcode == aco_opcode::p_cbranch_z ||
+ branch->opcode == aco_opcode::p_cbranch_nz) &&
branch->operands[0].physReg() == exec);
/* Check if the branch instruction can be removed.