This is an archive of the discontinued LLVM Phabricator instance.

Port memory barriers intrinsics to AArch64
ClosedPublic

Authored by kongyi on Jul 15 2014, 7:51 AM.

Details

Summary

Memory barrier __builtin_arm_[dmb, dsb, isb] intrinsics are required to implement their corresponding ACLE and MSVC intrinsics.

This patch ports ARM dmb, dsb, isb intrinsic to AArch64. It relies on D4516.

Diff Detail

Repository
rL LLVM

Event Timeline

kongyi updated this revision to Diff 11442.Jul 15 2014, 7:51 AM
kongyi retitled this revision from to Port memory barriers intrinsics to AArch64.
kongyi updated this object.
kongyi edited the test plan for this revision. (Show Details)
kongyi set the repository for this revision to rL LLVM.
kongyi added a project: deleted.
kongyi added a subscriber: Unknown Object (MLST).
t.p.northover edited edge metadata.Jul 15 2014, 8:11 AM

Hi Yi,

Are you sure this is going to interact well with D4516? The builtins you're adding are in the "__builtin_arm" space but that's (correctly, IMO) changing the prefix to "aarch64". Either way, we probably want a Clang-side test for that GCCBuiltin too.

One other thing I noticed was some extra complexity that shouldn't be needed (see end).

Cheers.

Tim.

lib/Target/AArch64/AArch64InstrFormats.td
546 ↗(On Diff #11442)

Something weird is going on here. You're adding a ParserMatchClass but not using this operand in any assembly context so it's almost certainly ignored. You probably only need the "ImmLeaf" part of this definition.

kongyi updated this revision to Diff 11447.Jul 15 2014, 9:36 AM
kongyi edited edge metadata.

Updated AArchIntrFormats.td according to Tim's comments.

compnerd added inline comments.Jul 15 2014, 7:38 PM
lib/Target/AArch64/AArch64InstrFormats.td
830 ↗(On Diff #11447)

I guess that I should've done this when I was changing the other System instructions.

test/CodeGen/AArch64/intrinsics-memory-barrier.ll
1 ↗(On Diff #11447)

Can you use aarch64-eabi please?

kongyi updated this revision to Diff 11512.Jul 16 2014, 7:35 AM

Changed target triple of the test case to aarch64-eabi.

t.p.northover accepted this revision.Jul 17 2014, 3:48 AM
t.p.northover edited edge metadata.

Hi Yi,

This looks fine to me too.

Cheers.

Tim.

This revision is now accepted and ready to land.Jul 17 2014, 3:48 AM
kongyi closed this revision.Jul 17 2014, 3:59 AM
kongyi updated this revision to Diff 11565.

Closed by commit rL213247 (authored by @kongyi).