This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Combine fadd into fcmla
ClosedPublic

Authored by dmgreen on Mar 20 2023, 1:23 AM.

Details

Summary

This adds a target combine for fadd(a, vcmla(b, c, d)) -> vcmla(fadd(a, b), b, c), pushing the fadd into the operands of the fcmla, which can help simplify away some additions.

Diff Detail

Event Timeline

dmgreen created this revision.Mar 20 2023, 1:23 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 20 2023, 1:23 AM
dmgreen requested review of this revision.Mar 20 2023, 1:23 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 20 2023, 1:23 AM
SjoerdMeijer added inline comments.Mar 20 2023, 2:31 AM
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
16483

Bit of a nit but just checking: do we have test cases where reassocation isn't allowed?

dmgreen updated this revision to Diff 506525.Mar 20 2023, 3:44 AM

We possibly do have a test like that in another file, but I've made sure we have a specific one in reassoc_nonfast_f32x4 at the end of the newly added tests.

SjoerdMeijer accepted this revision.Mar 20 2023, 7:09 AM

Cheers, this makes a lot of sense to me.

This revision is now accepted and ready to land.Mar 20 2023, 7:09 AM
This revision was landed with ongoing or failed builds.Mar 28 2023, 3:10 AM
This revision was automatically updated to reflect the committed changes.