This is an archive of the discontinued LLVM Phabricator instance.

[AtomicExpandPass] Allow for pointer types in insertRMWCmpXchgLoop()
AbandonedPublic

Authored by arichardson on Nov 11 2020, 6:28 AM.

Details

Summary

In our CHERI target we support RMW operations on capability types which
are implemented as i8 addrspace(200)*. In certain case we have to fall
back to the cmpxchg expansion and were hitting an assertion here since
getPrimitiveSizeInBits() returns zero for pointer types. Fix this by
querying the DataLayout instead.

Diff Detail

Event Timeline

arichardson created this revision.Nov 11 2020, 6:28 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 11 2020, 6:28 AM
arichardson requested review of this revision.Nov 11 2020, 6:28 AM
jrtc27 added a subscriber: jrtc27.Nov 30 2020, 3:11 PM

Sorry for never looking at this before now. :(

However, now that atomicrmw instructions have an alignment attribute, this change is superseded by D97223, which fixes the issue, instead, by passing through the atomicrmw alignment, instead of coming up with a new value.

Thanks!

arichardson abandoned this revision.Mar 8 2021, 2:03 AM

No longer required.