aco: fix incorrect cast in parse_wait_instr()
authorRhys Perry <pendingchaos02@gmail.com>
Wed, 27 Nov 2019 17:11:58 +0000 (17:11 +0000)
committerRhys Perry <pendingchaos02@gmail.com>
Fri, 29 Nov 2019 17:46:01 +0000 (17:46 +0000)
s_waitcnt is SOPP, not SOPK

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

index f352101364034fd52669912c3db75284e9323457..7960902d6907361efdc6fc27db505d015ef861f3 100644 (file)
@@ -359,7 +359,7 @@ wait_imm parse_wait_instr(wait_ctx& ctx, Instruction *instr)
       imm.vs = std::min<uint8_t>(imm.vs, static_cast<SOPK_instruction*>(instr)->imm);
       return imm;
    } else if (instr->opcode == aco_opcode::s_waitcnt) {
-      return wait_imm(ctx.chip_class, static_cast<SOPK_instruction*>(instr)->imm);
+      return wait_imm(ctx.chip_class, static_cast<SOPP_instruction*>(instr)->imm);
    }
    return wait_imm();
 }