diff options
author | Timur Kristóf <timur.kristof@gmail.com> | 2021-10-28 15:48:19 +0200 |
---|---|---|
committer | Dylan Baker <dylan.c.baker@intel.com> | 2021-11-24 15:47:19 -0800 |
commit | f1cc4c5d93d9cd98517bec9a82f0b7d4d4c3dbf6 (patch) | |
tree | 23e68746e538a4d30e52951f2fd1639fba299b49 | |
parent | c2e8997096314a228ecc4a1ea55a76ba75c5418b (diff) |
aco: Fix how p_is_helper interacts with optimizations.
p_is_helper doesn't have any operands, so ACO's value numbering and/or
the pre-RA optimizer could incorrectly recognize two such instructions
as the same.
This patch adds exec as an operand to p_is_helper in order to achieve
correct behavior.
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5570
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13577>
(cherry picked from commit d80c7f3406b80ae684a709de57a9ef3d54a497b6)
-rw-r--r-- | .pick_status.json | 2 | ||||
-rw-r--r-- | src/amd/compiler/aco_instruction_selection.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/.pick_status.json b/.pick_status.json index 20734856813..88d9456b3fe 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -3190,7 +3190,7 @@ "description": "aco: Fix how p_is_helper interacts with optimizations.", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null }, diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp index 88c0d3657d2..3259e0123a2 100644 --- a/src/amd/compiler/aco_instruction_selection.cpp +++ b/src/amd/compiler/aco_instruction_selection.cpp @@ -8690,7 +8690,7 @@ visit_intrinsic(isel_context* ctx, nir_intrinsic_instr* instr) /* load_helper() after demote() get lowered to is_helper(). * Otherwise, these two behave the same. */ Temp dst = get_ssa_temp(ctx, &instr->dest.ssa); - bld.pseudo(aco_opcode::p_is_helper, Definition(dst)); + bld.pseudo(aco_opcode::p_is_helper, Definition(dst), Operand(exec, bld.lm)); ctx->block->kind |= block_kind_needs_lowering; ctx->program->needs_exact = true; break; |