This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][SVE] Add missing patterns for unpredicated subr intrinsics
ClosedPublic

Authored by bsmith on Sep 7 2021, 8:56 AM.

Diff Detail

Event Timeline

bsmith created this revision.Sep 7 2021, 8:56 AM
bsmith requested review of this revision.Sep 7 2021, 8:56 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 7 2021, 8:56 AM

My first thought is if you lowered "unpredicated" int_aarch64_sve_subr much like we do for int_aarch64_sve_sub, would we then get the isel improvements for free?

bsmith added a comment.Sep 7 2021, 9:41 AM

My first thought is if you lowered "unpredicated" int_aarch64_sve_subr much like we do for int_aarch64_sve_sub, would we then get the isel improvements for free?

I did consider this, however we'd have to add a new SUBR node for it, and given it won't be used elsewhere, unlike lowering the add, it didn't seem worth it. Additionally we wouldn't quite get the isel improvements for free as unpredicted subr is expressed in terms of sub, not subr, hence we'd still have to add extra patterns, they just wouldn't need to care about predicates.

That said, now that I think about it again, perhaps we could lower int_aarch64_sve_subr to a normal sub with reversed operands, which then I think would give us the isel for free, unless this is what you meant?

That said, now that I think about it again, perhaps we could lower int_aarch64_sve_subr to a normal sub with reversed operands, which then I think would give us the isel for free, unless this is what you meant?

Yes, this is exactly what I meant. I can see that we already lower int_aarch64_sve_sub to ISD::SUB and we have SUBR patterns for sub so the missing link looks like just lowering int_aarch64_sve_subr to ISD::SUB as well.

bsmith updated this revision to Diff 371310.Sep 8 2021, 4:06 AM
  • Lower subr intrinsics to a sub node with reversed operands rather than adding patterns for the intrinsic.
paulwalker-arm accepted this revision.Sep 8 2021, 5:06 AM
This revision is now accepted and ready to land.Sep 8 2021, 5:06 AM