[cfe-dev] Adding "simd" pragma to Clang

Renato Golin renato.golin at linaro.org
Mon Feb 17 02:01:15 PST 2014


On 15 February 2014 18:39, Renato Golin <renato.golin at linaro.org> wrote:
> I think pragmas simd, omp and omp simd are worth implementing as
> they're well defined in other contexts. Regarding our own new ones,
> pragma Clang or pragma optimize could be easily implemented locally
> until we find a better way of doing that.

Folks,

Just a follow-up. I've been discussing this issue on the GCC list, and
it seems that the general feeling is the same: we should avoid old
Intel or custom made pragmas and stick to Cilk/OMP 4 ones. For the
internal ones (unroll, enable) we can use the old Intel ones
(unroll/nounroll, vector/novector), so at least GCC anc ICC would be
able to compile the same code.

Andrey,

The ones we could already plugin to existing metadata are:

Internal ones:
#pragma vector always == llvm.vectorizer.enable 1
#pragma novector == llvm.vectorizer.enable 0
ex: test/Transforms/LoopVectorize/X86/metadata-enable.ll

#pragma unroll N == llvm.vectorizer.unroll N
#pragma nounroll == llvm.vectorizer.unroll 1
ex: test/Transforms/LoopVectorize/metadata-unroll.ll

Cilk:
#pragma simd vectorlength N == llvm.vectorizer.width N
ex: test/Transforms/LoopVectorize/metadata-width.ll


cheers,
--renato



More information about the cfe-dev mailing list