aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineDominators.cpp
diff options
context:
space:
mode:
authorArtur Pilipenko <apilipenko@azulsystems.com>2017-01-25 16:00:44 +0000
committerArtur Pilipenko <apilipenko@azulsystems.com>2017-01-25 16:00:44 +0000
commit8fb3d57e679d6fc938634090d731d9a3e4aeb033 (patch)
treeb80909086a18a44d7b9508e19b011c9512cd28f5 /llvm/lib/CodeGen/MachineDominators.cpp
parent072e70b365c63d31403fbc1a365a2f50992f4492 (diff)
downloadllvm-8fb3d57e679d6fc938634090d731d9a3e4aeb033.zip
llvm-8fb3d57e679d6fc938634090d731d9a3e4aeb033.tar.gz
llvm-8fb3d57e679d6fc938634090d731d9a3e4aeb033.tar.bz2
[Guards] Introduce loop-predication pass
This patch introduces guard based loop predication optimization. The new LoopPredication pass tries to convert loop variant range checks to loop invariant by widening checks across loop iterations. For example, it will convert for (i = 0; i < n; i++) { guard(i < len); ... } to for (i = 0; i < n; i++) { guard(n - 1 < len); ... } After this transformation the condition of the guard is loop invariant, so loop-unswitch can later unswitch the loop by this condition which basically predicates the loop by the widened condition: if (n - 1 < len) for (i = 0; i < n; i++) { ... } else deoptimize This patch relies on an NFC change to make ScalarEvolution::isMonotonicPredicate public (revision 293062). Reviewed By: sanjoy Differential Revision: https://reviews.llvm.org/D29034 llvm-svn: 293064
Diffstat (limited to 'llvm/lib/CodeGen/MachineDominators.cpp')
0 files changed, 0 insertions, 0 deletions