From aea41a56bd5bfd0b7c0aa243231f2f29d22a60d2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Timur=20Krist=C3=B3f?= Date: Fri, 24 Jan 2020 15:17:44 +0100 Subject: [PATCH] aco/gfx10: Fix VcmpxExecWARHazard mitigation. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The SOPP instruction shouldn't have a definition, and its block should be set to -1 in order to prevent it from being recognized as a branch. Also fix a typo in the readme. Fixes: d6dfce02d074d615a3b88a3fccd8ee8c7e13c010 Signed-off-by: Timur Kristóf Reviewed-by: Rhys Perry Tested-by: Marge Bot Part-of: (cherry picked from commit c787b8d2a16d5e2950f209b1fcbec6e6c0388845) --- .pick_status.json | 2 +- src/amd/compiler/README.md | 1 - src/amd/compiler/aco_insert_NOPs.cpp | 4 ++-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index b4c3d7028e9..931c9f166b6 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -4,7 +4,7 @@ "description": "aco/gfx10: Fix VcmpxExecWARHazard mitigation.", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "master_sha": null, "because_sha": "d6dfce02d074d615a3b88a3fccd8ee8c7e13c010" }, diff --git a/src/amd/compiler/README.md b/src/amd/compiler/README.md index 822ecd79cbc..7c7e68f458e 100644 --- a/src/amd/compiler/README.md +++ b/src/amd/compiler/README.md @@ -154,7 +154,6 @@ A VALU instruction or an `s_waitcnt vmcnt(0)` between the two instructions. Triggered by: An SMEM instruction reads an SGPR. Then, a VALU instruction writes that same SGPR. -Despite LLVM Mitigated by: Any non-SOPP SALU instruction (except `s_setvskip`, `s_version`, and any non-lgkmcnt `s_waitcnt`). diff --git a/src/amd/compiler/aco_insert_NOPs.cpp b/src/amd/compiler/aco_insert_NOPs.cpp index 2422db828f7..76b7dddc6cd 100644 --- a/src/amd/compiler/aco_insert_NOPs.cpp +++ b/src/amd/compiler/aco_insert_NOPs.cpp @@ -455,9 +455,9 @@ void handle_instruction_gfx10(Program *program, NOP_ctx_gfx10 &ctx, aco_ptr depctr{create_instruction(aco_opcode::s_waitcnt_depctr, Format::SOPP, 0, 1)}; + aco_ptr depctr{create_instruction(aco_opcode::s_waitcnt_depctr, Format::SOPP, 0, 0)}; depctr->imm = 0xfffe; - depctr->definitions[0] = Definition(sgpr_null, s1); + depctr->block = -1; new_instructions.emplace_back(std::move(depctr)); } else if (instr_writes_sgpr(instr)) { /* Any VALU instruction that writes an SGPR mitigates the problem */ -- 2.11.0