[PATCH] D72714: [ARM][MVE] Tail-Predication: rematerialise iteration count in exit blocks

Sjoerd Meijer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 17 00:55:43 PST 2020


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

I think this should cover it now, and address the comments:

- `RematerializeIterCount()` is only called when we've cloned the VCTP instruction in an exit block, this makes the unrelated test case go away.
- `RematerializeIterCount()` has become really simple with just a call to `formLCSSARecursively()` (and of course `rewriteLoopExitValues()`) because when there's nothing to do, formLCSSARecursively is a cheap operation, so we indeed don't need to check first if the loop is in LCSSA form.
- One of the motivating examples for this work and optimisation is a reduction in vector-reduce-mve-tail.ll. I decided to use `formLCSSARecursively, instead of manually inserting a phi, because there are a few values live-out, the ones that feed the final reduction. We need to insert 3 Phi nodes, thus I don't think it is worth optimising and calling formLCSSARecursively is best.
- This is tested by exiting tests. For example, the reductions vector-reduce-mve-tail.ll will bring it in LCSSA form first, and is testing that. Simpler tests elsewhere check when this doesn't need to happen first.


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

https://reviews.llvm.org/D72714

Files:
  llvm/lib/Target/ARM/MVETailPredication.cpp
  llvm/test/CodeGen/Thumb2/LowOverheadLoops/cond-vector-reduce-mve-codegen.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/vector-arith-codegen.ll
  llvm/test/CodeGen/Thumb2/LowOverheadLoops/vector-reduce-mve-tail.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D72714.238706.patch
Type: text/x-patch
Size: 23218 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200117/be40416c/attachment.bin>


More information about the llvm-commits mailing list