From d703a0e8081e9a67263e012f2c9c9729f7cb54e0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Daniel=20Sch=C3=BCrmann?= Date: Tue, 15 Mar 2022 16:28:06 +0100 Subject: [PATCH] aco: remove register hints entirely Reviewed-by: Rhys Perry Part-of: --- src/amd/compiler/aco_builder_h.py | 13 ------------- src/amd/compiler/aco_instruction_selection.cpp | 6 +++--- src/amd/compiler/aco_ir.h | 12 +----------- 3 files changed, 4 insertions(+), 27 deletions(-) diff --git a/src/amd/compiler/aco_builder_h.py b/src/amd/compiler/aco_builder_h.py index 140782f..86d247a 100644 --- a/src/amd/compiler/aco_builder_h.py +++ b/src/amd/compiler/aco_builder_h.py @@ -336,19 +336,6 @@ public: return def; } - Definition hint_${fixed}(Definition def) { - % if fixed == 'vcc' or fixed == 'exec': - //vcc_hi and exec_hi can still be used in wave32 - assert(def.regClass().type() == RegType::sgpr && def.bytes() <= 8); - % endif - def.setHint(aco::${fixed}); - return def; - } - - Definition hint_${fixed}(RegClass rc) { - return hint_${fixed}(def(rc)); - } - % endfor Operand set16bit(Operand op) { diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp index 5b3f9e5..265b772 100644 --- a/src/amd/compiler/aco_instruction_selection.cpp +++ b/src/amd/compiler/aco_instruction_selection.cpp @@ -7690,13 +7690,13 @@ emit_uniform_scan(isel_context* ctx, nir_intrinsic_instr* instr) uint32_t identity_hi = get_reduction_identity(reduce_op, 1); lo = - bld.writelane(bld.def(v1), bld.copy(bld.hint_m0(s1), Operand::c32(identity_lo)), lane, lo); + bld.writelane(bld.def(v1), bld.copy(bld.def(s1, m0), Operand::c32(identity_lo)), lane, lo); hi = - bld.writelane(bld.def(v1), bld.copy(bld.hint_m0(s1), Operand::c32(identity_hi)), lane, hi); + bld.writelane(bld.def(v1), bld.copy(bld.def(s1, m0), Operand::c32(identity_hi)), lane, hi); bld.pseudo(aco_opcode::p_create_vector, dst, lo, hi); } else { uint32_t identity = get_reduction_identity(reduce_op, 0); - bld.writelane(dst, bld.copy(bld.hint_m0(s1), Operand::c32(identity)), lane, + bld.writelane(dst, bld.copy(bld.def(s1, m0), Operand::c32(identity)), lane, as_vgpr(ctx, src)); } diff --git a/src/amd/compiler/aco_ir.h b/src/amd/compiler/aco_ir.h index 6108794..51c405a 100644 --- a/src/amd/compiler/aco_ir.h +++ b/src/amd/compiler/aco_ir.h @@ -895,8 +895,7 @@ private: class Definition final { public: constexpr Definition() - : temp(Temp(0, s1)), reg_(0), isFixed_(0), hasHint_(0), isKill_(0), isPrecise_(0), isNUW_(0), - isNoCSE_(0) + : temp(Temp(0, s1)), reg_(0), isFixed_(0), isKill_(0), isPrecise_(0), isNUW_(0), isNoCSE_(0) {} Definition(uint32_t index, RegClass type) noexcept : temp(index, type) {} explicit Definition(Temp tmp) noexcept : temp(tmp) {} @@ -932,14 +931,6 @@ public: reg_ = reg; } - constexpr void setHint(PhysReg reg) noexcept - { - hasHint_ = 1; - reg_ = reg; - } - - constexpr bool hasHint() const noexcept { return hasHint_; } - constexpr void setKill(bool flag) noexcept { isKill_ = flag; } constexpr bool isKill() const noexcept { return isKill_; } @@ -963,7 +954,6 @@ private: union { struct { uint8_t isFixed_ : 1; - uint8_t hasHint_ : 1; uint8_t isKill_ : 1; uint8_t isPrecise_ : 1; uint8_t isNUW_ : 1; -- 2.7.4