[PATCH] D18158: Adding ability to unroll loops using epilogue remainder.
Evgeny Stupachenko via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 14 14:17:05 PDT 2016
evstupac created this revision.
evstupac added reviewers: sanjoy, aizatsky, hfinkel, chandlerc, mzolotukhin.
evstupac added a subscriber: llvm-commits.
evstupac set the repository for this revision to rL LLVM.
Herald added a subscriber: sanjoy.
The patch adds an ability to unroll loops using epilogue remainder and makes it default (instead of current prologue),
The epilogue remainder is better as it do not produce additional non-constant phi nodes.
for(i = 0; i < n; i++)
For now loop unrolling looks like:
ip = phi [0, ip.next]
ip.next = ip + 1
cmp ip, n&7
i0 = phi [0, ip.next]
LOOP (unrolling on 8):
i = phi [**i0**, i.next]
i.next = i + 1
cmp i, n
In the LOOP (this is supposed to be unrolled) we have i = phi [**i0**, i.next].
Basically, that means that we don't know where we start now, however before unrolling we knew the start position is 0.
Assuming unrolled part of the loop is hotter than remainder (prologue currently), it is better to move this induction variable with unknown start to remainder code (which is done by epilogue technique).
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 47123 bytes
Desc: not available
More information about the llvm-commits