[llvm] [TLI] Add getLibFunc in TLI API that accepts an Instruction. (PR #75919)

Paschalis Mpeis via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 19 04:21:32 PST 2023


paschalis-mpeis wrote:

> What's the motivation for this?

Most all libm functions are represented in LLVM as intrinsics with the exception of fmod that is transformed into the FREM instruction. This difference means existing code to map scalar calls to vector functions (as used by LoopVectorize and ReplaceWithVecLib) does not work and so first we want to map the instruction back to it’s representative scalar function. Given variants of getLibFunc exist to map an intrinsic to such functions it seems reasonable to have a variant for instructions as well.

https://github.com/llvm/llvm-project/pull/75919


More information about the llvm-commits mailing list