From 4544490df01ab077f04ec98f055c8323ec535048 Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Thu, 21 Jul 2022 16:16:16 +0100 Subject: [PATCH] aco: limit hard clauses to 63 instructions MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit See https://reviews.llvm.org/D127391 fossil-db (gfx1100): Totals from 4 (0.00% of 161689) affected shaders: Latency: 24545 -> 24539 (-0.02%) InvThroughput: 102867 -> 102835 (-0.03%) fossil-db (navi10): Totals from 4 (0.00% of 161220) affected shaders: Latency: 25969 -> 25959 (-0.04%) InvThroughput: 112917 -> 112869 (-0.04%) Signed-off-by: Rhys Perry Reviewed-by: Daniel Schürmann Part-of: --- src/amd/compiler/aco_form_hard_clauses.cpp | 4 ++-- src/amd/compiler/tests/test_hard_clause.cpp | 30 ++++++++++++++--------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/amd/compiler/aco_form_hard_clauses.cpp b/src/amd/compiler/aco_form_hard_clauses.cpp index c32a813..32c0b56 100644 --- a/src/amd/compiler/aco_form_hard_clauses.cpp +++ b/src/amd/compiler/aco_form_hard_clauses.cpp @@ -248,7 +248,7 @@ form_hard_clauses(Program* program) { for (Block& block : program->blocks) { unsigned num_instrs = 0; - aco_ptr current_instrs[64]; + aco_ptr current_instrs[63]; clause_type current_type = clause_other; std::vector> new_instructions; @@ -259,7 +259,7 @@ form_hard_clauses(Program* program) aco_ptr& instr = block.instructions[i]; clause_type type = get_type(program, instr); - if (type != current_type || num_instrs == 64 || + if (type != current_type || num_instrs == 63 || (num_instrs && !should_form_clause(current_instrs[0].get(), instr.get()))) { emit_clause(bld, num_instrs, current_instrs); num_instrs = 0; diff --git a/src/amd/compiler/tests/test_hard_clause.cpp b/src/amd/compiler/tests/test_hard_clause.cpp index 5274c24..d6b5a6b 100644 --- a/src/amd/compiler/tests/test_hard_clause.cpp +++ b/src/amd/compiler/tests/test_hard_clause.cpp @@ -173,30 +173,30 @@ BEGIN_TEST(form_hard_clauses.size) create_smem(); //>> p_unit_test 1 - //! s_clause imm:63 - //; for i in range(64): + //! s_clause imm:62 + //; for i in range(63): //; search_re('s_load_dword') bld.pseudo(aco_opcode::p_unit_test, Operand::c32(1u)); - for (unsigned i = 0; i < 64; i++) + for (unsigned i = 0; i < 63; i++) create_smem(); //>> p_unit_test 2 - //! s_clause imm:63 - //; for i in range(65): + //! s_clause imm:62 + //; for i in range(64): //; search_re('s_load_dword') bld.pseudo(aco_opcode::p_unit_test, Operand::c32(2u)); - for (unsigned i = 0; i < 65; i++) + for (unsigned i = 0; i < 64; i++) create_smem(); //>> p_unit_test 3 - //! s_clause imm:63 - //; for i in range(64): + //! s_clause imm:62 + //; for i in range(63): //; search_re('s_load_dword') //! s_clause imm:1 //; search_re('s_load_dword') //; search_re('s_load_dword') bld.pseudo(aco_opcode::p_unit_test, Operand::c32(3u)); - for (unsigned i = 0; i < 66; i++) + for (unsigned i = 0; i < 65; i++) create_smem(); finish_form_hard_clause_test(); @@ -370,22 +370,22 @@ BEGIN_TEST(form_hard_clauses.stores) /* Unimportant pass limitations */ //>> p_unit_test 4 //; search_re('buffer_store_dword') - //! s_clause imm:62 - //; for i in range(63): + //! s_clause imm:61 + //; for i in range(62): //; search_re('buffer_load_dword') //; search_re('buffer_load_dword') bld.pseudo(aco_opcode::p_unit_test, Operand::c32(4u)); create_mubuf_store(); - for (unsigned i = 0; i < 64; i++) + for (unsigned i = 0; i < 63; i++) create_mubuf(); //>> p_unit_test 5 - //! s_clause imm:63 - //; for i in range(64): + //! s_clause imm:62 + //; for i in range(63): //; search_re('buffer_load_dword') //; search_re('buffer_store_dword') bld.pseudo(aco_opcode::p_unit_test, Operand::c32(5u)); - for (unsigned i = 0; i < 64; i++) + for (unsigned i = 0; i < 63; i++) create_mubuf(); create_mubuf_store(); -- 2.7.4