This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Explicitly use v1i64 type for llvm.aarch64.neon.pmull64
ClosedPublic

Authored by mingmingl on Jul 25 2022, 10:52 PM.

Details

Summary

Without this, the intrinsic will be expanded to an integer; thereby an
explicit copy (from GPR to SIMD register) will be codegen'd. This matches the
general convention of using "v1" types to represent scalar integer operations in
vector registers.

The similar approach is observed in D56616, and the pattern likely applies on
other intrinsic that accepts integer scalars (e.g.,
int_aarch64_neon_sqdmulls_scalar)

Diff Detail

Event Timeline

mingmingl created this revision.Jul 25 2022, 10:52 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 25 2022, 10:52 PM
mingmingl requested review of this revision.Jul 25 2022, 10:52 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 25 2022, 10:52 PM

run 'clang-format' and polish comment

Thanks, this sounds good to me.

llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
4555

Can we do this for all operands, not just loads? We should end up adding the i64->v1i64 copy in either case.

4556

Op1.getValueType()

llvm/test/CodeGen/AArch64/pmull-ldr-merge.ll
3

I think use -mattr=+aes. (Even is that is not technically correct, it is what the instruction uses)
And it doesn't need CHECK-SDAG

33

The test could be simpler if it wasn't in a loop.

mingmingl updated this revision to Diff 447841.Jul 26 2022, 2:51 PM
mingmingl marked 4 inline comments as done.

address comments.

llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
4555

Generalize by doing this for all operands, except when they are higher half of the SIMD register, and added comments to explain why.

Also add test2 and test3 for this generalization

Also I'd be glad to send an NFC patch of the test case first, and the diffs become more obvious with this patch.

dmgreen accepted this revision.Jul 27 2022, 1:01 AM

Thanks, LGTM.

llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
4560

We can drop the brackets around single statements.

This revision is now accepted and ready to land.Jul 27 2022, 1:01 AM
mingmingl marked an inline comment as done.

drop the bracket around single statements.

Thanks, LGTM.

Thanks for the quick reviews and feedback!

This revision was landed with ongoing or failed builds.Jul 27 2022, 11:11 AM
This revision was automatically updated to reflect the committed changes.