diff options
author | Timur Kristóf <[email protected]> | 2020-03-18 10:40:06 +0100 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-04-24 17:58:57 +0000 |
commit | 0c0691d43eb1fd6071e6f7fe535242206cb1706f (patch) | |
tree | 231f47a651758c63721f70b6c0a5fdae5884c2db /src | |
parent | f321dc33c82635b5190845e59553ccb3ccfd332f (diff) |
aco: Const correctness for get_barrier_interaction.
Signed-off-by: Timur Kristóf <[email protected]>
Reviewed-by: Rhys Perry <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4536>
Diffstat (limited to 'src')
-rw-r--r-- | src/amd/compiler/aco_ir.h | 2 | ||||
-rw-r--r-- | src/amd/compiler/aco_scheduler.cpp | 20 |
2 files changed, 11 insertions, 11 deletions
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<Instruction>& 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<uint16_t>& 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<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: |