RFC: A proposal for vectorizing loops with calls to math functions using SVML

RFC: A proposal for vectorizing loops with calls to math functions using SVML (short
vector math library).

Hi Matt -

Are you using the same TLI hook as Darwin’s Accelerate framework: addVectorizableFunctionsFromVecLib()? If not, why not?

Hi Sanjay,

For sincos calls, I’m currently just going through isTriviallyVectorizable(), which was good enough to get things working so that I could test the translation. I don’t see why this cannot be changed to use addVectorizableFunctionsFromVecLib(). The other functions that I’m working with are already vectorized using the loop pragma. Those include sin, cos, exp, log, and pow.

Thanks, Matt. I was just curious if the existing hook would support another lib or if more infrastructure was needed.

Since this proposal can build on the existing code, adds functionality, and increases compatibility with other compilers, I’m assuming patches would be accepted, but you probably want to get the green light from someone more familiar with the vectorizers and/or veclibs.

Thanks, Matt. I was just curious if the existing hook would support another lib or if more infrastructure was needed.

Since this proposal can build on the existing code, adds functionality, and increases compatibility with other compilers, I’m assuming patches would be accepted, but you probably want to get the green light from someone more familiar with the vectorizers and/or veclibs.

Hi,

The existing veclib infrastructure should be mostly sufficient for this, and it should be pretty trivial to enable SVML with it. It doesn’t have all the CL options mentioned here, but it shouldn’t be very hard to add them if we need them.

The loops are vectorized, but the calls remain scalar, right?

Thanks,
Michael

Hi Michael,

Correct. The loop is vectorized, but the calls remain scalar.