This is an archive of the discontinued LLVM Phabricator instance.

[TableGen] Use MemoryEffects to represent intrinsic memory effects (NFCI)
ClosedPublic

Authored by nikic on Nov 8 2022, 6:39 AM.

Details

Summary

The TableGen implementation was using a homegrown implementation of FunctionModRefInfo. This switches it to use MemoryEffects instead. This makes the code simpler, and will allow exposing the full representational power of MemoryEffects in the future. Among other things, this will allow us to map IntrHasSideEffects to an inaccessiblemem readwrite, rather than just ignoring it entirely in most cases.

A caveat here is that this includes a header from IR in TableGen. I think this should be unproblematic as long as IR/ModRef.h doesn't itself depend on any TableGen-generated headers. Alternatively, it could be moved into Support, but that feels somewhat out of place.

Diff Detail

Event Timeline

nikic created this revision.Nov 8 2022, 6:39 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 8 2022, 6:39 AM
nikic requested review of this revision.Nov 8 2022, 6:39 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 8 2022, 6:39 AM

the layering seems problematic, I think we should move ModRef.h into Support
there are already headers in there that don't seem like they quite belong due to layering, e.g. all the target-specific headers, CodeGen.h

nikic updated this revision to Diff 474737.Nov 11 2022, 5:44 AM

Move ModRef.h to Support to avoid layering problems.

aeubanks accepted this revision.Nov 11 2022, 7:53 AM
This revision is now accepted and ready to land.Nov 11 2022, 7:53 AM
arsenm accepted this revision.Nov 11 2022, 10:32 AM
This revision was landed with ongoing or failed builds.Nov 14 2022, 1:52 AM
This revision was automatically updated to reflect the committed changes.