[LLVMdev] parallel loop metadata simplification
pekka.jaaskelainen at tut.fi
Fri Mar 1 00:34:23 PST 2013
On 03/01/2013 12:37 AM, Redmond, Paul wrote:
> Another option is two make Loop::isParallel aware of both safe and unsafe
> parallel metadata and not requires translation at all. In practice, passes
> like reg2mem are not run so the concern goes away. Perhaps a single loop
> metadata is good enough for most uses?
I don't get this. Not require translation at all? Allow using the unsafe
metadata which is non-ignorable for skipping dependency analysis? Again,
reg2mem is not the only concern, but only an example of a pass that cannot
ignore parallel loop info without breaking it. LLVM is a project with
external users and out-of-tree passes which we are even unaware of.
I thought this was already agreed on. I understand the mem MD is a drag,
but I prefer it before miscompilations, and there hasn't been a better
proposal so far.
If it seems hard to attach the mem MD right away in Clang, I propose you use the
llvm.loop.parallel to mark the loop branches during Clang and make
sure that the mem metadata is added to the loops at the end. You can accomplish
this, e.g., by having a mode in your proposed pass that refreshes the metadata
that forces it to treat also the loops which have only the loop MD as parallel
ones. This would not require another book keeping metadata type even.
More information about the llvm-dev