[LLVMdev] [RFC] Parallelization metadata and intrinsics in LLVM (for OpenMP, etc.)

Hal Finkel
Tue, 02 Oct 2012 18:53:05 -0000

On Tue, 2 Oct 2012 20:54:03 +0530
Sanjoy Das <sanjoy at playingwithpointers.com> wrote:

> Hi,
>
> > constructs (e.g., parallel regions) and semantics.  LLVM is a
> > language- neutral IR and infrastructure and OpenMP-specific
> > concepts should not
>
> This is exactly the reason I proposed [1] -- mirroring the openmp
> directives in LLVM IR doesn't seem very elegant.  The parallelization
> information in the IR should be general and orthogonal.
>
> I do realize that boxing the loops into procedures in the frontend
> will initially inhibit loop optimizations, but that can be resolved
> with some work.

It is hard to evaluate this without more details. Would you convert
LoopInfo, SE, etc. into module-level passes? Would you inline these
functions early with some special attached semantics? If the second,
how is this different from attaching the special semantics using
intrinsics or metadata?

>  Ideally, I'd like to have a different class
> (ParallelLoop, maybe) altogether representing parallel loops and make
> the relevant passes aware of it.  More work, yes, but I think such an
> approach will pay off eventually.

Can you be more specific? Pay off how?

Thanks again,
Hal

>
> [1]
> http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-September/053798.html