I would like to add an intrinsic function based on the function declaration and call in the LLVM IR.
declare void @llvm.Tensilica.AO.STORE.I0.p0_TIE_nnp_AO(_TIE_nnp_AO, _TIE_nnp_AO* nocapture, i32) #1
I understand that adding the clang builtin is not necessary when compiling from the IR level but I am running into the following error while defining the intrinsic in the .td file.
llvm-project/llvm/include/llvm/IR/IntrinsicsXtensa.td:258:14: error: Cannot access field 'LOAD' of value '"int_AO"'
def int_AO.LOAD.I0.p0_TIE_nnp_AO : Intrinsic<[llvm__TIE_nnp_AO_ty], [llvm_ptr_TIE_nnp_AO_ty, llvm_i32_ty], [ImmArg<ArgIndex<1>>]>;
Here is my definition of the intrinsic,
let TargetPrefix = "Tensilica" in {
def int_Tensilica.AO.LOAD.I0.p0_TIE_nnp_AO : Intrinsic<[llvm__TIE_nnp_AO_ty], [llvm_ptr_TIE_nnp_AO_ty, llvm_i32_ty], [ImmArg<ArgIndex<1>>]>;
def int_Tensilica.AO.STORE.I0.p0_TIE_nnp_AO : Intrinsic<[], [llvm__TIE_nnp_AO_ty, llvm_ptr_TIE_nnp_AO_ty, llvm_i32_ty], [ImmArg<ArgIndex<2>>]>;
}
I think the issue is related to how the function is declared in the IR but I don’t understand the exact reason for the error.