Page MenuHomePhabricator

[AArch64] Merge [US]MULL with half adds and subs into [US]ML[AS]L
ClosedPublic

Authored by avieira on Jan 22 2021, 2:16 AM.

Details

Summary

Hi,

This patch adds patterns to teach the AArch64 backend to merge [US]MULL
instructions and adds/subs of half the size into [US]ML[AS]L where we don't use
the top half of the result.

Is this OK for main?

Kind regards,
Andre

Diff Detail

Event Timeline

avieira created this revision.Jan 22 2021, 2:16 AM
avieira requested review of this revision.Jan 22 2021, 2:16 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 22 2021, 2:16 AM

Sounds good to me. Can you clean up the tests a little?

llvm/lib/Target/AArch64/AArch64InstrInfo.td
4795

Maybe explain the reason for these patterns? That they are for when only the bottom half of the add is used.

4803

Can you line these up? I'm pretty sure it's off by a space.

llvm/test/CodeGen/AArch64/mla_mls_merge.ll
4

You can remove these.

5

Remove dso_local and local_unnamed_addr.

19

Hmm. These tests could probably be simplified, or simpler versions added. I don't think that the urshl/store is needed if the value is returned directly, and the loaded values could be arguments?

Can you also run update_llc_test_checks on it.

274

You can remove these too.

avieira updated this revision to Diff 318532.Jan 22 2021, 8:27 AM

Updated the testcase. Ok to commit?

avieira marked 3 inline comments as done.Jan 22 2021, 8:27 AM
avieira added inline comments.
llvm/test/CodeGen/AArch64/mla_mls_merge.ll
274

I assume you meant the function attrs and not the intrinsic declarations.

dmgreen accepted this revision.Jan 22 2021, 8:38 AM

LGTM

llvm/test/CodeGen/AArch64/mla_mls_merge.ll
274

Yep. That's great. Thanks!

This revision is now accepted and ready to land.Jan 22 2021, 8:38 AM

Thanks. I'll wait till Monday to commit. To avoid Friday hit-and-run's ;)