This is an archive of the discontinued LLVM Phabricator instance.

[PIR] Allow to detect parallel loops using the ParallelRegionInfo.
Needs ReviewPublic

Authored by jdoerfert on Apr 2 2017, 7:42 AM.

Details

Summary

A parallel loop is a loop that does fork (parts of) its body to a new
task which are joined only after the loop. It is also ensured that
everything that is not forked but part of the loop does not cause
side-effects. These instructions usually compute the exit condition
and the new values for the induction variable(s).

Note: We allow multiple induction variables and complex exit conditions
here. However, for some parallel runtimes these have to be simplified,
e.g. expressed with regards to one canonical induction variable.
TODO: Provide an interface to perform the simplification.

Note: We allow arbitrary code after the loop but before a join
instruction.