[PATCH] D36102: [Polly][ForwardOpTree] Support synthesizable values.

Michael Kruse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 31 12:28:38 PDT 2017


Meinersbur created this revision.
Meinersbur added a project: Polly.
Herald added a reviewer: bollu.

This allows -polly-optree to move instructions that depend on synthesizable values.

The difficulty for synthesizable values is that their value depends on the location. When it is moved over a loop header, and the SCEV expression depends on the loop induction variable (SCEVAddRecExpr), it would use the current induction variable instead of the last one.

At the moment we cannot forward PHI nodes such that crossing the header of loops referenced by SCEVAddRecExpr is not possible (assuming the loop header has at least two incoming blocks: for entering the loop and the backedge, such any instruction to be forwarded must have a phi between use and definition).

A remaining issue is when the forwarded value is used after the loop, but is only synthesizable inside the loop. This happens e.g. if ScalarEvolution is unable to determine the number of loop iterations or the initial loop value. We do not forward in this situation.


https://reviews.llvm.org/D36102

Files:
  lib/Transform/ForwardOpTree.cpp
  test/ForwardOpTree/forward_synthesizable_definloop.ll
  test/ForwardOpTree/forward_synthesizable_indvar.ll
  test/ForwardOpTree/forward_synthesizable_useinloop.ll
  test/ForwardOpTree/noforward_synthesizable.ll
  test/ForwardOpTree/noforward_synthesizable_unknownit.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D36102.108970.patch
Type: text/x-patch
Size: 11975 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170731/5c08626c/attachment.bin>


More information about the llvm-commits mailing list