llvm-project
f6a359fe - [CodeGen] Teach ReplaceWithVeclib split vector llvm.sincos when only sin/cos veclib mappings exist (#194639)

Commit
3 days ago
[CodeGen] Teach ReplaceWithVeclib split vector llvm.sincos when only sin/cos veclib mappings exist (#194639) Some vector math libraries provide vector sin and vector cos but no vector sincos or no sincos with an ABI that LLVM can emit. The one of the common case is glibc libmvec on x86: it exposes `_ZGV{b,c,d,e}N{2,4,8,16}vvv_sincos{,f}` symbols, but those use a vectors-of-pointers output ABI that expandMultipleResultFPLibCall does not currently support. As a result, sincos will falls back to scalar sincos calls even when the target has a fully working vector sin and vector cos. So we trying to split it into separate sin and cos calls, which will then be replaced with vector calls if the target supports it, it generally better than scalarized sincos calls.
Author
Parents
Loading