intel/compiler: Move register pressure calculation into IR analysis object
This defines a new BRW_ANALYSIS object which wraps the register pressure computation code along with its result. For the rationale see the previous commits converting the liveness and dominance analysis passes to the IR analysis framework. Reviewed-by: Matt Turner <mattst88@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4012>
This commit is contained in:

committed by
Matt Turner

parent
f6cdf66cd6
commit
e5e4d016b9
@@ -39,7 +39,34 @@ namespace {
|
||||
struct acp_entry;
|
||||
}
|
||||
|
||||
class fs_visitor;
|
||||
|
||||
namespace brw {
|
||||
/**
|
||||
* Register pressure analysis of a shader. Estimates how many registers
|
||||
* are live at any point of the program in GRF units.
|
||||
*/
|
||||
struct register_pressure {
|
||||
register_pressure(const fs_visitor *v);
|
||||
~register_pressure();
|
||||
|
||||
analysis_dependency_class
|
||||
dependency_class() const
|
||||
{
|
||||
return (DEPENDENCY_INSTRUCTION_IDENTITY |
|
||||
DEPENDENCY_INSTRUCTION_DATA_FLOW |
|
||||
DEPENDENCY_VARIABLES);
|
||||
}
|
||||
|
||||
bool
|
||||
validate(const fs_visitor *) const
|
||||
{
|
||||
/* FINISHME */
|
||||
return true;
|
||||
}
|
||||
|
||||
unsigned *regs_live_at_ip;
|
||||
};
|
||||
}
|
||||
|
||||
struct brw_gs_compile;
|
||||
@@ -126,7 +153,6 @@ public:
|
||||
unsigned *out_pull_index);
|
||||
void lower_constant_loads();
|
||||
virtual void invalidate_analysis(brw::analysis_dependency_class c);
|
||||
void calculate_register_pressure();
|
||||
void validate();
|
||||
bool opt_algebraic();
|
||||
bool opt_redundant_discard_jumps();
|
||||
@@ -322,8 +348,8 @@ public:
|
||||
|
||||
BRW_ANALYSIS(live_analysis, brw::fs_live_variables,
|
||||
backend_shader *) live_analysis;
|
||||
|
||||
int *regs_live_at_ip;
|
||||
BRW_ANALYSIS(regpressure_analysis, brw::register_pressure,
|
||||
fs_visitor *) regpressure_analysis;
|
||||
|
||||
/** Number of uniform variable components visited. */
|
||||
unsigned uniforms;
|
||||
|
Reference in New Issue
Block a user