aco: remove perfwarn

This didn't do anything useful.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29270>
This commit is contained in:
Georg Lehmann
2024-05-17 18:14:19 +02:00
committed by Marge Bot
parent ea3e5bcc99
commit cc404d45ff
8 changed files with 1 additions and 65 deletions

View File

@@ -249,7 +249,6 @@ We also have `ACO_DEBUG` options:
* `validateir` - Validate the ACO IR between compilation stages. By default, enabled in debug builds and disabled in release builds.
* `validatera` - Perform a RA (register allocation) validation.
* `perfwarn` - Warn when sub-optimal instructions are found.
* `force-waitcnt` - Forces ACO to emit a wait state after each instruction when there is something to wait for. Harms performance.
* `novn` - Disables the ACO value numbering stage.
* `noopt` - Disables the ACO optimizer.

View File

@@ -404,7 +404,7 @@ aco_get_codegen_flags()
init();
/* Exclude flags which don't affect code generation. */
uint64_t exclude =
DEBUG_VALIDATE_IR | DEBUG_VALIDATE_RA | DEBUG_PERFWARN | DEBUG_PERF_INFO | DEBUG_LIVE_INFO;
DEBUG_VALIDATE_IR | DEBUG_VALIDATE_RA | DEBUG_PERF_INFO | DEBUG_LIVE_INFO;
return debug_flags & ~exclude;
}

View File

@@ -22,7 +22,6 @@ static const struct debug_control aco_debug_options[] = {
{"validateir", DEBUG_VALIDATE_IR},
{"validatera", DEBUG_VALIDATE_RA},
{"novalidateir", DEBUG_NO_VALIDATE_IR},
{"perfwarn", DEBUG_PERFWARN},
{"force-waitcnt", DEBUG_FORCE_WAITCNT},
{"force-waitdeps", DEBUG_FORCE_WAITDEPS},
{"novn", DEBUG_NO_VN},

View File

@@ -30,7 +30,6 @@ extern uint64_t debug_flags;
enum {
DEBUG_VALIDATE_IR = 0x1,
DEBUG_VALIDATE_RA = 0x2,
DEBUG_PERFWARN = 0x4,
DEBUG_FORCE_WAITCNT = 0x8,
DEBUG_NO_VN = 0x10,
DEBUG_NO_OPT = 0x20,
@@ -2200,13 +2199,6 @@ bool print_asm(Program* program, std::vector<uint32_t>& binary, unsigned exec_si
bool validate_ir(Program* program);
bool validate_cfg(Program* program);
bool validate_ra(Program* program);
#ifndef NDEBUG
void perfwarn(Program* program, bool cond, const char* msg, Instruction* instr = NULL);
#else
#define perfwarn(program, cond, msg, ...) \
do { \
} while (0)
#endif
void collect_presched_stats(Program* program);
void collect_preasm_stats(Program* program);
@@ -2237,10 +2229,8 @@ void aco_print_program(const Program* program, FILE* output, unsigned flags = 0)
void aco_print_program(const Program* program, FILE* output, const live& live_vars,
unsigned flags = 0);
void _aco_perfwarn(Program* program, const char* file, unsigned line, const char* fmt, ...);
void _aco_err(Program* program, const char* file, unsigned line, const char* fmt, ...);
#define aco_perfwarn(program, ...) _aco_perfwarn(program, __FILE__, __LINE__, __VA_ARGS__)
#define aco_err(program, ...) _aco_err(program, __FILE__, __LINE__, __VA_ARGS__)
int get_op_fixed_to_def(Instruction* instr);

View File

@@ -16,30 +16,6 @@
namespace aco {
#ifndef NDEBUG
void
perfwarn(Program* program, bool cond, const char* msg, Instruction* instr)
{
if (cond) {
char* out;
size_t outsize;
struct u_memstream mem;
u_memstream_open(&mem, &out, &outsize);
FILE* const memf = u_memstream_get(&mem);
fprintf(memf, "%s: ", msg);
aco_print_instr(program->gfx_level, instr, memf);
u_memstream_close(&mem);
aco_perfwarn(program, out);
free(out);
if (debug_flags & DEBUG_PERFWARN)
exit(1);
}
}
#endif
/**
* The optimizer works in 4 phases:
* (1) The first pass collects information for each ssa-def,
@@ -1324,20 +1300,6 @@ detect_clamp(Instruction* instr, unsigned* clamped_idx)
void
label_instruction(opt_ctx& ctx, aco_ptr<Instruction>& instr)
{
if (instr->isSALU() || instr->isVALU() || instr->isPseudo()) {
ASSERTED bool all_const = false;
for (Operand& op : instr->operands)
all_const =
all_const && (!op.isTemp() || ctx.info[op.tempId()].is_constant_or_literal(32));
perfwarn(ctx.program, all_const, "All instruction operands are constant", instr.get());
ASSERTED bool is_copy = instr->opcode == aco_opcode::s_mov_b32 ||
instr->opcode == aco_opcode::s_mov_b64 ||
instr->opcode == aco_opcode::v_mov_b32;
perfwarn(ctx.program, is_copy && !instr->usesModifiers(), "Use p_parallelcopy instead",
instr.get());
}
if (instr->isSMEM())
smem_combine(ctx, instr);
@@ -1442,8 +1404,6 @@ label_instruction(opt_ctx& ctx, aco_ptr<Instruction>& instr)
if (info.is_constant(bits) && alu_can_accept_constant(instr, i) &&
(!instr->isSDWA() || ctx.program->gfx_level >= GFX9) && (!instr->isDPP() || i != 1)) {
Operand op = get_constant_op(ctx, info, bits);
perfwarn(ctx.program, instr->opcode == aco_opcode::v_cndmask_b32 && i == 2,
"v_cndmask_b32 with a constant selector", instr.get());
if (i == 0 || instr->isSDWA() || instr->opcode == aco_opcode::v_readlane_b32 ||
instr->opcode == aco_opcode::v_writelane_b32) {
instr->format = withoutDPP(instr->format);

View File

@@ -141,7 +141,6 @@ struct aco_shader_info {
};
enum aco_compiler_debug_level {
ACO_COMPILER_DEBUG_LEVEL_PERFWARN,
ACO_COMPILER_DEBUG_LEVEL_ERROR,
};

View File

@@ -39,16 +39,6 @@ aco_log(Program* program, enum aco_compiler_debug_level level, const char* prefi
ralloc_free(msg);
}
void
_aco_perfwarn(Program* program, const char* file, unsigned line, const char* fmt, ...)
{
va_list args;
va_start(args, fmt);
aco_log(program, ACO_COMPILER_DEBUG_LEVEL_PERFWARN, "ACO PERFWARN:\n", file, line, fmt, args);
va_end(args);
}
void
_aco_err(Program* program, const char* file, unsigned line, const char* fmt, ...)
{

View File

@@ -269,7 +269,6 @@ radv_compiler_debug(void *private_data, enum aco_compiler_debug_level level, con
struct radv_instance *instance = radv_physical_device_instance(pdev);
static const VkDebugReportFlagsEXT vk_flags[] = {
[ACO_COMPILER_DEBUG_LEVEL_PERFWARN] = VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT,
[ACO_COMPILER_DEBUG_LEVEL_ERROR] = VK_DEBUG_REPORT_ERROR_BIT_EXT,
};