This is an archive of the discontinued LLVM Phabricator instance.

[MLIR][OpenMP] Mark openmp.parallel and omp.wsloop as having recursive side effects
ClosedPublic

Authored by wsmoses on Mar 2 2022, 3:58 PM.

Details

Summary

An OpenMP wsloop is simply a regular for loop with the bounds determined by the thread number, and the same justification to allow this for scf.for works for omp.wsloop.

An OpenMP parallel is a parallel for, per thread. Similarly the same justification for scf.parallel having recursive side effects applies here.

In both cases the general justification is that the ops themselves don't have side effects (besides inaccessible runtime-specific memory) and thus the side effects are simply that of the contained ops.

Diff Detail

Event Timeline

wsmoses created this revision.Mar 2 2022, 3:58 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 2 2022, 3:58 PM
wsmoses requested review of this revision.Mar 2 2022, 3:58 PM

Can you please add a commit summary with a one-liner rationale here?

wsmoses edited the summary of this revision. (Show Details)Mar 3 2022, 5:06 PM

Can you please add a commit summary with a one-liner rationale here?

Done.

This revision is now accepted and ready to land.Mar 3 2022, 5:33 PM