call = LLVMBuildCall2(ctx->builder, function_type, function, params, param_count, "");
- if (attrib_mask & AC_FUNC_ATTR_READNONE) {
+ if (attrib_mask & AC_ATTR_INVARIANT_LOAD) {
if (LLVM_VERSION_MAJOR >= 15)
LLVMSetMetadata(call, ctx->invariant_load_md_kind, ctx->empty_md);
else
LLVMAddCallSiteAttribute(call, -1, ac_get_llvm_attribute(ctx->context, "readnone"));
}
- if (attrib_mask & AC_FUNC_ATTR_CONVERGENT)
+ if (attrib_mask & AC_ATTR_CONVERGENT)
LLVMAddCallSiteAttribute(call, -1, ac_get_llvm_attribute(ctx->context, "convergent"));
LLVMAddCallSiteAttribute(call, -1, ac_get_llvm_attribute(ctx->context, "nounwind"));
LLVMConstInt(ctx->i32, get_load_cache_policy(ctx, cache_policy), 0),
};
result[i] = ac_build_intrinsic(ctx, "llvm.amdgcn.s.buffer.load.f32", ctx->f32, args, 3,
- AC_FUNC_ATTR_READNONE);
+ AC_ATTR_INVARIANT_LOAD);
}
if (num_channels == 1)
return result[0];
fmask_load.resource = fmask;
fmask_load.dmask = 0xf;
fmask_load.dim = is_array_tex ? ac_image_2darray : ac_image_2d;
- fmask_load.attributes = AC_FUNC_ATTR_READNONE;
+ fmask_load.attributes = AC_ATTR_INVARIANT_LOAD;
fmask_load.coords[0] = addr[0];
fmask_load.coords[1] = addr[1];
struct ac_compiler_passes;
struct ac_llvm_context;
-enum ac_func_attr
-{
- /* Call attributes. */
- AC_FUNC_ATTR_READNONE = (1 << 3),
- AC_FUNC_ATTR_CONVERGENT = (1 << 4),
+/* Attributes at call sites of intrinsics. */
+enum ac_call_site_attr {
+ AC_ATTR_INVARIANT_LOAD = 1 << 0,
+ AC_ATTR_CONVERGENT = 1 << 1,
};
enum ac_target_machine_options
static inline unsigned ac_get_load_intr_attribs(bool can_speculate)
{
- return can_speculate ? AC_FUNC_ATTR_READNONE : 0;
+ return can_speculate ? AC_ATTR_INVARIANT_LOAD : 0;
}
LLVMTargetLibraryInfoRef ac_create_target_library_info(const char *triple);
resinfo.dmask = 0xf;
resinfo.lod = ctx->i32_0;
resinfo.resource = args->resource;
- resinfo.attributes = AC_FUNC_ATTR_READNONE;
+ resinfo.attributes = AC_ATTR_INVARIANT_LOAD;
LLVMValueRef size = ac_build_image_opcode(ctx, &resinfo);
/* Compute -0.5 / size. */
args->coords[c] = LLVMBuildFAdd(ctx->builder, tmp, half_texel[c], "");
}
- args->attributes = AC_FUNC_ATTR_READNONE;
+ args->attributes = AC_ATTR_INVARIANT_LOAD;
result = ac_build_image_opcode(ctx, args);
if (instr->sampler_dim == GLSL_SAMPLER_DIM_CUBE) {
}
}
- args->attributes = AC_FUNC_ATTR_READNONE;
+ args->attributes = AC_ATTR_INVARIANT_LOAD;
bool cs_derivs =
ctx->stage == MESA_SHADER_COMPUTE && ctx->info->cs.derivative_group != DERIVATIVE_GROUP_NONE;
if (ctx->stage == MESA_SHADER_FRAGMENT || cs_derivs) {
case nir_texop_tex:
case nir_texop_txb:
case nir_texop_lod:
- args->attributes |= AC_FUNC_ATTR_CONVERGENT;
+ args->attributes |= AC_ATTR_CONVERGENT;
break;
default:
break;
get_image_coords(ctx, instr, dynamic_index, &args, GLSL_SAMPLER_DIM_2D, is_array);
args.dmask = 0xf;
args.dim = is_array ? ac_image_2darray : ac_image_2d;
- args.attributes = AC_FUNC_ATTR_READNONE;
+ args.attributes = AC_ATTR_INVARIANT_LOAD;
args.a16 = ac_get_elem_bits(&ctx->ac, LLVMTypeOf(args.coords[0])) == 16;
res = ac_build_image_opcode(&ctx->ac, &args);
args.opcode = ac_image_load;
args.resource = image;
args.dmask = 0xf;
- args.attributes = AC_FUNC_ATTR_READNONE;
+ args.attributes = AC_ATTR_INVARIANT_LOAD;
if (ctx->shader->key.ps.mono.fbfetch_msaa)
args.dim =