LLVM and parallelization of target code

Hello,

I am new in this group. I would like to ask what is already implemented in LLVM regarding parallelization?

Any answer would be much appreciated.

Many thanks,
Iulia Stirb

Hi Lulia,
There are different kind of parallelization ? I am assuming you are asking for use LLVM to generate parallel code, not make LLVM run in parallel.

There are at least two different kinds of parallelization:

  1. Auto-parallel.

  2. parallel language extension support in LLVM+Clang toolchain.

  3. Auto-parallel:
    1.1 Auto-vectorization is such kind of parallel, It automatically analyze standard C/C++ code, and take advantage of the underlying target’s SIMD instruction support, such as SSE/AVX/NEON to generate parallel code (SIMD code).
    This webpage might contain more details: http://llvm.org/docs/Vectorizers.html#the-slp-vectorizer
    For the detail implementation, there are LoopVectorizer, SLPVectorizer and BBVectorizer.

1.2 Instruction Scheduling could be treated as another kind of parallel, which works together with underlying target’s VLIW support or Out-Of-Order execution support to improve Instruction-Level-Parallel (ILP). Usually, people likes to treat this as an basic function of the compiler, not a kind of parallelization. But it did improve ILP.

1.3 Thread-Level automatic parallel support. OpenMP could be treated as a kind of such parallel ( http://blog.llvm.org/2015/05/openmp-support_22.html).

  1. parallel language extension support
    2.1 OpenMP http://blog.llvm.org/2015/05/openmp-support_22.html
    2.2 OpenCL http://portablecl.org/index.html
    2.3 CUDA http://llvm.org/docs/NVPTXUsage.html
    2.4 Cilkplus https://github.com/cilkplus?tab=repositories

Kun Ling

------------------ Original ------------------