This is an archive of the discontinued LLVM Phabricator instance.

[ARM] MVE VMULL patterns
ClosedPublic

Authored by dmgreen on Mar 24 2020, 4:32 PM.

Details

Summary

This adds MVE vmull patterns, which are conceptually the same as mul(vmovl, vmovl), and so the tablegen patterns follow the same structure.

For i8 and i16 this is simple enough, but in the i32 version the multiply (in 64bits) is illegal, meaning we need to catch the pattern earlier in a dag fold. Because bitcasts are involved in the zext versions and the patterns are a little different in little and big endian. I have only added little endian support in this patch.

Diff Detail

Event Timeline

dmgreen created this revision.Mar 24 2020, 4:32 PM
samparker added inline comments.Mar 25 2020, 5:28 AM
llvm/lib/Target/ARM/ARMISelLowering.cpp
12166

I'm a bit confused here... this looks like the AND mask is taking the 'top' parts of the elements, and if so, why don't we have to handle a 'bottom' element mask? Is this to do with the revs I see in the isel patterns?

dmgreen updated this revision to Diff 252871.Mar 26 2020, 9:08 AM
dmgreen marked an inline comment as done.

Added some tests for both top and bottom vmull's

llvm/lib/Target/ARM/ARMISelLowering.cpp
12166

I think this is bottom half? The 0 element is bottom half of the i64, 1 element would be top half of it.

And yes, the other pattern vmullt is the same pattern with some vrev's that we match in tablegen.

You reminded me that I did want to add some tests for both top and bottom at the same time.

samparker accepted this revision.Mar 27 2020, 5:09 AM

LGTM

llvm/lib/Target/ARM/ARMISelLowering.cpp
12166

Hmm, not sure how I misread that!

llvm/test/CodeGen/Thumb2/mve-vmull.ll
52

Do you know why we sometimes can't write to q0 too?

This revision is now accepted and ready to land.Mar 27 2020, 5:09 AM
dmgreen marked an inline comment as done.Apr 1 2020, 5:12 AM

Thanks.

llvm/test/CodeGen/Thumb2/mve-vmull.ll
52

The i32 version is earlyclobber because it needs to work cross-lane. I think it's UNPREDICTABLE if Qd == Qn or Qm

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptApr 2 2020, 3:14 AM