Add a function addVectorizableFunctionsFromVecLib to TLI. It is a wrapper for
addVectorizableFunctions and uses preset tables for known vector-libraries.
Details
- Reviewers
nadav aschwaighofer jmolloy hfinkel
Diff Detail
Event Timeline
Also, please add a command line option that can call addVectorizableFunctionsFromVecLib from the constructor so that we can test this via opt. We'll need this so that you can write regression tests for all of the Accelerate functions being added.
Address Hal's remarks:
- Move addVectorizableFunctionsFromVecLib from header file.
- Add CL option for specifying vector library.
- Add comment beforei 'enum VectorLibrary'.
lib/Analysis/TargetLibraryInfo.cpp | ||
---|---|---|
19 | Implied by the other comments, but this should be static. |
This test depends on the X86 code model, and needs to be in the test/Transforms/LoopVectorize/X86 directory.
test/Transforms/LoopVectorize/veclib-calls.ll | ||
---|---|---|
7 ↗ | (On Diff #21671) | Please, here and below, check for the 'v' in the name, so we make sure that we've actually produced a call to the vector function, not an incorrect call to the scalar function with vector types somehow. |
Also, please add tests where you convert the intrinsics into function calls. Please add a negative test where the nobuiltin attribute is present.
This should be included only in the .cpp file.