This is an archive of the discontinued LLVM Phabricator instance.

[ARM][LowOverheadLoops] DoubleWidthResult instructions canGenerateZeros
ClosedPublic

Authored by samparker on Mar 25 2020, 5:07 AM.

Details

Summary

Given that some instructions generate wider result elements than their inputs, flag them as being able to generate non zeros in the false lanes.

Diff Detail

Event Timeline

samparker created this revision.Mar 25 2020, 5:07 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 25 2020, 5:07 AM

A few irrelevant nits inlined, but also one question about the test.

llvm/lib/Target/ARM/ARMLowOverheadLoops.cpp
530

nit: this is absolutely fine of course, but you do have a little helper function just below this function for the similar RetainsPreviousHalfElement MI description. Perhaps a bit more consistent to add this as a helper too, and that would nicely cluster these helpers.

539

Nit: probably better to just remove these commented out cases, and mention these opcodes in the FIXME, so that also the FIXME becomes a bit more descriptive.

541

Nit: now that we have more classes of instructions that don't respect the lane values, the double width instructions added above, can you comment what's "wrong" with the opcodes below.

llvm/test/CodeGen/Thumb2/LowOverheadLoops/vaddv.mir
754

Do we need to test some other opcodes too that have been marked as DoubleWidth? Like MVE_VSHLL, VMOVL, VQDMULL? Or is this perhaps already tested elsewhere?

samparker marked 2 inline comments as done.Mar 27 2020, 6:50 AM
samparker added inline comments.
llvm/lib/Target/ARM/ARMLowOverheadLoops.cpp
530

Yeah, I had the same thought.

llvm/test/CodeGen/Thumb2/LowOverheadLoops/vaddv.mir
754

I want to use the unit test to cover the opcodes, and this test was to check that the logic in the pass was reading the flags correctly.

SjoerdMeijer accepted this revision.Mar 27 2020, 7:09 AM

Cheers, with some nits addressed this looks good.

llvm/test/CodeGen/Thumb2/LowOverheadLoops/vaddv.mir
754

Ah yeah, somehow I keep forgetting these unit tests.

This revision is now accepted and ready to land.Mar 27 2020, 7:09 AM
samparker updated this revision to Diff 253115.Mar 27 2020, 7:17 AM
  • Made a helper
  • Modified/added some comments.
This revision was automatically updated to reflect the committed changes.