Module: Mesa
Branch: staging/20.0
Commit: 275e9392999d7c4fead31285f43758b28df23f2d
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=275e9392999d7c4fead31285f43758b28df23f2d

Author: Rhys Perry <[email protected]>
Date:   Fri Jan 31 12:41:19 2020 +0000

aco: handle missing second predecessors at merge block phis

Signed-off-by: Rhys Perry <[email protected]>
CC: <[email protected]>
Reviewed-by: Daniel Schürmann <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3658>
(cherry picked from commit f2c4878de9f2acfd7b23ed2deea1af094b781c7d)

---

 .pick_status.json                              | 2 +-
 src/amd/compiler/aco_instruction_selection.cpp | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/.pick_status.json b/.pick_status.json
index 2b97427be4b..c7b5ab0bc1f 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -499,7 +499,7 @@
         "description": "aco: handle missing second predecessors at merge block 
phis",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "master_sha": null,
         "because_sha": null
     },
diff --git a/src/amd/compiler/aco_instruction_selection.cpp 
b/src/amd/compiler/aco_instruction_selection.cpp
index 8abcb878bfb..4f1f7751572 100644
--- a/src/amd/compiler/aco_instruction_selection.cpp
+++ b/src/amd/compiler/aco_instruction_selection.cpp
@@ -7685,6 +7685,10 @@ void visit_phi(isel_context *ctx, nir_phi_instr *instr)
             continue;
          }
       }
+      /* Handle missing predecessors at the end. This shouldn't happen with 
loop
+       * headers and we can't ignore these sources for loop header phis. */
+      if (!(ctx->block->kind & block_kind_loop_header) && cur_pred_idx >= 
preds.size())
+         continue;
       cur_pred_idx++;
       Operand op = get_phi_operand(ctx, src.second);
       operands[num_operands++] = op;

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to