This is an archive of the discontinued LLVM Phabricator instance.

[Instruction] Introduce getAtomicSyncScopeID()
ClosedPublic

Authored by melver on Mar 17 2022, 6:41 AM.

Details

Summary

An analysis may just be interested in checking if an instruction is
atomic but system scoped or single-thread scoped, like ThreadSanitizer's
isAtomic(). Unfortunately Instruction::isAtomic() can only answer the
"atomic" part of the question, but to also check scope becomes rather
verbose.

To simplify and reduce redundancy, introduce a common helper
getAtomicSyncScopeID() which returns the scope of an atomic operation.
Start using it in ThreadSanitizer.

NFCI.

Diff Detail

Event Timeline

melver created this revision.Mar 17 2022, 6:41 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 17 2022, 6:41 AM
melver requested review of this revision.Mar 17 2022, 6:41 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 17 2022, 6:41 AM
dvyukov accepted this revision.Mar 17 2022, 6:46 AM
This revision is now accepted and ready to land.Mar 17 2022, 6:46 AM
This revision was landed with ongoing or failed builds.Mar 17 2022, 7:23 AM
This revision was automatically updated to reflect the committed changes.