static void validate(aco::Program *program)
{
- if (!(aco::debug_flags & aco::DEBUG_VALIDATE))
+ if (!(aco::debug_flags & aco::DEBUG_VALIDATE_IR))
return;
- bool is_valid = aco::validate(program, stderr);
+ bool is_valid = aco::validate_ir(program, stderr);
assert(is_valid);
}
uint64_t debug_flags = 0;
static const struct debug_control aco_debug_options[] = {
- {"validateir", DEBUG_VALIDATE},
+ {"validateir", DEBUG_VALIDATE_IR},
{"validatera", DEBUG_VALIDATE_RA},
{"perfwarn", DEBUG_PERFWARN},
{NULL, 0}
#ifndef NDEBUG
/* enable some flags by default on debug builds */
- debug_flags |= aco::DEBUG_VALIDATE;
+ debug_flags |= aco::DEBUG_VALIDATE_IR;
#endif
}
extern uint64_t debug_flags;
enum {
- DEBUG_VALIDATE = 0x1,
+ DEBUG_VALIDATE_IR = 0x1,
DEBUG_VALIDATE_RA = 0x2,
DEBUG_PERFWARN = 0x4,
};
unsigned emit_program(Program* program, std::vector<uint32_t>& code);
void print_asm(Program *program, std::vector<uint32_t>& binary,
unsigned exec_size, std::ostream& out);
-bool validate(Program* program, FILE *output);
+bool validate_ir(Program* program, FILE *output);
bool validate_ra(Program* program, const struct radv_nir_compiler_options *options, FILE *output);
#ifndef NDEBUG
void perfwarn(bool cond, const char *msg, Instruction *instr=NULL);
}
#endif
-bool validate(Program* program, FILE *output)
+bool validate_ir(Program* program, FILE *output)
{
bool is_valid = true;
auto check = [&output, &is_valid](bool check, const char * msg, aco::Instruction * instr) -> void {
finish_program(program.get());
aco_print_program(program.get(), output);
fprintf(output, "Validation results:\n");
- if (aco::validate(program.get(), output))
+ if (aco::validate_ir(program.get(), output))
fprintf(output, "Validation passed\n");
else
fprintf(output, "Validation failed\n");
void finish_opt_test()
{
finish_program(program.get());
- if (!aco::validate(program.get(), output)) {
+ if (!aco::validate_ir(program.get(), output)) {
fail_test("Validation before optimization failed");
return;
}
aco::optimize(program.get());
- if (!aco::validate(program.get(), output)) {
+ if (!aco::validate_ir(program.get(), output)) {
fail_test("Validation after optimization failed");
return;
}