[LLVMdev] parallel loop metadata simplification

Hal Finkel hfinkel at anl.gov
Thu Feb 28 18:33:39 PST 2013


----- Original Message -----
> From: "Paul Redmond" <paul.redmond at intel.com>
> To: "llvmdev at cs.uiuc.edu Dev" <llvmdev at cs.uiuc.edu>
> Sent: Thursday, February 28, 2013 1:30:57 PM
> Subject: [LLVMdev] parallel loop metadata simplification
> 
> Hi,
> 
> I've been working on clang codegen for #pragma ivdep and creating the
> llvm.mem.parallel_loop_access metadata seems quite difficult. The
> main problem is that there are so many places where loads and stores
> are created and all of them need to be changed when emitting a
> parallel loop. Note that creating llvm.loop.parallel is not a
> problem.
> 
> One option is to modify IRBuilder to enable attaching the metadata
> for loads and stores but that seems like a huge hack.

Can you please explain why this is a bad option? To be honest, this is what I expected you to do. The IRBuilder sits on top of all of the loads and stores, and seems like the perfect place to keep state for something that affects "all" loads and stores in some code region. In addition, putting this in IRBuilder should also make it easier to use this feature from other frontends.

 -Hal

> 
> I'd like to reopen the discussion on requiring the
> llvm.mem.parallel_loop_access metadata. I understand the reason for
> the metadata is to protect against transformations that may
> introduce unsafe parallel memory accesses (the reg2mem example.) I'm
> wondering if perhaps we can make the metadata more user-friendly by
> providing a single loop metadata which can be expanded into "safer"
> metadata as required. Specifically a loop pass could be added that
> expands llvm.loop.parallel into llvm.loop.parallel_protected +
> llvm.mem.parallel_loop_access.
> 
> Perhaps there are simpler options I've overlooked?
> 
> paul
> 
> 
> 
> 
> _______________________________________________
> 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