This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] lower abs intrinsic to new ABS instruction in SelDag
ClosedPublic

Authored by stuij on Nov 28 2022, 6:34 AM.

Details

Summary

When feature CSSC is available, the SelectionDag abs intrinsic should map to the
new scalar ABS instruction.

Additionally, the SIMDTwoScalarD tablegen defm includes a pattern match for
scalar i64, which we don't want to use when CSSC is enabled.

spec:
https://developer.arm.com/documentation/ddi0602/2022-09/Base-Instructions/ABS--Absolute-value-

Diff Detail

Event Timeline

stuij created this revision.Nov 28 2022, 6:34 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 28 2022, 6:34 AM
stuij requested review of this revision.Nov 28 2022, 6:34 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 28 2022, 6:34 AM

Tests LGTM. One slight cleanup would be neater.

llvm/lib/Target/AArch64/AArch64InstrFormats.td
7269

This would be equivalent and neater, and allow multiple predicates.

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

Not needed if you use the list of predicates.

5070

This would be the relevant update here to match the suggested edit above.

Matt added a subscriber: Matt.Nov 28 2022, 1:12 PM
dmgreen added inline comments.Nov 28 2022, 1:56 PM
llvm/lib/Target/AArch64/AArch64InstrFormats.td
7274

I'm not sure this pattern will be used for anything. It can probably just be removed without modifying any tests.

stuij updated this revision to Diff 480057.Dec 5 2022, 5:00 AM

addressed review comment

stuij marked 4 inline comments as done.Dec 5 2022, 5:03 AM
stuij added inline comments.
llvm/lib/Target/AArch64/AArch64InstrFormats.td
7269

That syntax isn't quite right, as Predicates isn't a list, but I appreciate the idea. Changed the code in the spririt of your idea.

7274

Thanks! I prefer to create another patch for that as I feel it just falls outside of the scope of this patch.

lenary accepted this revision.Dec 5 2022, 6:07 AM
This revision is now accepted and ready to land.Dec 5 2022, 6:07 AM
This revision was landed with ongoing or failed builds.Dec 6 2022, 2:48 AM
This revision was automatically updated to reflect the committed changes.
stuij marked 2 inline comments as done.