[LLVMdev] [RFC] Progress towards OpenMP support
sanjoy at playingwithpointers.com
Mon Sep 10 12:51:59 PDT 2012
I made some progress on implementing Hal's proposal  for
implementing OpenMP support in LLVM. The patch I've attached just
barely compiles, but I'd like to get some input on the design early on
to prevent trouble later. I'd especially like some input on the
* Metadata is never mutated or dropped
I think it is better to have an analysis pass that simply provides a
consistent "view" of the current !parallel nodes instead of one that
mutates the IR in order to make it consistent. By addRequired<> ing
it (called ParallizationMetadata currently) in the lowering pass and
only indirectly accessing the metadata through the analysis pass, we
are assured that we don't parallelize regions with inconsistent
* No information is optional
It simplifies the implementation greatly if we change the spec to
assume this. I don't think this restriction shifts any significant
complexity to the frontends.
* Loops don't have lists of special handling regions
Since loops are always nested inside parallel regions, can't we
maintain this list in the parent region itself?
* Tripping assertions vs. silently ignoring metadata
I'm not very clear on when it is "right" to silently ignore metadata and
when to assert. Right now I assert only when a !parallel MDNode has
an incorrect number of children (this is one thing simplified by
making all fields compulsory). The verifier probably needs to know
about this constraint, something I haven't addressed yet. Should our
assertions be stricter or must we not assert at all?
(The code is also up on Github ).
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 25207 bytes
Desc: not available
More information about the llvm-dev