This is an archive of the discontinued LLVM Phabricator instance.

[PIR] Add documentation for PIR instructions
Needs ReviewPublic

Authored by jdoerfert on Feb 24 2017, 2:11 PM.

Details

Summary

This commit adds syntax and semantics documentation for the three
fork-join instructions proposed in the PIR RFC [0]. It also details the
semantic of parallel regions and their well-formedness criteria.

[0] http://lists.llvm.org/pipermail/llvm-dev/2017-January/109615.html

Event Timeline

jdoerfert created this revision.Feb 24 2017, 2:11 PM
majnemer added inline comments.
docs/ParallelIR.rst
53–67

These well-formedness and dominance rules are why we added tokens to LLVM. I believe that if you had fork produce a token and halt/join consume that token, all LLVM passes would naturally obey your rules. You wouldn't have to worry about LLVM adding control flow which introduced ambiguities to the CFG. In fact, you could ensure that the parallel regions are always well nested if you had fork consume the parent region's token.

Without using token, PIR is still implementable but it is possible to write IR transforms which make it possible for parallel regions to be ill-formed. Now, we can teach those passes about parallel region IR semantics but why would we want to if we could just use tokens to represent the set of constraints up front?