[LLVMdev] LLVM parallel annotations

Hal Finkel hfinkel at anl.gov
Wed Mar 4 15:39:53 PST 2015

Hi Lef,

Your project sounds interesting, and please keep in touch regarding your progress. There are a few things to keep in mind, the most important is that if you use metadata to carry your annotations, then it must be legal for an optimization pass to drop your metadata without rendering the output invalid/miscompiled. The fact that metadata can be dropped is one of the major impediments to using that facility to implement OpenMP lowering in LLVM. Another possibility, not mutually exclusive with using metadata, is to use intrinsics. You can mark intrinsics as having unmodeled side effects, which will prevent them from being dropped. Unfortunately, doing so will also interfere with many optimizations. You might introduce some other class of semantics for them, but then there are other considerations: How difficult will it be to integrate into the existing infrastructure. What transformation and/or analysis passes need to be taught about the new feature for correctness, and how many to provide reasonable performance? Is this auditing easy or hard? Will it be easy to figure out, when writing new IR transformations, what can be legally done with the new metadata/intrinsics/etc.?

I highly recommend that you discuss any potential design on this list with those of us who are interested; there are many potential pitfalls, and we can likely help to you avoid at least some of them.


----- Original Message -----
> From: "Lefteris Ioannidis" <elefthei at mit.edu>
> To: llvmdev at cs.uiuc.edu
> Sent: Monday, February 16, 2015 3:33:42 PM
> Subject: [LLVMdev] LLVM parallel annotations
> Hi all,
> I'm a grad student from MIT and as part of my thesis, I will be
> propagating parallelism in the IR level. I will be modifying clang
> and adding LLVM IR metadata annotations to indicate parallel regions
> and loops, then write optimizer passes that will run on top of the
> annotated LLVM IR.
> There has been a lot of research lately on Parallel IRs, such as
> SPIR[ 1 ], SPIRE[ 2 ] and INSPIRE[ 3 ] lately, so I will be starting
> off from there in order to design a good parallel representation.
> With this patch a lot of the modern parallel C interfaces (pthreads,
> cilk, openMP etc.) will be translated to one unified LLVM IR.
> My goal is to make this part of the LLVM mainstream branch
> eventually. I'd really like to discuss design considerations that
> you might have, or any objections or pointers (pun intended). It is
> also possible somebody is already working on this. If so, we might
> be able to help each other. Looking forward to discussing this with
> all you.
> Cheers,
> Lef
> Lefteris Ioannidis,
> Massachusetts Institute of Technology '14
> Department of Electrical Engineering and Computer Science,
> elefthei at mit.edu | http://web. umit.edu/elefthei/www/
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

Hal Finkel
Assistant Computational Scientist
Leadership Computing Facility
Argonne National Laboratory

More information about the llvm-dev mailing list