This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Add missing HasNEON predicate in scalar FABD patterns
ClosedPublic

Authored by arichardson on Apr 11 2022, 3:19 AM.

Details

Summary

I was trying to compile with -march=+nosimd and hit the folloing assertion:
Attempting to emit FABD64 instruction but the Feature_HasNEON predicate(s) are not met.
This adds a HasNEON predicate to the patterns which was omitted in commit
21d9b33d62772c58267cc0aa725e35ac9a4661db for some reason.
The new code generation matches GCC with -mcpu=<cpu>+nosimd:
https://godbolt.org/z/n1Y7xh5jo

Diff Detail

Event Timeline

arichardson created this revision.Apr 11 2022, 3:19 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 11 2022, 3:19 AM
arichardson requested review of this revision.Apr 11 2022, 3:19 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 11 2022, 3:19 AM
dmgreen accepted this revision.Apr 12 2022, 12:00 AM
dmgreen added a subscriber: dmgreen.

Sounds good to me. I have some minor comments about cleaning up the tests a little, but otherwise LGTM.

llvm/test/CodeGen/AArch64/fabd-no-neon.ll
4

Does this need +v8.2a?

10

This can be removed, so long as the mtriple is specified in the command line.

12

Can remove local_unnamed_addr and maybe nounwind? (Although that sometimes adds noise to the assembly)

This revision is now accepted and ready to land.Apr 12 2022, 12:00 AM
arichardson marked 3 inline comments as done.Apr 12 2022, 2:01 PM
arichardson added inline comments.
llvm/test/CodeGen/AArch64/fabd-no-neon.ll
12

Yeah I added nounwind to avoid the .cfi instructions, but it seems like they aren't generated even without the attribute.

This revision was landed with ongoing or failed builds.Apr 13 2022, 2:31 AM
This revision was automatically updated to reflect the committed changes.
arichardson marked an inline comment as done.