[LLVMdev] LLVM Parallel IR

Renato Golin renato.golin at linaro.org
Mon Mar 9 10:52:03 PDT 2015


On 9 March 2015 at 17:30, Tobias Grosser <tgrosser at inf.ethz.ch> wrote:
> If my memories are right, one of the critical issues (besides
> other engineering considerations) was that parallelism metadata in LLVM is
> optional and can always be dropped. However, for
> OpenMP it sometimes is incorrect to execute a loop sequential that has been
> marked parallel in the source code.

Exactly. The fact that metadata goes stale quickly is not a flaw, but
a design decision. If the producing pass is close enough from the
consuming one, you should be ok. If not, then proving legality might
be tricky and time consuming. The problem with OpenMP and other
vectorizer pragmas is that the metadata is introduced by the
front-end, and it's a long way down the pipeline for it to be
consumed. Having said that, it works ok if you keep your code simple.

I'd be interested in knowing what in the IR cannot be accomplished in
terms of metadata for parallelization, and what would be the new
constructs that needed to be added to the IR in order to do that. If
there is benefit for your project at the same time as for OpenMP and
our internal vectorizer annotation, changing the IR wouldn't be
impossible. We have done the same for exception handling...

cheers,
--renato



More information about the llvm-dev mailing list