aco: Have s_waitcnt_vscnt write to NULL.
authorRhys Perry <pendingchaos02@gmail.com>
Thu, 12 Sep 2019 14:28:49 +0000 (15:28 +0100)
committerTimur Kristóf <timur.kristof@gmail.com>
Thu, 10 Oct 2019 07:57:53 +0000 (09:57 +0200)
Not sure if this instruction actually writes anything, but LLVM
disassembles a destination and sets it to NULL.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-By: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
src/amd/compiler/aco_insert_waitcnt.cpp

index 9bd9f06e6c23a85939adf6b15cae338b216749ee..8cfb4f3f695abf11213a846f2f469d064c8da87e 100644 (file)
@@ -378,7 +378,7 @@ wait_imm kill(Instruction* instr, wait_ctx& ctx)
             bar.vs = wait_imm::unset_counter;
       }
 
-      /* remove all vgprs with higher counter from map */
+      /* remove all gprs with higher counter from map */
       std::map<PhysReg,wait_entry>::iterator it = ctx.gpr_map.begin();
       while (it != ctx.gpr_map.end())
       {
@@ -616,7 +616,8 @@ void emit_waitcnt(wait_ctx& ctx, std::vector<aco_ptr<Instruction>>& instructions
 {
    if (imm.vs != wait_imm::unset_counter) {
       assert(ctx.chip_class >= GFX10);
-      SOPK_instruction* waitcnt_vs = create_instruction<SOPK_instruction>(aco_opcode::s_waitcnt_vscnt, Format::SOPK, 0, 0);
+      SOPK_instruction* waitcnt_vs = create_instruction<SOPK_instruction>(aco_opcode::s_waitcnt_vscnt, Format::SOPK, 0, 1);
+      waitcnt_vs->definitions[0] = Definition(sgpr_null, s1);
       waitcnt_vs->imm = imm.vs;
       instructions.emplace_back(waitcnt_vs);
       imm.vs = wait_imm::unset_counter;