From cc742562c133672c989b155d58ddc6794f9b67b8 Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Wed, 27 Nov 2019 17:15:54 +0000 Subject: [PATCH] aco: don't enable store_global for helper invocations MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Rhys Perry Reviewed-by: Daniel Schürmann --- src/amd/compiler/aco_insert_exec_mask.cpp | 3 +++ src/amd/compiler/aco_instruction_selection.cpp | 2 ++ src/amd/compiler/aco_ir.h | 1 + src/amd/compiler/aco_print_ir.cpp | 2 ++ 4 files changed, 8 insertions(+) diff --git a/src/amd/compiler/aco_insert_exec_mask.cpp b/src/amd/compiler/aco_insert_exec_mask.cpp index c2693608a1a..ba0d1f04a01 100644 --- a/src/amd/compiler/aco_insert_exec_mask.cpp +++ b/src/amd/compiler/aco_insert_exec_mask.cpp @@ -134,6 +134,9 @@ bool needs_exact(aco_ptr& instr) { } else if (instr->format == Format::MIMG) { MIMG_instruction *mimg = static_cast(instr.get()); return mimg->disable_wqm; + } else if (instr->format == Format::FLAT || instr->format == Format::GLOBAL) { + FLAT_instruction *flat = static_cast(instr.get()); + return flat->disable_wqm; } else { return instr->format == Format::EXP || instr->opcode == aco_opcode::p_fs_buffer_store_smem; } diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp index cb33814f17f..60963060dea 100644 --- a/src/amd/compiler/aco_instruction_selection.cpp +++ b/src/amd/compiler/aco_instruction_selection.cpp @@ -4764,6 +4764,8 @@ void visit_store_global(isel_context *ctx, nir_intrinsic_instr *instr) flat->glc = glc; flat->dlc = false; flat->offset = offset; + flat->disable_wqm = true; + ctx->program->needs_exact = true; ctx->block->instructions.emplace_back(std::move(flat)); } } diff --git a/src/amd/compiler/aco_ir.h b/src/amd/compiler/aco_ir.h index 98d59ea2d63..60f06393aa5 100644 --- a/src/amd/compiler/aco_ir.h +++ b/src/amd/compiler/aco_ir.h @@ -850,6 +850,7 @@ struct FLAT_instruction : public Instruction { bool dlc; /* NAVI: device level coherent */ bool lds; bool nv; + bool disable_wqm; }; struct Export_instruction : public Instruction { diff --git a/src/amd/compiler/aco_print_ir.cpp b/src/amd/compiler/aco_print_ir.cpp index f641a21da34..5ced1d2d7bb 100644 --- a/src/amd/compiler/aco_print_ir.cpp +++ b/src/amd/compiler/aco_print_ir.cpp @@ -371,6 +371,8 @@ static void print_instr_format_specific(struct Instruction *instr, FILE *output) fprintf(output, " lds"); if (flat->nv) fprintf(output, " nv"); + if (flat->disable_wqm) + fprintf(output, " disable_wqm"); break; } case Format::MTBUF: { -- 2.30.2