*/
#include "aco_ir.h"
#include "vulkan/radv_shader.h"
+#include "c11/threads.h"
+#include "util/debug.h"
namespace aco {
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},
+ {"force-waitcnt", DEBUG_FORCE_WAITCNT},
+ {"novn", DEBUG_NO_VN},
+ {"noopt", DEBUG_NO_OPT},
+ {"nosched", DEBUG_NO_SCHED},
{NULL, 0}
};
#ifndef NDEBUG
/* enable some flags by default on debug builds */
- debug_flags |= aco::DEBUG_VALIDATE;
+ debug_flags |= aco::DEBUG_VALIDATE_IR;
#endif
}
program->physical_sgprs = 2560; /* doesn't matter as long as it's at least 128 * 20 */
program->sgpr_alloc_granule = 127;
program->sgpr_limit = 106;
- program->vgpr_alloc_granule = program->wave_size == 32 ? 7 : 3;
+ if (chip_class >= GFX10_3)
+ program->vgpr_alloc_granule = program->wave_size == 32 ? 15 : 7;
+ else
+ program->vgpr_alloc_granule = program->wave_size == 32 ? 7 : 3;
} else if (program->chip_class >= GFX8) {
program->physical_sgprs = 800;
program->sgpr_alloc_granule = 15;
program->next_fp_mode.round32 = fp_round_ne;
}
+memory_sync_info get_sync_info(const Instruction* instr)
+{
+ switch (instr->format) {
+ case Format::SMEM:
+ return static_cast<const SMEM_instruction*>(instr)->sync;
+ case Format::MUBUF:
+ return static_cast<const MUBUF_instruction*>(instr)->sync;
+ case Format::MIMG:
+ return static_cast<const MIMG_instruction*>(instr)->sync;
+ case Format::MTBUF:
+ return static_cast<const MTBUF_instruction*>(instr)->sync;
+ case Format::FLAT:
+ case Format::GLOBAL:
+ case Format::SCRATCH:
+ return static_cast<const FLAT_instruction*>(instr)->sync;
+ case Format::DS:
+ return static_cast<const DS_instruction*>(instr)->sync;
+ default:
+ return memory_sync_info();
+ }
+}
+
bool can_use_SDWA(chip_class chip, const aco_ptr<Instruction>& instr)
{
if (!instr->isVALU())
}
for (unsigned i = 0; i < instr->operands.size(); i++) {
+ /* SDWA only uses operands 0 and 1. */
+ if (i >= 2)
+ break;
+
switch (instr->operands[i].bytes()) {
case 1:
sdwa->sel[i] = sdwa_ubyte;