This is an archive of the discontinued LLVM Phabricator instance.

[OpaquePtr][AArch64] Use elementtype on ldxr/stxr
ClosedPublic

Authored by aeubanks on Feb 24 2022, 4:41 PM.

Details

Reviewers
dmgreen
nikic
Group Reviewers
Restricted Project
Commits
rG250620f76e07: [OpaquePtr][AArch64] Use elementtype on ldxr/stxr
Summary

Includes verifier changes checking the elementtype, clang codegen
changes to emit the elementtype, and ISel changes using the elementtype.

Diff Detail

Event Timeline

aeubanks created this revision.Feb 24 2022, 4:41 PM
aeubanks requested review of this revision.Feb 24 2022, 4:41 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptFeb 24 2022, 4:41 PM
aeubanks planned changes to this revision.Feb 24 2022, 4:45 PM
aeubanks retitled this revision from [OpaquePtr][AArch64] Use elementtype on various intrinsics to [OpaquePtr][AArch64] Use elementtype on ldxr/stxr.Feb 24 2022, 5:13 PM
aeubanks added reviewers: Restricted Project, dmgreen.
nikic added a subscriber: nikic.Feb 25 2022, 1:18 AM

An alternative I suggested on https://github.com/llvm/llvm-project/issues/51165 was to overload these intrinsics by result/value type. I think that would be cleaner design-wise, but it also seems harder to implement (requires custom ISD nodes), so I'm okay with the elementtype approach.

llvm/lib/IR/Verifier.cpp
5541

This is checked generically for all elementtype attributes. You can also merge this into the previous switch case.

llvm/test/Verifier/AArch64/lit.local.cfg
2 ↗(On Diff #411274)

This is unnecessary, target intrinsics are available even if the target isn't.

aeubanks updated this revision to Diff 414225.Mar 9 2022, 3:20 PM

address comments

Herald added a project: Restricted Project. · View Herald TranscriptMar 9 2022, 3:20 PM
nikic accepted this revision.Mar 10 2022, 12:23 AM

LGTM. You probably want to add these intrinsics to the auto-upgrade code in BitcodeReader::propagateAttributeTypes() as well.

This revision is now accepted and ready to land.Mar 10 2022, 12:23 AM

Seems OK. Thanks for the patch.

Do opaque pointer variants (like i32 @llvm.aarch64.stxr.p0(i64 1, ptr elementtype(i64) %ptr.0)) get tested automatically from the existing tests once -opaque-pointers is the default?

Seems OK. Thanks for the patch.

Do opaque pointer variants (like i32 @llvm.aarch64.stxr.p0(i64 1, ptr elementtype(i64) %ptr.0)) get tested automatically from the existing tests once -opaque-pointers is the default?

yup

LGTM. You probably want to add these intrinsics to the auto-upgrade code in BitcodeReader::propagateAttributeTypes() as well.

done

This revision was landed with ongoing or failed builds.Mar 14 2022, 10:10 AM
This revision was automatically updated to reflect the committed changes.
nikic added a comment.Mar 15 2022, 1:56 AM

@aeubanks Do you plan to take care of the corresponding arm intrinsics as well?

@aeubanks Do you plan to take care of the corresponding arm intrinsics as well?

yes I'll do those