llvm-6502/include/llvm
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
..
ADT [cleanup] Re-sort all the #include lines in LLVM using 2015-01-14 11:23:27 +00:00
Analysis [PM] Port TargetLibraryInfo to the new pass manager, provided by the 2015-01-15 11:39:46 +00:00
AsmParser
Bitcode AsmParser/Bitcode: Add support for MDLocation 2015-01-13 21:10:44 +00:00
CodeGen Remove dead code for llvm.eh.selector in the old EH model 2015-01-14 18:49:39 +00:00
Config [multilib] Add support to the autoconf build to substitute 2014-12-29 11:58:17 +00:00
DebugInfo [cleanup] Re-sort all the #include lines in LLVM using 2015-01-14 11:23:27 +00:00
ExecutionEngine [MCJIT] Unique-ptrify the RTDyldMemoryManager member of MCJIT. NFC. 2014-12-03 00:51:19 +00:00
IR [GC] CodeGenPrep transform: simplify offsetable relocate 2015-01-14 23:27:07 +00:00
IRReader
LineEditor
Linker Use the DiagnosticHandler to print diagnostics when reading bitcode. 2015-01-10 00:07:30 +00:00
LTO Remove StringMap::GetOrCreateValue in favor of StringMap::insert 2014-11-19 05:49:42 +00:00
MC Revert "Add r224985 back with two fixes." 2015-01-14 19:07:23 +00:00
Object [cleanup] Re-sort all the #include lines in LLVM using 2015-01-14 11:23:27 +00:00
Option
ProfileData [cleanup] Re-sort all the #include lines in LLVM using 2015-01-14 11:23:27 +00:00
Support Add missing include directive for llvm::make_unique(). 2015-01-15 00:11:36 +00:00
TableGen Make MultiClass::DefPrototypes own their Records to fix memory leaks. 2014-12-11 05:25:33 +00:00
Target [PM] Move TargetLibraryInfo into the Analysis library. 2015-01-15 02:16:27 +00:00
Transforms Add a new pass "inductive range check elimination" 2015-01-15 20:45:46 +00:00
CMakeLists.txt
InitializePasses.h Add a new pass "inductive range check elimination" 2015-01-15 20:45:46 +00:00
LinkAllIR.h
LinkAllPasses.h Add a new pass "inductive range check elimination" 2015-01-15 20:45:46 +00:00
module.modulemap Update the modules build to match r223802. 2014-12-12 02:25:18 +00:00
module.modulemap.build
Pass.h
PassAnalysisSupport.h
PassInfo.h
PassManager.h
PassRegistry.h
PassSupport.h