This is an archive of the discontinued LLVM Phabricator instance.

[ARM][MVE] LowOverheadLoops: DCE on the iteration count setup expression
ClosedPublic

Authored by SjoerdMeijer on Feb 4 2020, 1:42 AM.

Details

Summary

Once we have created a tail-predicated hardware-loop, and thus know the number of elements that are processed, we want to clean-up the iteration count expression of that loop. In D73682, we bailed the analysis on conditionally executed instructions. This adds support for IT-blocks, so that we can handle these cases again. The restriction is that we only support IT blocks containing 1 statement, but that seems to cover most cases and forms of the iteration count expression.

Diff Detail

Event Timeline

SjoerdMeijer created this revision.Feb 4 2020, 1:42 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 4 2020, 1:42 AM

Would you mind adding a couple of other tests, both for IT blocks with multiple instructions:

  1. insert another instruction in the chain before LSL, so we have a larger predicated block.
  2. with an instruction not in the iteration count use-def chain, but still in the same IT, something like: IT, LSL, SOME_RANDOM_INST
llvm/lib/Target/ARM/ARMLowOverheadLoops.cpp
850

Could you remove these now, they've been laying around dead for a while.

890

just returning is fine.

Thanks for looking and the suggestion. Added test case it-block-random.mir showed that I was missing a case: an instruction in the IT block not connected to the use-def chain, so fixed that.

samparker accepted this revision.Feb 5 2020, 7:06 AM

LGTM. Cheers!

This revision is now accepted and ready to land.Feb 5 2020, 7:06 AM
This revision was automatically updated to reflect the committed changes.