Page MenuHomePhabricator

[OMPIRBuilder] Clarify CanonicalLoopInfo. NFC.
ClosedPublic

Authored by Meinersbur on Aug 5 2021, 1:17 AM.

Details

Summary

Add in-source documentation on how CanonicalLoopInfo is intended to be used. In particular, clarify what parts of a CanonicalLoopInfo is considered part of the loop, that those parts must be side-effect free, and that InsertPoints to instructions outside those parts can be expected to be preserved after method calls implementing loop-associated directives.

CanonicalLoopInfo are now invalidated after it does not describe canonical loop anymore and asserts when trying to use it afterwards.

In addition, rename createXYZWorkshareLoop to applyXYZWorkshareLoop and remove the update location to avoid that the impression that they insert something from scratch at that location where in reality its InsertPoint is ignored. createStaticWorkshareLoop does not return a CanonicalLoopInfo anymore. First, it was not a canonical loop in the clarified sense (containing side-effects in form of calls to the OpenMP runtime). Second, it is ambiguous which of the two possible canonical loops it should actually return. It will not be needed before a feature expected to be introduced in OpenMP 6.0

Also see discussion in D105706.

Diff Detail

Event Timeline

Meinersbur created this revision.Aug 5 2021, 1:17 AM
Meinersbur requested review of this revision.Aug 5 2021, 1:17 AM
Herald added projects: Restricted Project, Restricted Project, Restricted Project. · View Herald Transcript
Meinersbur retitled this revision from [OMPBuilder] Clarify CanonicalLoopInfo. NFC. to [OMPIRBuilder] Clarify CanonicalLoopInfo. NFC..Aug 5 2021, 1:36 AM
Meinersbur edited the summary of this revision. (Show Details)
ftynse accepted this revision.Aug 11 2021, 2:12 PM

Thanks!

llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h
364
393
420
1293
1321

I suppose it may still exist in some cases.

1329
1336
This revision is now accepted and ready to land.Aug 11 2021, 2:12 PM
Meinersbur marked 7 inline comments as done.
This revision was automatically updated to reflect the committed changes.