This is an archive of the discontinued LLVM Phabricator instance.

AtomicExpand: Change return type for shouldExpandAtomicStoreInIR
ClosedPublic

Authored by arsenm on Apr 5 2022, 5:32 PM.

Details

Summary

Use the same enum as the other atomic instructions for consistency, in
preparation for addition of another strategy.

Introduce a new "Expand" option, since the store expansion does not
use cmpxchg. Alternatively, the existing CmpXChg strategy could be
renamed to Expand.

Diff Detail

Event Timeline

arsenm created this revision.Apr 5 2022, 5:32 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 5 2022, 5:32 PM
arsenm requested review of this revision.Apr 5 2022, 5:32 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 5 2022, 5:32 PM
Herald added a subscriber: wdng. · View Herald Transcript
pengfei added inline comments.Apr 5 2022, 9:10 PM
llvm/include/llvm/CodeGen/TargetLowering.h
2040–2041

Comments need update. Should we change the name to reflect the return type?

reames accepted this revision.Apr 6 2022, 4:04 PM

LGTM w/comments updated per previous comment.

llvm/lib/CodeGen/AtomicExpandPass.cpp
497

The new boolean doesn't make sense on it's own. Can you drop this from the current patch and add when the use is clear?

This revision is now accepted and ready to land.Apr 6 2022, 4:04 PM
arsenm updated this revision to Diff 421059.Apr 6 2022, 6:18 PM
arsenm marked 2 inline comments as done.

Address comments