This is an archive of the discontinued LLVM Phabricator instance.

[ARM] Sink splats to vector float instructions
ClosedPublic

Authored by dmgreen on Mar 11 2020, 1:33 PM.

Details

Summary

Some MVE floating point instruction have gpr register variants that take the scalar gpr value and splat them to all lanes. In order to accept them in loops, the shuffle_vector and insert need to be sunk down into the loop, next to the instruction so that ISel can see the whole pattern.

This does that sinking for FAdd, FSub, FMul and FCmp. The patterns for mul are slightly more constrained as there are no fms variants taking register arguments.

Diff Detail

Event Timeline

dmgreen created this revision.Mar 11 2020, 1:33 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 11 2020, 1:33 PM

Annoying about the vmovs.... I can't see, with register aliasing, how this codegen wouldn't be a regression.

llvm/test/CodeGen/Thumb2/mve-floatregloops.ll
644 ↗(On Diff #249738)

So why has this caused the vdup to not be hoisted anymore?

dmgreen marked an inline comment as done.Mar 12 2020, 7:17 AM

Annoying about the vmovs.... I can't see, with register aliasing, how this codegen wouldn't be a regression.

Certainly would be on it's own, but people will be writing similar code with intrinsics anyway so is something we need to get sorted. The second part is in D76024 if you didn't already see it. Plan is to commit them together, but I needed the tests from here to test that patch.

llvm/test/CodeGen/Thumb2/mve-floatregloops.ll
644 ↗(On Diff #249738)

The vdup depends on the vmov and the vmov isn't hoisted.

samparker accepted this revision.Mar 13 2020, 5:03 AM

Ok, if this unblocks the LICM, then LGTM.

llvm/test/CodeGen/Thumb2/mve-floatregloops.ll
644 ↗(On Diff #249738)

facepalm.

This revision is now accepted and ready to land.Mar 13 2020, 5:03 AM
dmgreen updated this revision to Diff 251998.Mar 23 2020, 5:36 AM
dmgreen edited the summary of this revision. (Show Details)

Rebased onto the VDUP type changes.

This revision was automatically updated to reflect the committed changes.