From fc1b26f4dca872de0d0a871470d3501fd9367ee3 Mon Sep 17 00:00:00 2001 From: Yonggang Luo Date: Mon, 11 Aug 2025 21:32:44 +0800 Subject: [PATCH] aco: Fixes warning note: ambiguity is between a regular call to this operator and a call with the argument order reversed ../../src/amd/compiler/aco_util.h:300:9: note: ambiguity is between a regular call to this operator and a call with the argument order reversed 300 | bool operator==(const monotonic_buffer_resource& other) { return buffer == other.buffer; } Signed-off-by: Yonggang Luo Reviewed-by: Georg Lehmann Part-of: --- src/amd/compiler/aco_insert_NOPs.cpp | 6 +++--- src/amd/compiler/aco_util.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/amd/compiler/aco_insert_NOPs.cpp b/src/amd/compiler/aco_insert_NOPs.cpp index 91291d38afc..1872dc92634 100644 --- a/src/amd/compiler/aco_insert_NOPs.cpp +++ b/src/amd/compiler/aco_insert_NOPs.cpp @@ -45,7 +45,7 @@ struct NOP_ctx_gfx6 { } } - bool operator==(const NOP_ctx_gfx6& other) + bool operator==(const NOP_ctx_gfx6& other) const { return set_vskip_mode_then_vector == other.set_vskip_mode_then_vector && valu_wr_vcc_then_div_fmas == other.valu_wr_vcc_then_div_fmas && @@ -152,7 +152,7 @@ struct NOP_ctx_gfx10 { waits_since_fp_atomic = std::min(waits_since_fp_atomic, other.waits_since_fp_atomic); } - bool operator==(const NOP_ctx_gfx10& other) + bool operator==(const NOP_ctx_gfx10& other) const { return has_VOPC_write_exec == other.has_VOPC_write_exec && has_nonVALU_exec_read == other.has_nonVALU_exec_read && has_VMEM == other.has_VMEM && @@ -292,7 +292,7 @@ struct NOP_ctx_gfx11 { sgpr_read_by_valu_then_wr_by_salu.join_min(other.sgpr_read_by_valu_then_wr_by_salu); } - bool operator==(const NOP_ctx_gfx11& other) + bool operator==(const NOP_ctx_gfx11& other) const { return has_Vcmpx == other.has_Vcmpx && vgpr_used_by_vmem_load == other.vgpr_used_by_vmem_load && diff --git a/src/amd/compiler/aco_util.h b/src/amd/compiler/aco_util.h index 9e62bc4733d..910feb0ca9c 100644 --- a/src/amd/compiler/aco_util.h +++ b/src/amd/compiler/aco_util.h @@ -297,7 +297,7 @@ public: buffer->current_idx = 0; } - bool operator==(const monotonic_buffer_resource& other) { return buffer == other.buffer; } + bool operator==(const monotonic_buffer_resource& other) const { return buffer == other.buffer; } private: struct Buffer {