From 562e89ff0de456f85e3fd85741636f74087d73b3 Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Wed, 14 Oct 2020 21:42:01 +0100 Subject: [PATCH] aco: ignore the ACO-inserted continue in create_continue_phis() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise, for loops without continue_or_break, create_continue_phis() always returns an undef operand. Signed-off-by: Rhys Perry Reviewed-by: Daniel Schürmann Fixes: 638cbc21a1c ("aco: handle when ACO adds new continue edges") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2848 Part-of: (cherry picked from commit 26e53e3afa7ee971fc0e686d2d00c5941264be1f) --- .pick_status.json | 2 +- 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 fb4a52a8930..b49b654e485 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1300,7 +1300,7 @@ "description": "aco: ignore the ACO-inserted continue in create_continue_phis()", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "master_sha": null, "because_sha": "638cbc21a1c01c87f620edc820e913e48aba2287" }, diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp index 8b716841710..c2a8ab675eb 100644 --- a/src/amd/compiler/aco_instruction_selection.cpp +++ b/src/amd/compiler/aco_instruction_selection.cpp @@ -9431,7 +9431,7 @@ static Operand create_continue_phis(isel_context *ctx, unsigned first, unsigned continue; } - if (block.kind & block_kind_continue) { + if ((block.kind & block_kind_continue) && block.index != last) { vals[idx - first] = header_phi->operands[next_pred]; next_pred++; continue;