<div dir="ltr">Hello All,<div><br></div><div>I have been modifying LLVM a project of mine, and have encountered issues with overloading an intrinsic function. </div><div><br></div><div>I have defined two types, abit (which is mapped, in Intrinsics.td, to i128) and qbit (accordingly mapped to i16). I would like my intrinsic function, CNOT(x,y), to accept either an abit or a qbit for each argument, so I overload with iAny and llvm_anyint_ty, as seemed to be the method for other intrinsics:</div><div><br></div><div>def int_CNOT: Intrinsic<[], [llvm_anyint_ty, llvm_anyint_ty],[],["llvm.CNOT"]>; </div><div><br></div><div>My llvm/clang directory builds successfully, but I get an error on getType from clang, which I believe is rooted in my llvm code. My question is simply, are there any additional steps to overloading an intrinsic? I stand to believe there is more to be done than what I did in the one line above, but I cannot find where to do this.</div><div><br></div><div>For what its worth, I get this error in generating the initial IR through clang:</div><div><br></div><div><div>clang: ../ArrayRef.h:129: const T &llvm::ArrayRef<llvm::Type *>::operator[](size_t) const [T = llvm::Type *]: Assertion `Index < Length && "Invalid index!"' failed.</div></div><div><br></div><div>Many Thanks,</div><div>David Noursi</div><div><br></div><div><br></div></div>