intel/compiler: Fill a compiler statistics struct

This commit is all annoying plumbing work which just adds support for a
new brw_compile_stats struct.  This struct provides a binary driver
readable form of the same statistics we dump out to stderr when we
INTEL_DEBUG is set with a shader stage.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
This commit is contained in:
Jason Ekstrand
2019-04-23 23:19:56 -05:00
parent 2720ad5fd9
commit 134607760a
19 changed files with 89 additions and 40 deletions

View File

@@ -1240,6 +1240,15 @@ DEFINE_PROG_DATA_DOWNCAST(clip)
DEFINE_PROG_DATA_DOWNCAST(sf)
#undef DEFINE_PROG_DATA_DOWNCAST
struct brw_compile_stats {
uint32_t dispatch_width; /**< 0 for vec4 */
uint32_t instructions;
uint32_t loops;
uint32_t cycles;
uint32_t spills;
uint32_t fills;
};
/** @} */
struct brw_compiler *
@@ -1278,6 +1287,7 @@ brw_compile_vs(const struct brw_compiler *compiler, void *log_data,
struct brw_vs_prog_data *prog_data,
struct nir_shader *shader,
int shader_time_index,
struct brw_compile_stats *stats,
char **error_str);
/**
@@ -1293,6 +1303,7 @@ brw_compile_tcs(const struct brw_compiler *compiler,
struct brw_tcs_prog_data *prog_data,
struct nir_shader *nir,
int shader_time_index,
struct brw_compile_stats *stats,
char **error_str);
/**
@@ -1309,6 +1320,7 @@ brw_compile_tes(const struct brw_compiler *compiler, void *log_data,
struct nir_shader *shader,
struct gl_program *prog,
int shader_time_index,
struct brw_compile_stats *stats,
char **error_str);
/**
@@ -1324,6 +1336,7 @@ brw_compile_gs(const struct brw_compiler *compiler, void *log_data,
struct nir_shader *shader,
struct gl_program *prog,
int shader_time_index,
struct brw_compile_stats *stats,
char **error_str);
/**
@@ -1375,6 +1388,7 @@ brw_compile_fs(const struct brw_compiler *compiler, void *log_data,
int shader_time_index32,
bool allow_spilling,
bool use_rep_send, struct brw_vue_map *vue_map,
struct brw_compile_stats *stats, /**< Array of three stats */
char **error_str);
/**
@@ -1389,6 +1403,7 @@ brw_compile_cs(const struct brw_compiler *compiler, void *log_data,
struct brw_cs_prog_data *prog_data,
const struct nir_shader *shader,
int shader_time_index,
struct brw_compile_stats *stats,
char **error_str);
void brw_debug_key_recompile(const struct brw_compiler *c, void *log,