[cfe-dev] [LLVMdev] [RFC] Parallelization metadata and intrinsics in LLVM (for OpenMP, etc.)

dag at cray.com dag at cray.com
Tue Oct 2 12:39:33 PDT 2012


Hal Finkel <hfinkel at anl.gov> writes:

> As I've stated, whether the metadata is preserved is not really the
> relevant metric. It is fine for a pass that does not understand
> parallelization metadata to drop it. The important part is that dropping
> the metadata, and moving instructions to which that metadata is
> attached, must not cause miscompiles. For example:


>  - Instructions with unknown side effects or dependencies must not be
>    moved from outside a parallel region to inside a parallel region.
>  - Serialized subregions inside of parallel regions cannot be deleted
>    without deleting the enclosing parallel region.
>
> The outstanding proposals have ways of dealing with these things. In
> the case of my proposal, it is though cross-referencing the metadata
> sufficiently and using function boundaries to prevent unwanted code
> motion. In Intel's case, it is by using the barriers implied by the
> intrinsics calls.

These two paragraphs seem contradictory to me.  How can a pass rely on
the metadata to not do illegal code motion if the pass has dropped the
metadata?  I must be missing something important.

The only way I can think that this would work is that the explicit
outlining is already done so there is no way to move between
parallel/non-parallel without going all interprocedurally bonkers. :)

This is the kind of thing that worries me about these proposals.

                           -David



More information about the cfe-dev mailing list