summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>2022-06-16 14:49:24 +0200
committerDylan Baker <dylan.c.baker@intel.com>2022-06-23 09:18:23 -0700
commit683d2243296f7a6a5b7e2670ccc988d76276b6c2 (patch)
tree581e89e1a7c1edb9db7a000b2f5bbab795434d73
parent404838a3336f3fcaceb6273f04f468a07b75ce62 (diff)
aco: fix validation of SOP1 instructions without definitions
Like s_setpc_b64. Cc: mesa-stable Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Timur Kristóf <timur.kristof@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17082> (cherry picked from commit 5485bf7b1bd2f88ecb19c10777a09858a9624b1c)
-rw-r--r--.pick_status.json2
-rw-r--r--src/amd/compiler/aco_validate.cpp5
2 files changed, 4 insertions, 3 deletions
diff --git a/.pick_status.json b/.pick_status.json
index a303108430c..62d091da9e9 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -1435,7 +1435,7 @@
"description": "aco: fix validation of SOP1 instructions without definitions",
"nominated": true,
"nomination_type": 0,
- "resolution": 0,
+ "resolution": 1,
"main_sha": null,
"because_sha": null
},
diff --git a/src/amd/compiler/aco_validate.cpp b/src/amd/compiler/aco_validate.cpp
index 6f76b42995d..4d0dcb66ac4 100644
--- a/src/amd/compiler/aco_validate.cpp
+++ b/src/amd/compiler/aco_validate.cpp
@@ -378,8 +378,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());