This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Prepare for changes to STEP_VECTOR.
ClosedPublic

Authored by efriedma on Jul 12 2021, 2:44 PM.

Details

Summary

Rewrite patterns to assume that the operand of STEP_VECTOR is a constant. The old patterns will stop working when the operand is changed from a Constant to a TargetConstant. (See D105673.)

Add test coverage for certain patterns that weren't exercised by existing regression tests.

Diff Detail

Event Timeline

efriedma created this revision.Jul 12 2021, 2:44 PM
efriedma requested review of this revision.Jul 12 2021, 2:44 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 12 2021, 2:44 PM

The changes to the existing patterns look sensible to me, but maybe someone else can take a look at the new patterns?

llvm/lib/Target/AArch64/SVEInstrFormats.td
4924

To be honest I find it a bit difficult to work out what's going on here and what pattern it's matching. Is it possible to point to a specific test that's defending this?

efriedma added inline comments.Jul 15 2021, 10:06 AM
llvm/lib/Target/AArch64/SVEInstrFormats.td
4924

The patterns involving trunc_imm are there to ensure we generate MOVi32imm where legal, instead of MOVi64imm. Normally, the patterns for immediates would do that, but we aren't using the regular patterns here because the operand of step_vector isn't a normal register value.

In the assembly, this means we print "mov w8, #2222" instead of "mov x8, #2222". See, for example, mul_stepvector_nxv2i64.

david-arm accepted this revision.Jul 16 2021, 6:31 AM

LGTM! OK thanks for the explanation!

This revision is now accepted and ready to land.Jul 16 2021, 6:31 AM
This revision was landed with ongoing or failed builds.Jul 17 2021, 2:14 PM
This revision was automatically updated to reflect the committed changes.