elk: Increase the size of some structure fields in combine_constants

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: 2dad1e3abd ("i965/fs: Add pass to combine immediates.")
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37482>
This commit is contained in:
Ian Romanick
2025-09-19 10:19:43 -07:00
committed by Marge Bot
parent b7e1ac8309
commit 3e04990c68
@@ -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;