ac: add new helper function to add a integer target dependent function attr.
This is needed to add the max workgroup size attribute. Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
parent
4ba2e6cbfa
commit
68c812f699
|
@ -217,3 +217,13 @@ ac_dump_module(LLVMModuleRef module)
|
||||||
fprintf(stderr, "%s", str);
|
fprintf(stderr, "%s", str);
|
||||||
LLVMDisposeMessage(str);
|
LLVMDisposeMessage(str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ac_llvm_add_target_dep_function_attr(LLVMValueRef F,
|
||||||
|
const char *name, int value)
|
||||||
|
{
|
||||||
|
char str[16];
|
||||||
|
|
||||||
|
snprintf(str, sizeof(str), "%i", value);
|
||||||
|
LLVMAddTargetDependentFunctionAttr(F, name, str);
|
||||||
|
}
|
||||||
|
|
|
@ -66,6 +66,11 @@ void ac_dump_module(LLVMModuleRef module);
|
||||||
|
|
||||||
LLVMValueRef ac_llvm_get_called_value(LLVMValueRef call);
|
LLVMValueRef ac_llvm_get_called_value(LLVMValueRef call);
|
||||||
bool ac_llvm_is_function(LLVMValueRef v);
|
bool ac_llvm_is_function(LLVMValueRef v);
|
||||||
|
|
||||||
|
void
|
||||||
|
ac_llvm_add_target_dep_function_attr(LLVMValueRef F,
|
||||||
|
const char *name, int value);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue