Mesa (main): aco: fix validation of SOP1 instructions without definitions

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jun 20 07:33:53 UTC 2022


Module: Mesa
Branch: main
Commit: 5485bf7b1bd2f88ecb19c10777a09858a9624b1c
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=5485bf7b1bd2f88ecb19c10777a09858a9624b1c

Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Date:   Thu Jun 16 14:49:24 2022 +0200

aco: fix validation of SOP1 instructions without definitions

Like s_setpc_b64.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17082>

---

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

diff --git a/src/amd/compiler/aco_validate.cpp b/src/amd/compiler/aco_validate.cpp
index f0da221f356..dd474ef422f 100644
--- a/src/amd/compiler/aco_validate.cpp
+++ b/src/amd/compiler/aco_validate.cpp
@@ -379,8 +379,9 @@ validate_ir(Program* program)
             }
 
             if (instr->isSOP1() || instr->isSOP2()) {
-               check(instr->definitions[0].getTemp().type() == RegType::sgpr,
-                     "Wrong Definition type for SALU instruction", instr.get());
+               if (!instr->definitions.empty())
+                  check(instr->definitions[0].getTemp().type() == RegType::sgpr,
+                        "Wrong Definition type for SALU instruction", instr.get());
                for (const Operand& op : instr->operands) {
                   check(op.isConstant() || op.regClass().type() <= RegType::sgpr,
                         "Wrong Operand type for SALU instruction", instr.get());



More information about the mesa-commit mailing list