llvm-6502/lib
Sanjoy Das 148e8c9b8b Add a new pass "inductive range check elimination"
IRCE eliminates range checks of the form

  0 <= A * I + B < Length

by splitting a loop's iteration space into three segments in a way
that the check is completely redundant in the middle segment.  As an
example, IRCE will convert

  len = < known positive >
  for (i = 0; i < n; i++) {
    if (0 <= i && i < len) {
      do_something();
    } else {
      throw_out_of_bounds();
    }
  }

to

  len = < known positive >
  limit = smin(n, len)
  // no first segment
  for (i = 0; i < limit; i++) {
    if (0 <= i && i < len) { // this check is fully redundant
      do_something();
    } else {
      throw_out_of_bounds();
    }
  }
  for (i = limit; i < n; i++) {
    if (0 <= i && i < len) {
      do_something();
    } else {
      throw_out_of_bounds();
    }
  }


IRCE can deal with multiple range checks in the same loop (it takes
the intersection of the ranges that will make each of them redundant
individually).

Currently IRCE does not do any profitability analysis.  That is a
TODO.

Please note that the status of this pass is *experimental*, and it is
not part of any default pass pipeline.  Having said that, I will love
to get feedback and general input from people interested in trying
this out.

This pass was originally r226201.  It was reverted because it used C++
features not supported by MSVC 2012.

Differential Revision: http://reviews.llvm.org/D6693



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226238 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-16 01:03:22 +00:00
..
Analysis [PM] Port TargetLibraryInfo to the new pass manager, provided by the 2015-01-15 11:39:46 +00:00
AsmParser AsmParser/Bitcode: Add support for MDLocation 2015-01-13 21:10:44 +00:00
Bitcode Revert Don't create new comdats in CodeGen 2015-01-15 16:14:34 +00:00
CodeGen Revert "r226086 - Revert "r226071 - [RegisterCoalescer] Remove copies to reserved registers"" 2015-01-15 20:32:09 +00:00
DebugInfo [cleanup] Re-sort all the #include lines in LLVM using 2015-01-14 11:23:27 +00:00
ExecutionEngine Fixing pedantic build warnings. 2015-01-15 21:50:53 +00:00
IR getMangledTypeStr: clarify how it mangles types, and add tests 2015-01-14 23:05:17 +00:00
IRReader Remove unused variable. NFC. 2014-11-06 23:16:57 +00:00
LineEditor
Linker Use the DiagnosticHandler to print diagnostics when reading bitcode. 2015-01-10 00:07:30 +00:00
LTO Update libdeps since TLI was moved from Target to Analysis in r226078. 2015-01-15 05:21:00 +00:00
MC Replace size method call of containers to empty method where appropriate 2015-01-15 11:41:30 +00:00
Object This should fix the build bot clang-cmake-armv7-a15-full failing on 2015-01-16 00:27:31 +00:00
Option [cleanup] Re-sort all the #include lines in LLVM using 2015-01-14 11:23:27 +00:00
ProfileData Replace size method call of containers to empty method where appropriate 2015-01-15 11:41:30 +00:00
Support [cleanup] Re-sort all the #include lines in LLVM using 2015-01-14 11:23:27 +00:00
TableGen Replace size method call of containers to empty method where appropriate 2015-01-15 11:41:30 +00:00
Target R600/SI: Add patterns for v_cvt_{flr|rpi}_i32_f32 2015-01-15 23:58:35 +00:00
Transforms Add a new pass "inductive range check elimination" 2015-01-16 01:03:22 +00:00
CMakeLists.txt
LLVMBuild.txt
Makefile