Mesa (master): aco: fix outdated label_vec from p_create_vector labelling

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Apr 24 12:32:42 UTC 2020


Module: Mesa
Branch: master
Commit: ede1c171c550a48a7957af091e7ac84e088bc6ba
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ede1c171c550a48a7957af091e7ac84e088bc6ba

Author: Rhys Perry <pendingchaos02 at gmail.com>
Date:   Fri Apr 24 11:58:17 2020 +0100

aco: fix outdated label_vec from p_create_vector labelling

Fixes random dEQP-VK.transform_feedback.fuzz.* crashes.

Signed-off-by: Rhys Perry <pendingchaos02 at gmail.com>
Reviewed-by: Daniel Schürmann <daniel at schuermann.dev>
Fixes: 2dc550202e82c5da198ad0a416a5d24dd89addd8
    ('aco: copy-propagate p_create_vector copies of vectors')

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4730>

---

 src/amd/compiler/aco_optimizer.cpp | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/amd/compiler/aco_optimizer.cpp b/src/amd/compiler/aco_optimizer.cpp
index 7c9eb3e1100..ac9e5ff399d 100644
--- a/src/amd/compiler/aco_optimizer.cpp
+++ b/src/amd/compiler/aco_optimizer.cpp
@@ -898,10 +898,9 @@ void label_instruction(opt_ctx &ctx, Block& block, aco_ptr<Instruction>& instr)
 
    switch (instr->opcode) {
    case aco_opcode::p_create_vector: {
-      if (instr->operands.size() == 1 && instr->operands[0].isTemp())
+      bool copy_prop = instr->operands.size() == 1 && instr->operands[0].isTemp();
+      if (copy_prop)
          ctx.info[instr->definitions[0].tempId()].set_temp(instr->operands[0].getTemp());
-      else
-         ctx.info[instr->definitions[0].tempId()].set_vec(instr.get());
 
       unsigned num_ops = instr->operands.size();
       for (const Operand& op : instr->operands) {
@@ -928,6 +927,9 @@ void label_instruction(opt_ctx &ctx, Block& block, aco_ptr<Instruction>& instr)
          }
          assert(k == num_ops);
       }
+
+      if (!copy_prop)
+         ctx.info[instr->definitions[0].tempId()].set_vec(instr.get());
       break;
    }
    case aco_opcode::p_split_vector: {



More information about the mesa-commit mailing list