struct arg_info {
LLVMTypeRef types[MAX_ARGS];
LLVMValueRef *assign[MAX_ARGS];
- unsigned array_params_mask;
uint8_t count;
uint8_t sgpr_count;
uint8_t num_sgprs_used;
}
}
-static inline void
-add_array_arg(struct arg_info *info, LLVMTypeRef type, LLVMValueRef *param_ptr)
-{
- info->array_params_mask |= (1 << info->count);
- add_arg(info, ARG_SGPR, type, param_ptr);
-}
-
static void assign_arguments(LLVMValueRef main_function,
struct arg_info *info)
{
LLVMSetFunctionCallConv(main_function, RADEON_LLVM_AMDGPU_CS);
for (unsigned i = 0; i < args->sgpr_count; ++i) {
+ LLVMValueRef P = LLVMGetParam(main_function, i);
+
ac_add_function_attr(ctx, main_function, i + 1, AC_FUNC_ATTR_INREG);
- if (args->array_params_mask & (1 << i)) {
- LLVMValueRef P = LLVMGetParam(main_function, i);
+ if (LLVMGetTypeKind(LLVMTypeOf(P)) == LLVMPointerTypeKind) {
ac_add_function_attr(ctx, main_function, i + 1, AC_FUNC_ATTR_NOALIAS);
ac_add_attr_dereferenceable(P, UINT64_MAX);
}
while (mask) {
int i = u_bit_scan(&mask);
- add_array_arg(args, type, &ctx->descriptor_sets[i]);
+ add_arg(args, ARG_SGPR, type, &ctx->descriptor_sets[i]);
}
} else {
- add_array_arg(args, ac_array_in_const32_addr_space(type), desc_sets);
+ add_arg(args, ARG_SGPR, ac_array_in_const32_addr_space(type),
+ desc_sets);
}
if (ctx->shader_info->info.loads_push_constants) {
/* 1 for push constants and dynamic descriptors */
- add_array_arg(args, type, &ctx->abi.push_constants);
+ add_arg(args, ARG_SGPR, type, &ctx->abi.push_constants);
}
if (ctx->shader_info->info.so.num_outputs) {