Skip to content
This repository was archived by the owner on Jan 7, 2023. It is now read-only.

Commit 3ee6643

Browse files
committed
INTERNAL: Revert "FROMLIST: SQUASH: i965: SIMD32 selection heuristics"
This patch is causing visual artifacts on Celadon home screen, which is troubling because it is supposed to be disabled by default. Reverting until we find a solution. Signed-off-by: Kevin Strasser <[email protected]>
1 parent bf0992e commit 3ee6643

File tree

15 files changed

+9
-244
lines changed

15 files changed

+9
-244
lines changed

src/intel/compiler/brw_compiler.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,6 @@ struct ra_regs;
3838
struct nir_shader;
3939
struct brw_program;
4040

41-
struct brw_simd32_heuristics_control {
42-
bool grouped_sends_check;
43-
int max_grouped_sends;
44-
bool inst_count_check;
45-
float inst_count_ratio;
46-
bool mrt_check;
47-
int max_mrts;
48-
};
49-
5041
struct brw_compiler {
5142
const struct gen_device_info *devinfo;
5243

@@ -128,8 +119,6 @@ struct brw_compiler {
128119
* whether nir_opt_large_constants will be run.
129120
*/
130121
bool supports_shader_constants;
131-
132-
struct brw_simd32_heuristics_control simd32_heuristics_control;
133122
};
134123

135124
/**

src/intel/compiler/brw_fs.cpp

Lines changed: 7 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -8240,8 +8240,6 @@ brw_compile_fs(const struct brw_compiler *compiler, void *log_data,
82408240
char **error_str)
82418241
{
82428242
const struct gen_device_info *devinfo = compiler->devinfo;
8243-
bool simd16_failed = false;
8244-
bool simd16_spilled = false;
82458243

82468244
unsigned max_subgroup_size = unlikely(INTEL_DEBUG & DEBUG_DO32) ? 32 : 16;
82478245

@@ -8325,30 +8323,20 @@ brw_compile_fs(const struct brw_compiler *compiler, void *log_data,
83258323
shader_time_index16);
83268324
v16.import_uniforms(&v8);
83278325
if (!v16.run_fs(allow_spilling, use_rep_send)) {
8328-
simd16_failed = true;
83298326
compiler->shader_perf_log(log_data,
83308327
"SIMD16 shader failed to compile: %s",
83318328
v16.fail_msg);
83328329
} else {
8333-
simd16_spilled = v16.spilled_any_registers;
83348330
simd16_cfg = v16.cfg;
83358331
prog_data->dispatch_grf_start_reg_16 = v16.payload.num_regs;
83368332
prog_data->reg_blocks_16 = brw_register_blocks(v16.grf_used);
83378333
}
83388334
}
83398335

83408336
/* Currently, the compiler only supports SIMD32 on SNB+ */
8341-
const brw_simd32_heuristics_control *ctrl = &compiler->simd32_heuristics_control;
8342-
uint64_t mrts = shader->info.outputs_written << FRAG_RESULT_DATA0;
8343-
83448337
if (v8.max_dispatch_width >= 32 && !use_rep_send &&
83458338
compiler->devinfo->gen >= 6 &&
8346-
(unlikely(INTEL_DEBUG & DEBUG_DO32) ||
8347-
(unlikely(INTEL_DEBUG & DEBUG_HEUR32) &&
8348-
!simd16_failed && !simd16_spilled &&
8349-
(!ctrl->mrt_check ||
8350-
(ctrl->mrt_check &&
8351-
u_count_bits64(&mrts) <= ctrl->max_mrts))))) {
8339+
unlikely(INTEL_DEBUG & DEBUG_DO32)) {
83528340
/* Try a SIMD32 compile */
83538341
fs_visitor v32(compiler, log_data, mem_ctx, &key->base,
83548342
&prog_data->base, shader, 32,
@@ -8359,12 +8347,9 @@ brw_compile_fs(const struct brw_compiler *compiler, void *log_data,
83598347
"SIMD32 shader failed to compile: %s",
83608348
v32.fail_msg);
83618349
} else {
8362-
if (likely(!(INTEL_DEBUG & DEBUG_HEUR32)) ||
8363-
v32.run_heuristic(ctrl)) {
8364-
simd32_cfg = v32.cfg;
8365-
prog_data->dispatch_grf_start_reg_32 = v32.payload.num_regs;
8366-
prog_data->reg_blocks_32 = brw_register_blocks(v32.grf_used);
8367-
}
8350+
simd32_cfg = v32.cfg;
8351+
prog_data->dispatch_grf_start_reg_32 = v32.payload.num_regs;
8352+
prog_data->reg_blocks_32 = brw_register_blocks(v32.grf_used);
83688353
}
83698354
}
83708355

@@ -8439,51 +8424,14 @@ brw_compile_fs(const struct brw_compiler *compiler, void *log_data,
84398424
}
84408425

84418426
if (simd32_cfg) {
8442-
uint32_t offset = g.generate_code(simd32_cfg, 32);
8443-
8444-
if (unlikely(INTEL_DEBUG & DEBUG_DO32) ||
8445-
(unlikely(INTEL_DEBUG & DEBUG_HEUR32) &&
8446-
(!simd16_cfg ||
8447-
(simd16_cfg &&
8448-
(!ctrl->inst_count_check ||
8449-
(ctrl->inst_count_check &&
8450-
(float)g.get_inst_count(32) / (float)g.get_inst_count(16) <= ctrl->inst_count_ratio)))))) {
8451-
prog_data->dispatch_32 = true;
8452-
prog_data->prog_offset_32 = offset;
8453-
uint32_t offset = g.generate_code(simd32_cfg, 32);
8454-
}
8455-
8427+
prog_data->dispatch_32 = true;
8428+
prog_data->prog_offset_32 = g.generate_code(simd32_cfg, 32, stats);
8429+
stats = stats ? stats + 1 : NULL;
84568430
}
84578431

84588432
return g.get_assembly();
84598433
}
84608434

8461-
bool
8462-
fs_visitor::run_heuristic(const struct brw_simd32_heuristics_control *ctrl) {
8463-
int grouped_sends = 0;
8464-
int max_grouped_sends = 0;
8465-
bool pass = true;
8466-
8467-
foreach_block_and_inst(block, fs_inst, inst, cfg) {
8468-
if (inst->opcode >= SHADER_OPCODE_TEX && inst->opcode <= SHADER_OPCODE_SAMPLEINFO_LOGICAL) {
8469-
++grouped_sends;
8470-
} else if (grouped_sends > 0) {
8471-
if (grouped_sends > max_grouped_sends) {
8472-
max_grouped_sends = grouped_sends;
8473-
}
8474-
grouped_sends = 0;
8475-
}
8476-
}
8477-
8478-
if (ctrl->grouped_sends_check) {
8479-
if (max_grouped_sends > ctrl->max_grouped_sends) {
8480-
pass = false;
8481-
}
8482-
}
8483-
8484-
return pass;
8485-
}
8486-
84878435
fs_reg *
84888436
fs_visitor::emit_cs_work_group_id_setup()
84898437
{

src/intel/compiler/brw_fs.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -306,8 +306,6 @@ class fs_visitor : public backend_shader
306306
virtual void dump_instructions(const char *name);
307307
void dump_instruction(backend_instruction *inst);
308308
void dump_instruction(backend_instruction *inst, FILE *file);
309-
310-
bool run_heuristic(const struct brw_simd32_heuristics_control *ctrl);
311309

312310
const brw_base_prog_key *const key;
313311
const struct brw_sampler_prog_key_data *key_tex;
@@ -432,7 +430,6 @@ class fs_generator
432430
void enable_debug(const char *shader_name);
433431
int generate_code(const cfg_t *cfg, int dispatch_width,
434432
struct brw_compile_stats *stats);
435-
int get_inst_count(int dispatch_width);
436433
const unsigned *get_assembly();
437434

438435
private:
@@ -528,7 +525,6 @@ class fs_generator
528525
struct brw_stage_prog_data * const prog_data;
529526

530527
unsigned dispatch_width; /**< 8, 16 or 32 */
531-
int inst_count[3]; /* for 8, 16 and 32 */
532528

533529
exec_list discard_halt_patches;
534530
struct shader_stats shader_stats;

src/intel/compiler/brw_fs.h.rej

Lines changed: 0 additions & 26 deletions
This file was deleted.

src/intel/compiler/brw_fs_generator.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2430,8 +2430,6 @@ fs_generator::generate_code(const cfg_t *cfg, int dispatch_width,
24302430
stats->fills = fill_count;
24312431
}
24322432

2433-
inst_count[ffs(dispatch_width) - 4] = before_size / 16;
2434-
24352433
return start_offset;
24362434
}
24372435

@@ -2440,13 +2438,3 @@ fs_generator::get_assembly()
24402438
{
24412439
return brw_get_program(p, &prog_data->program_size);
24422440
}
2443-
2444-
int
2445-
fs_generator::get_inst_count(int dispatch_width)
2446-
{
2447-
if (dispatch_width == 8 || dispatch_width == 16 || dispatch_width == 32) {
2448-
return inst_count[ffs(dispatch_width) - 4];
2449-
} else {
2450-
return 0;
2451-
}
2452-
}

src/intel/compiler/brw_fs_generator.cpp.rej

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/intel/dev/gen_debug.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ static const struct debug_control debug_control[] = {
8686
{ "color", DEBUG_COLOR },
8787
{ "reemit", DEBUG_REEMIT },
8888
{ "soft64", DEBUG_SOFT64 },
89-
{ "heur32", DEBUG_HEUR32 },
9089
{ "tcs8", DEBUG_TCS_EIGHT_PATCH },
9190
{ "bt", DEBUG_BT },
9291
{ "pc", DEBUG_PIPE_CONTROL },

src/intel/dev/gen_debug.c.rej

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/intel/dev/gen_debug.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ extern uint64_t INTEL_DEBUG;
8888
#define DEBUG_BT (1ull << 44)
8989
#define DEBUG_PIPE_CONTROL (1ull << 45)
9090
#define DEBUG_NO_FAST_CLEAR (1ull << 46)
91-
#define DEBUG_HEUR32 (1ull << 47)
9291

9392
/* These flags are not compatible with the disk shader cache */
9493
#define DEBUG_DISK_CACHE_DISABLE_MASK DEBUG_SHADER_TIME
@@ -97,7 +96,7 @@ extern uint64_t INTEL_DEBUG;
9796
#define DEBUG_DISK_CACHE_MASK \
9897
(DEBUG_NO16 | DEBUG_NO_DUAL_OBJECT_GS | DEBUG_NO8 | DEBUG_SPILL_FS | \
9998
DEBUG_SPILL_VEC4 | DEBUG_NO_COMPACTION | DEBUG_DO32 | DEBUG_SOFT64 | \
100-
DEBUG_TCS_EIGHT_PATCH | DEBUG_HEUR32)
99+
DEBUG_TCS_EIGHT_PATCH)
101100

102101
#ifdef HAVE_ANDROID_PLATFORM
103102
#define LOG_TAG "INTEL-MESA"

src/intel/dev/gen_debug.h.rej

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)