llvm-6502/include/llvm
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
..
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 Pass a MemoryBufferRef when we can avoid taking ownership. 2014-08-26 21:49:01 +00:00
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 Pass a MemoryBufferRef when we can avoid taking ownership. 2014-08-26 21:49:01 +00:00
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 Add the option, -archive-headers, used with -macho to print the Mach-O archive headers to llvm-objdump. 2015-01-15 23:19:11 +00:00
Option Add an overload of getLastArgNoClaim taking two OptSpecifiers. 2014-09-12 19:42:53 +00:00
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-16 01:03:22 +00:00
CMakeLists.txt Remove llvm_headers_do_not_build for the benefit of XCode and Visual Studio users. 2014-08-14 00:51:47 +00:00
InitializePasses.h Add a new pass "inductive range check elimination" 2015-01-16 01:03:22 +00:00
LinkAllIR.h
LinkAllPasses.h Add a new pass "inductive range check elimination" 2015-01-16 01:03:22 +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 Remove pimpl class from PassRegistry. 2014-06-12 16:06:51 +00:00
PassManager.h
PassRegistry.h [PM] Remove an unused and rather expensive mapping from an analysis 2014-10-06 00:30:59 +00:00
PassSupport.h Defining a new API for debug options that doesn't rely on static global cl::opts. 2014-10-15 21:54:35 +00:00