From 3e04990c683df622fcdf915adaa255057637543b Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Fri, 19 Sep 2025 10:19:43 -0700 Subject: [PATCH] elk: Increase the size of some structure fields in combine_constants MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In very large shaders, first_use_ip, last_use_ip, and even (register) nr can overflow 16 bits. Increase the size of these fields. Some structure components are rearranged to promote better packing. Fixes: 2dad1e3abdb ("i965/fs: Add pass to combine immediates.") Reviewed-by: Alyssa Rosenzweig Reviewed-by: Tapani Pälli Part-of: --- .../compiler/elk/elk_fs_combine_constants.cpp | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/intel/compiler/elk/elk_fs_combine_constants.cpp b/src/intel/compiler/elk/elk_fs_combine_constants.cpp index 45d7b218e40..76873fa35dd 100644 --- a/src/intel/compiler/elk/elk_fs_combine_constants.cpp +++ b/src/intel/compiler/elk/elk_fs_combine_constants.cpp @@ -861,13 +861,6 @@ struct imm { /** When promoting half-float we need to account for certain restrictions */ bool is_half_float; - /** - * The GRF register and subregister number where we've decided to store the - * constant value. - */ - uint8_t subreg_offset; - uint16_t nr; - /** The number of coissuable instructions using this immediate. */ uint16_t uses_by_coissue; @@ -880,8 +873,15 @@ struct imm { /** Is the value used only in a single basic block? */ bool used_in_single_block; - uint16_t first_use_ip; - uint16_t last_use_ip; + /** + * The GRF register and subregister number where we've decided to store the + * constant value. + */ + uint8_t subreg_offset; + uint32_t nr; + + uint32_t first_use_ip; + uint32_t last_use_ip; }; /** The working set of information about immediates. */ @@ -1347,7 +1347,7 @@ elk_fs_visitor::opt_combine_constants() imm->must_promote = false; imm->is_half_float = false; - imm->first_use_ip = UINT16_MAX; + imm->first_use_ip = UINT32_MAX; imm->last_use_ip = 0; imm->uses = new(const_ctx) brw_exec_list;