brw: Add brw_reg::is_grf

v2: Add a function comment. Suggested by Caio.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38315>
This commit is contained in:
Ian Romanick 2025-02-26 10:02:55 -08:00
parent fa8b0b6bbb
commit c0fb93506b
2 changed files with 12 additions and 2 deletions

View file

@ -704,8 +704,7 @@ try_copy_propagate(brw_shader &s, brw_inst *inst,
const struct intel_device_info *devinfo = s.devinfo;
assert(entry->src.file == VGRF || entry->src.file == UNIFORM ||
entry->src.file == ATTR || entry->src.file == FIXED_GRF);
assert(entry->src.is_grf());
/* Avoid propagating a LOAD_PAYLOAD instruction into another if there is a
* good chance that we'll be able to eliminate the latter through register

View file

@ -233,6 +233,17 @@ typedef struct brw_reg {
bool is_ip() const { return brw_reg_is_arf(*this, BRW_ARF_IP); }
bool is_address() const;
/**
* These are all the things that will eventually become FIXED_GRF. The
* things that will live in regular registers can, for the most part, be
* treated the same by optimization passes.
*/
bool is_grf() const
{
return file == FIXED_GRF || file == VGRF || file == ATTR ||
file == UNIFORM;
}
unsigned address_slot(unsigned byte_offset) const;
/**