return is_phi(instr.get());
}
-barrier_interaction get_barrier_interaction(Instruction* instr);
+barrier_interaction get_barrier_interaction(const Instruction* instr);
bool is_dead(const std::vector<uint16_t>& uses, Instruction *instr);
}
}
-bool is_gs_or_done_sendmsg(Instruction *instr)
+bool is_gs_or_done_sendmsg(const Instruction *instr)
{
if (instr->opcode == aco_opcode::s_sendmsg) {
- uint16_t imm = static_cast<SOPP_instruction*>(instr)->imm;
+ uint16_t imm = static_cast<const SOPP_instruction*>(instr)->imm;
return (imm & sendmsg_id_mask) == _sendmsg_gs ||
(imm & sendmsg_id_mask) == _sendmsg_gs_done;
}
return false;
}
-bool is_done_sendmsg(Instruction *instr)
+bool is_done_sendmsg(const Instruction *instr)
{
if (instr->opcode == aco_opcode::s_sendmsg) {
- uint16_t imm = static_cast<SOPP_instruction*>(instr)->imm;
+ uint16_t imm = static_cast<const SOPP_instruction*>(instr)->imm;
return (imm & sendmsg_id_mask) == _sendmsg_gs_done;
}
return false;
}
-barrier_interaction get_barrier_interaction(Instruction* instr)
+barrier_interaction get_barrier_interaction(const Instruction* instr)
{
switch (instr->format) {
case Format::SMEM:
- return static_cast<SMEM_instruction*>(instr)->barrier;
+ return static_cast<const SMEM_instruction*>(instr)->barrier;
case Format::MUBUF:
- return static_cast<MUBUF_instruction*>(instr)->barrier;
+ return static_cast<const MUBUF_instruction*>(instr)->barrier;
case Format::MIMG:
- return static_cast<MIMG_instruction*>(instr)->barrier;
+ return static_cast<const MIMG_instruction*>(instr)->barrier;
case Format::MTBUF:
- return static_cast<MTBUF_instruction*>(instr)->barrier;
+ return static_cast<const MTBUF_instruction*>(instr)->barrier;
case Format::FLAT:
case Format::GLOBAL:
case Format::SCRATCH:
- return static_cast<FLAT_instruction*>(instr)->barrier;
+ return static_cast<const FLAT_instruction*>(instr)->barrier;
case Format::DS:
return barrier_shared;
case Format::SOPP: