This is an archive of the discontinued LLVM Phabricator instance.

[AtomicExpand] Make floating point conversion happens before fence insertion
ClosedPublic

Authored by lkail on Jun 12 2022, 9:11 PM.

Details

Summary

IIUC, the conversion part is not part of atomic operations and fences should be put around converted atomic operations.
This also fixes atomic load of floating point values which requires fence on PowerPC.

Diff Detail

Event Timeline

lkail created this revision.Jun 12 2022, 9:11 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 12 2022, 9:11 PM
lkail requested review of this revision.Jun 12 2022, 9:11 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 12 2022, 9:11 PM
lkail added a reviewer: asb.Jun 12 2022, 9:16 PM
lkail edited the summary of this revision. (Show Details)Jun 12 2022, 9:18 PM
efriedma added inline comments.Jun 13 2022, 4:09 PM
llvm/lib/CodeGen/AtomicExpandPass.cpp
226

I think you can drop the TODOs here, at least for load/store/atomicrmw.

llvm/test/CodeGen/PowerPC/cfence-double.ll
26–27

Please avoid using undef in testcases like this.

arsenm added inline comments.Jun 13 2022, 5:06 PM
llvm/lib/CodeGen/AtomicExpandPass.cpp
229

Don't see much point in this assert (plus the others)

253–254

There's no reason to assert on things that fail the verifier

llvm/test/CodeGen/PowerPC/cfence-double.ll
6

Should have an IR test in test/Transforms/AtomicExpand too

lkail updated this revision to Diff 436685.Jun 14 2022, 1:00 AM

Address comments.

lkail marked 4 inline comments as done.Jun 14 2022, 1:01 AM
lkail marked an inline comment as done.Jun 14 2022, 1:19 AM
This revision is now accepted and ready to land.Aug 30 2022, 11:16 AM
lkail updated this revision to Diff 456831.Aug 30 2022, 6:21 PM

Rebased tests.

This revision was landed with ongoing or failed builds.Aug 30 2022, 6:55 PM
This revision was automatically updated to reflect the committed changes.