This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Lower scalar sqxtn intrinsics to use fp registers
ClosedPublic

Authored by dmgreen on Sep 16 2022, 1:17 AM.

Details

Summary

The llvm.aarch64.neon.scalar.sqxtn.i32.i64 intrinsics take and return integer types, but operate on fp registers. This can create some inefficiencies in their lowering, where the registers are converted to fp a little too late. This patch adds lowering for the intrinsics, creating bitcasts to/from fp types to allow nicer folding later when the instructions are selected, especially around insert/extracts.

Diff Detail

Event Timeline

dmgreen created this revision.Sep 16 2022, 1:17 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 16 2022, 1:17 AM
dmgreen requested review of this revision.Sep 16 2022, 1:17 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 16 2022, 1:17 AM
mingmingl accepted this revision.Sep 16 2022, 9:25 AM

Thanks! LGTM (with a minor comment).

llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
4631

nit:

Use dl (created at line 4538), same for the other two SDLoc(Op).

This revision is now accepted and ready to land.Sep 16 2022, 9:25 AM
This revision was landed with ongoing or failed builds.Sep 21 2022, 2:46 AM
This revision was automatically updated to reflect the committed changes.