[llvm-dev] [RFC][VECLIB] how should we legalize VECLIB calls?

Renato Golin via llvm-dev llvm-dev at lists.llvm.org
Thu Oct 11 04:04:11 PDT 2018


On Wed, 10 Oct 2018 at 21:30, Francesco Petrogalli
<Francesco.Petrogalli at arm.com> wrote:
> There is no way for the compiler to solve this problem without accessing the code of the function, scalar or vector.

One small thing would be to never touch arch-specific intrinsics (like
@aeabi_divmod), but that also backfires frequently (Android likes to
play with library calls).

> 1. Provide runtime libraries as bitcode libraries - then, the bitcode of the call would be visible to the compiler. (SLEEF has already been compiled successfully into a bitcode library and used in a couple of compiler projects).
> 2. LTO. If the vectorizer generates vector calls that follow Vector Function ABI naming and conventions, a smart linker would be able to associate a scalar function to the vector one, and decide whether to replace such vector call with a loop that uses the faster scalar function.

Bitcode is safer, but requires work from third-parties. LTO
(especially inlining) is less of an exact science, but in theory,
require no changes elsewhere.

As usual, pursuing short and long term paths at the same time gives us
the most benefits in the long run, but also cost more. :)

--renato


More information about the llvm-dev mailing list