[PATCH] D79175: [ARM][MVE] Tail-Predication: use @llvm.get.active.lane.mask to get the BTC

Sjoerd Meijer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 4 16:04:04 PDT 2020


SjoerdMeijer updated this revision to Diff 268604.
SjoerdMeijer added a comment.

I was just about to upload a new diff when I noticed your review. Many thanks again.

This includes 2 new function:

- `getNumElements()`: this looks in the preheader to see whether the number of elements value is already present, to avoid recreating it.
- `RevertActiveLaneMask()`: if it is not safe to lower @llvm.get.active.lane.mask to a VCTP, we recreate the icmp.

About testing:

> I'd like to see a few negative testcases, where we can't transform the llvm.get.active.lane.mask.

If have put most negative tests in `test/CodeGen/Thumb2/LowOverheadLoops/tail-pred-const.ll`:

- `@overflow`: this for over flow if BTC is a constant and UINT_MAX
- `@IV_not_an_induction`
- `@IV_wrong_step`
- `@IV_step_not_constant`
- `@outerloop_phi`
- `@overflow_in_sub`

And there is also one in `test/CodeGen/Thumb2/LowOverheadLoops/tail-reduce.ll`:

- `@reduction_not_guarded`: this checks for overflow if BTC is a runtime variable not guarded by a loop check.

These negative tests include checks to see if we recreate the icmp; it shouldn't emit @llvm.get.active.lane.mask or the VCTP.

I have already addressed the 2 minor comments, but TODO: I still need to look into the question about `!isKnownNonNegative`, as that doesn't seem to work for me (most tail predication start failing and are rejected because of overflow); need to look if I don't properly construct that SCEV expression, or something else.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79175/new/

https://reviews.llvm.org/D79175

Files:
  llvm/lib/Target/ARM/MVETailPredication.cpp
  llvm/test/CodeGen/Thumb2/LowOverheadLoops/basic-tail-pred.ll
  llvm/test/CodeGen/Thumb2/LowOverheadLoops/clear-maskedinsts.ll
  llvm/test/CodeGen/Thumb2/LowOverheadLoops/cond-vector-reduce-mve-codegen.ll
  llvm/test/CodeGen/Thumb2/LowOverheadLoops/extending-loads.ll
  llvm/test/CodeGen/Thumb2/LowOverheadLoops/fast-fp-loops.ll
  llvm/test/CodeGen/Thumb2/LowOverheadLoops/mve-tail-data-types.ll
  llvm/test/CodeGen/Thumb2/LowOverheadLoops/nested.ll
  llvm/test/CodeGen/Thumb2/LowOverheadLoops/tail-pred-const.ll
  llvm/test/CodeGen/Thumb2/LowOverheadLoops/tail-pred-widen.ll
  llvm/test/CodeGen/Thumb2/LowOverheadLoops/tail-reduce.ll
  llvm/test/CodeGen/Thumb2/LowOverheadLoops/vector-arith-codegen.ll
  llvm/test/CodeGen/Thumb2/LowOverheadLoops/vector-reduce-mve-tail.ll
  llvm/test/CodeGen/Thumb2/mve-fma-loops.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D79175.268604.patch
Type: text/x-patch
Size: 166356 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200604/943cf00b/attachment-0001.bin>


More information about the llvm-commits mailing list