This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] Fix non-determinism in clang copyin codegen
ClosedPublic

Authored by ggeorgakoudis on May 5 2021, 3:48 PM.

Details

Summary

Codegen for OpeMP copyin has non-deterministic IR output due to the unspecified evaluation order in a codegen conditional branch, which makes automatic test generation unreliable. This patch refactors codegen code to avoid this non-determinism.

Diff Detail

Event Timeline

ggeorgakoudis created this revision.May 5 2021, 3:48 PM
ggeorgakoudis requested review of this revision.May 5 2021, 3:48 PM
Herald added a project: Restricted Project. · View Herald Transcript

Update by Johanne's correction on the source of non-determinism

jdoerfert accepted this revision.May 5 2021, 6:12 PM

LGTM, two nits, one below.

Add a sentence to the commit message describing the problem.

clang/lib/CodeGen/CGStmtOpenMP.cpp
1013

Rename A to MasterAddrInt and B to PrivateAddrInt, or similar.

This revision is now accepted and ready to land.May 5 2021, 6:12 PM
ggeorgakoudis edited the summary of this revision. (Show Details)May 5 2021, 6:28 PM

Update for comments

ggeorgakoudis marked an inline comment as done.May 5 2021, 6:34 PM
This revision was automatically updated to reflect the committed changes.

Thanks! I'll test our Arm build and revert the requires once I've confirmed it passes.

Thanks! I'll test our Arm build and revert the requires once I've confirmed it passes.

This is not the fix you need.