*/
void
ac_llvm_context_init(struct ac_llvm_context *ctx,
+ struct ac_llvm_compiler *compiler,
enum chip_class chip_class, enum radeon_family family,
unsigned wave_size)
{
ctx->chip_class = chip_class;
ctx->family = family;
ctx->wave_size = wave_size;
- ctx->module = NULL;
+ ctx->module = ac_create_module(wave_size == 32 ? compiler->tm_wave32
+ : compiler->tm,
+ ctx->context);
ctx->builder = NULL;
ctx->voidt = LLVMVoidTypeInContext(ctx->context);
#define AC_WAIT_VSTORE (1 << 2) /* VMEM store instructions */
struct ac_llvm_flow;
+struct ac_llvm_compiler;
struct ac_llvm_context {
LLVMContextRef context;
void
ac_llvm_context_init(struct ac_llvm_context *ctx,
+ struct ac_llvm_compiler *compiler,
enum chip_class chip_class, enum radeon_family family,
unsigned wave_size);
ctx.options = options;
ctx.shader_info = shader_info;
- ac_llvm_context_init(&ctx.ac, options->chip_class, options->family, 64);
+ ac_llvm_context_init(&ctx.ac, ac_llvm, options->chip_class, options->family, 64);
ctx.context = ctx.ac.context;
- ctx.ac.module = ac_create_module(ac_llvm->tm, ctx.context);
enum ac_float_mode float_mode =
options->unsafe_math ? AC_FLOAT_MODE_UNSAFE_FP_MATH :
ctx.options = options;
ctx.shader_info = shader_info;
- ac_llvm_context_init(&ctx.ac, options->chip_class, options->family, 64);
+ ac_llvm_context_init(&ctx.ac, ac_llvm, options->chip_class, options->family, 64);
ctx.context = ctx.ac.context;
- ctx.ac.module = ac_create_module(ac_llvm->tm, ctx.context);
ctx.is_gs_copy_shader = true;
ctx->screen = sscreen;
ctx->compiler = compiler;
- ac_llvm_context_init(&ctx->ac, sscreen->info.chip_class, sscreen->info.family, 64);
- ctx->ac.module = ac_create_module(compiler->tm, ctx->ac.context);
+ ac_llvm_context_init(&ctx->ac, compiler, sscreen->info.chip_class,
+ sscreen->info.family, 64);
enum ac_float_mode float_mode =
sscreen->debug_flags & DBG(UNSAFE_MATH) ?