[llvm-dev] [RFC] Canonicalize libcalls to intrinsics

Joerg Sonnenberger via llvm-dev llvm-dev at lists.llvm.org
Thu Jan 28 05:57:39 PST 2016


On Wed, Jan 27, 2016 at 05:53:33PM -0800, Matt Arsenault via llvm-dev wrote:
> I would like to propose that when available, if a C builtin function has an
> equivalent llvm intrinsic, that the intrinsic be the preferred form. The
> equivalent clang __builtin should emit the intrinsic, and SimplifyLibCalls
> should replace calls with the intrinsic.

As long as you make sure that it deals properly with renames used on the
prototypes... E.g. a call to "double sin(double)" can easily be forced
to use "my_better_sin_function" on the C level. One huge problem with
the "everything as __builtin mess" GCC introduced was to effectively
remove any sane way to model such behavior.

Joerg


More information about the llvm-dev mailing list