Page MenuHomePhabricator

[GlobalISel][AArch64] Select llvm.bswap* for non-vector types
ClosedPublic

Authored by paquette on Feb 11 2019, 3:44 PM.

Details

Summary

This teaches the IRTranslator to emit G_BSWAP when it runs into Intrinsic::bswap. This allows us to select G_BSWAP for non-vector types in AArch64.

Add a select-bswap.mir test, and add global isel checks to a couple existing tests in test/CodeGen/AArch64.

This doesn't handle every bswap case, since some of these rely on known bits stuff. This just lets us handle the naive case.

Diff Detail

Repository
rL LLVM

Event Timeline

paquette created this revision.Feb 11 2019, 3:44 PM
arsenm accepted this revision.Feb 11 2019, 4:09 PM
arsenm added a subscriber: arsenm.

LGTM

lib/Target/AArch64/select-bswap.mir
10–12 ↗(On Diff #186354)

You can drop the register sections

41 ↗(On Diff #186354)

Extra space before =

This revision is now accepted and ready to land.Feb 11 2019, 4:09 PM
paquette updated this revision to Diff 186495.Feb 12 2019, 9:25 AM
paquette marked 2 inline comments as done.

Updating diff to address comments on test before committing

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 12 2019, 9:29 AM
eugenis added a subscriber: eugenis.Mar 5 2019, 5:35 PM

Hi,

you have a test file under lib/Target/AArch64.
Is it intentional? I don't think it does anything...