[llvm-dev] 来自林政宗的邮件

Tim Northover via llvm-dev llvm-dev at lists.llvm.org
Thu Jul 23 06:48:06 PDT 2020


On Thu, 23 Jul 2020 at 10:27, 林政宗 via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> I am writing an new backend. I defined an intrinsic which has two output. How could I design the built-in function prototype? How could the built-in function pass two output out?

I take it you mean in Clang? I think the usual solution is to return
one value normally and take a pointer argument to store the other in,
then emit the right code in CGBuiltin.cpp. The unnecessary store
usually gets optimized away pretty easily.

For example overflow intrinsics here:
https://gcc.gnu.org/onlinedocs/gcc/Integer-Overflow-Builtins.html.

Cheers.

Tim.


More information about the llvm-dev mailing list