aco: don't enable store_global for helper invocations
authorRhys Perry <pendingchaos02@gmail.com>
Wed, 27 Nov 2019 17:15:54 +0000 (17:15 +0000)
committerRhys Perry <pendingchaos02@gmail.com>
Fri, 29 Nov 2019 17:46:02 +0000 (17:46 +0000)
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
src/amd/compiler/aco_insert_exec_mask.cpp
src/amd/compiler/aco_instruction_selection.cpp
src/amd/compiler/aco_ir.h
src/amd/compiler/aco_print_ir.cpp

index c2693608a1a39c78baacbaf05da9b31b882d1662..ba0d1f04a018c9e805cfc7a75826c10e1979c88b 100644 (file)
@@ -134,6 +134,9 @@ bool needs_exact(aco_ptr<Instruction>& instr) {
    } else if (instr->format == Format::MIMG) {
       MIMG_instruction *mimg = static_cast<MIMG_instruction *>(instr.get());
       return mimg->disable_wqm;
+   } else if (instr->format == Format::FLAT || instr->format == Format::GLOBAL) {
+      FLAT_instruction *flat = static_cast<FLAT_instruction *>(instr.get());
+      return flat->disable_wqm;
    } else {
       return instr->format == Format::EXP || instr->opcode == aco_opcode::p_fs_buffer_store_smem;
    }
index cb33814f17fa357c87dacc0792b5227304bf4bf4..60963060deaad82ff15e26901005577450a222a8 100644 (file)
@@ -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));
    }
 }
index 98d59ea2d63b8012f58ca360c3931844c1700fa3..60f06393aa580b4e45a1280c1ea7bcd325d42ddb 100644 (file)
@@ -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 {
index f641a21da34d68705da0c082bab50d1f51ae0629..5ced1d2d7bb8c64e4c14aed1955af9f5f29eeeca 100644 (file)
@@ -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: {