Go to file
Artur Pilipenko 8fb3d57e67 [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
2017-01-25 16:00:44 +00:00
clang [clang-format] Implement comment reflowing. 2017-01-25 13:58:58 +00:00
clang-tools-extra [clang-tidy] Don't modernize-raw-string-literal if replacement is longer. 2017-01-24 15:18:11 +00:00
compiler-rt [compiler-rt] Fix xray compilation errors: errno and size_t 2017-01-25 14:20:30 +00:00
debuginfo-tests
libclc math: Add logb builtin 2017-01-18 03:14:10 +00:00
libcxx Implement LWG2556: Wide contract for future::share() 2017-01-24 23:28:25 +00:00
libcxxabi cxa_demangle: fix rvalue ref check 2017-01-24 19:57:05 +00:00
libunwind DWARF: fix -Asserts builds 2017-01-25 02:27:45 +00:00
lld [ELF] - Implemented support for R_386_PC8/R_386_8 relocations. 2017-01-25 13:36:49 +00:00
lldb include Host/Time.h in Cocoa.cpp 2017-01-25 11:19:49 +00:00
llgo [llgo] Remove support for LLVM attributes 2016-12-06 19:22:04 +00:00
llvm [Guards] Introduce loop-predication pass 2017-01-25 16:00:44 +00:00
openmp Use C++11 static_assert() for build asserts. 2017-01-18 07:49:30 +00:00
parallel-libs [Axccel] Remove -Wno-missing-braces in build 2016-12-19 21:34:07 +00:00
polly BlockGenerator: Do not redundantly reload from PHI-allocas in non-affine stmts 2017-01-19 14:12:45 +00:00