This is an archive of the discontinued LLVM Phabricator instance.

[BPF] Don't fetch alignment of llvm.preserve.union.access.index argument
ClosedPublic

Authored by nikic on Mar 24 2022, 3:30 AM.

Details

Summary

The way the alignment is determined here is not compatible with opaque pointers -- we'd have to thread it through using either align or elementtype attributes.

However, as far as I can tell this alignment is actually never used for this particular intrinsic, so I've dropped the assignment entirely and converted RecordAlignment to MaybeAlign, so we get an assertion failure if it does end up being used.

Diff Detail

Event Timeline

nikic created this revision.Mar 24 2022, 3:30 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 24 2022, 3:30 AM
nikic requested review of this revision.Mar 24 2022, 3:30 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 24 2022, 3:30 AM
yonghong-song accepted this revision.Mar 24 2022, 11:28 AM

Indeed, alignment is not used for union type. Your change looks good to me.

This revision is now accepted and ready to land.Mar 24 2022, 11:28 AM
This revision was landed with ongoing or failed builds.Mar 25 2022, 1:53 AM
This revision was automatically updated to reflect the committed changes.