llvm-6502/lib
Sanjoy Das 0170a308ec 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.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226201 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-15 20:45:46 +00:00
..
Analysis [PM] Port TargetLibraryInfo to the new pass manager, provided by the 2015-01-15 11:39:46 +00:00
AsmParser
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 Switch this header file to not hard-code Windows line endings. 2015-01-15 02:21:56 +00:00
IR getMangledTypeStr: clarify how it mangles types, and add tests 2015-01-14 23:05:17 +00:00
IRReader
LineEditor
Linker
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 [cleanup] Re-sort all the #include lines in LLVM using 2015-01-14 11:23:27 +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 [Hexagon] Removing old versions of vsplice, valign, cl0, ct0 and updating references to new versions. 2015-01-15 19:28:32 +00:00
Transforms Add a new pass "inductive range check elimination" 2015-01-15 20:45:46 +00:00
CMakeLists.txt
LLVMBuild.txt
Makefile