[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
Mon Jun 8 14:25:14 PDT 2020


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

> Maybe instead of querying SCEV about (((ElementCount + (VectorWidth - 1)) / VectorWidth) - TripCount, it would be easier for SCEV to reason about ((ElementCount + (VectorWidth - 1)) - TripCount * VectorWidth?

Thanks! I might have tried this (have tried many different expression, with/without overflow flags, etc), but will double check tomorrow.

I was actually just uploading an approach using integer ranges. If we know that:

  Range(ElementCount + (VectorWidth-1) / VectorWidth) - Range(TC) == 0

If this set difference results in the empty set, we know overflow doesn't happen.
This seems to work for all cases, i.e. when values are runtime values or constants, and is a simple check.


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.269352.patch
Type: text/x-patch
Size: 167480 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200608/1c22923b/attachment-0001.bin>


More information about the llvm-commits mailing list