From: Timur Kristóf Date: Wed, 18 Mar 2020 09:40:06 +0000 (+0100) Subject: aco: Const correctness for get_barrier_interaction. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0c0691d43eb1fd6071e6f7fe535242206cb1706f;p=mesa.git aco: Const correctness for get_barrier_interaction. Signed-off-by: Timur Kristóf Reviewed-by: Rhys Perry Part-of: --- diff --git a/src/amd/compiler/aco_ir.h b/src/amd/compiler/aco_ir.h index e8dbbf0534a..7769355eab9 100644 --- a/src/amd/compiler/aco_ir.h +++ b/src/amd/compiler/aco_ir.h @@ -1210,7 +1210,7 @@ static inline bool is_phi(aco_ptr& instr) 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& uses, Instruction *instr); diff --git a/src/amd/compiler/aco_scheduler.cpp b/src/amd/compiler/aco_scheduler.cpp index d07b4e381ab..c1d4e9b3ce8 100644 --- a/src/amd/compiler/aco_scheduler.cpp +++ b/src/amd/compiler/aco_scheduler.cpp @@ -338,40 +338,40 @@ bool can_reorder(Instruction* candidate) } } -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(instr)->imm; + uint16_t imm = static_cast(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(instr)->imm; + uint16_t imm = static_cast(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(instr)->barrier; + return static_cast(instr)->barrier; case Format::MUBUF: - return static_cast(instr)->barrier; + return static_cast(instr)->barrier; case Format::MIMG: - return static_cast(instr)->barrier; + return static_cast(instr)->barrier; case Format::MTBUF: - return static_cast(instr)->barrier; + return static_cast(instr)->barrier; case Format::FLAT: case Format::GLOBAL: case Format::SCRATCH: - return static_cast(instr)->barrier; + return static_cast(instr)->barrier; case Format::DS: return barrier_shared; case Format::SOPP: