This is an archive of the discontinued LLVM Phabricator instance.

SVML support for log10, sqrt
ClosedPublic

Authored by ayermolo on Sep 4 2020, 2:56 PM.

Details

Summary

Although LLVM supports vectorization of loops containing log10/sqrt, it did not support using SVML implementation of it. Added support so that when clang is invoked with -fveclib=SVML now an appropriate SVML library log2 implementation will be invoked.

Follow up on: https://reviews.llvm.org/D77114

Tests:
Added unit tests to svml-calls.ll, svml-calls-finite.ll. Can be run with llvm-lint.
Created a simple c++ file that tests log10/sqrt, and used clang+ to build it, and output final assembly.

Diff Detail

Event Timeline

ayermolo created this revision.Sep 4 2020, 2:56 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 4 2020, 2:56 PM
ayermolo requested review of this revision.Sep 4 2020, 2:56 PM

hi @ayermolo are you using clang/llvm with the SVML library shipped with Intel's icc compiler? I'm just curious about how this support is being used.

We are linking against Intel Composer XE in to which svml libraries were added. I do believe they are from icc.

@craig.topper Any more questions/concerns? Can you approve?

This revision is now accepted and ready to land.Sep 15 2020, 4:49 PM
This revision was automatically updated to reflect the committed changes.

Committed on behalf of @ayermolo.

craig.topper added inline comments.Sep 22 2020, 1:40 PM
llvm/include/llvm/Analysis/VecFuncs.def
312

I don't think we want to use SVML for llvm.sqrt. We have a hardware instruction for that.

hoy added a subscriber: hoy.Sep 23 2020, 2:34 PM
hoy added inline comments.
llvm/include/llvm/Analysis/VecFuncs.def
312

Good point. We have the SQRTPS/SQRTPD AVX instructions for that.

ayermolo added inline comments.Sep 23 2020, 2:38 PM
llvm/include/llvm/Analysis/VecFuncs.def
312