[LLVMdev] parallel loop metadata simplification

Redmond, Paul paul.redmond at intel.com
Thu Feb 28 11:30:57 PST 2013


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.

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







More information about the llvm-dev mailing list