This is an archive of the discontinued LLVM Phabricator instance.

[SystemZ] Support ATOMIC_FENCE
ClosedPublic

Authored by bryanpkc on Mar 31 2016, 6:07 AM.

Details

Summary

A cross-thread sequentially consistent fence should be lowered into z/Architecture's BCR serialization instruction, instead of causing a fatal error in the back-end.

Diff Detail

Repository
rL LLVM

Event Timeline

bryanpkc updated this revision to Diff 52192.Mar 31 2016, 6:07 AM
bryanpkc retitled this revision from to [SystemZ] Support ATOMIC_FENCE.
bryanpkc updated this object.
bryanpkc added a reviewer: uweigand.
bryanpkc added a subscriber: llvm-commits.
uweigand edited edge metadata.Mar 31 2016, 7:04 AM

This seems overly conservative: I think we only need a BCR serialization instruction for sequentially-consistent cross-thread fences. For everything else, a pure compiler barrier should be sufficient. See e.g. the X86 back-end for how to implement that check.

bryanpkc updated this revision to Diff 52462.EditedApr 2 2016, 7:36 AM
bryanpkc updated this object.
bryanpkc edited edge metadata.

I have updated the patch to mimic the behaviour of ATOMIC_FENCE on X86, as suggested.

LGTM, thanks.

uweigand accepted this revision.Apr 4 2016, 5:02 AM
uweigand edited edge metadata.
This revision is now accepted and ready to land.Apr 4 2016, 5:02 AM
This revision was automatically updated to reflect the committed changes.