From 0c0691d43eb1fd6071e6f7fe535242206cb1706f Mon Sep 17 00:00:00 2001 From: Timur Kristóf Date: Wed, 18 Mar 2020 10:40:06 +0100 Subject: aco: Const correctness for get_barrier_interaction. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Timur Kristóf Reviewed-by: Rhys Perry Part-of: --- src/amd/compiler/aco_ir.h | 2 +- src/amd/compiler/aco_scheduler.cpp | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'src') 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: -- cgit v1.2.3