This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Add missing HasNEON predicates to int->float patterns
ClosedPublic

Authored by arichardson on May 10 2022, 5:05 AM.

Details

Summary

I was trying to compile code with -march=+nosimd and hit various
instruction predicate verification errors, this patch should address the
ones I saw in integer to floating-pointer conversions.

I noticed that for signed conversions, some non-NEON instruction sequences
are shorter. I don't know if the longer one is still faster on current
architectures (the patterns date back to the initial backend import)

Diff Detail

Event Timeline

arichardson created this revision.May 10 2022, 5:05 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 10 2022, 5:05 AM
arichardson published this revision for review.May 10 2022, 5:10 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 10 2022, 5:10 AM
dmgreen accepted this revision.May 12 2022, 2:06 AM

I noticed that for signed conversions, some non-NEON instruction sequences are shorter. I don't know if the longer one is still faster on current architectures (the patterns date back to the initial backend import)

Yeah I believe the general idea was that going GRP->FPR is slower than keeping everything inside FPR registers. I was recently informed that those patterns should probably be guarded using the UseAlternateSExtLoadCVTF32 in the same way as other related patterns are.

This change LGTM though, in terms of NEON support. Thanks.

llvm/lib/Target/AArch64/AArch64InstrInfo.td
5027–5028

Perhaps just extend the previous HasNeon block? I'm not sure that's clearer though.

5114

Having a comment, // Predicates = [HasNEON] might be useful.

This revision is now accepted and ready to land.May 12 2022, 2:06 AM
arichardson marked 2 inline comments as done.

Drop --asm-show-inst

arichardson added inline comments.May 12 2022, 3:08 AM
llvm/lib/Target/AArch64/AArch64InstrInfo.td
5027–5028

Oh yes that is much better, somehow missed that..

dmgreen accepted this revision.May 12 2022, 3:16 AM

Cheers

This revision was landed with ongoing or failed builds.May 14 2022, 7:43 AM
This revision was automatically updated to reflect the committed changes.