[PATCH] D11706: [Unroll] Improve the brute force loop unroll estimate by propagating through PHI nodes across iterations.

Chandler Carruth chandlerc at gmail.com
Sun Aug 2 00:06:13 PDT 2015


chandlerc created this revision.
chandlerc added a reviewer: mzolotukhin.
chandlerc added a subscriber: llvm-commits.

This patch teaches the new advanced loop unrolling heuristics to propagate
constants into the loop from the preheader and around the backedge after
simulating each iteration. This lets us brute force solve simple recurrances
that aren't modeled effectively by SCEV. It also makes it more clear why we
need to process the loop in-order rather than bottom-up which might otherwise
make much more sense (for example, for DCE).

This came out of an attempt I'm making to develop a principled way to account
for dead code in the unroll estimation. When I implemented
a forward-propagating version of that it produced incorrect results due to
failing to propagate *cost* between loop iterations through the PHI nodes, and
it occured to me we really should at least propagate simplifications across
those edges, and it is quite easy thanks to the loop being in canonical and
LCSSA form.

http://reviews.llvm.org/D11706

Files:
  lib/Transforms/Scalar/LoopUnrollPass.cpp
  test/Transforms/LoopUnroll/full-unroll-heuristics-phi-prop.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D11706.31198.patch
Type: text/x-patch
Size: 6129 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150802/c2e6dc8d/attachment.bin>


More information about the llvm-commits mailing list