[LLVMdev] LLVM parallel annotations

Tian, Xinmin xinmin.tian at intel.com
Wed Mar 4 16:03:15 PST 2015


The key design considerations would be:

1. Correctly represent parallel semantics 
2. Minimize (or no) side-effects on scalar optimizations so the thread-code generated can be optimal with scalar and parallel execution. 
3. Does not require changes (or just require very minimal changes) in existing LLVM optimizations while maintaining the correct semantics for both scalar and parallel semantics. 

Xinmin  

-----Original Message-----
From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On Behalf Of Hal Finkel
Sent: Wednesday, March 04, 2015 3:40 PM
To: Lefteris Ioannidis
Cc: llvmdev at cs.uiuc.edu
Subject: Re: [LLVMdev] LLVM parallel annotations

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 man!
 y 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.

 -Hal

----- 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

_______________________________________________
LLVM Developers mailing list
LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev




More information about the llvm-dev mailing list