llvm-6502/lib/Transforms/Utils
Hans Wennborg 09a31f3154 Allow switch-to-lookup table for tables with holes by adding bitmask check
This allows us to generate table lookups for code such as:

  unsigned test(unsigned x) {
    switch (x) {
      case 100: return 0;
      case 101: return 1;
      case 103: return 2;
      case 105: return 3;
      case 107: return 4;
      case 109: return 5;
      case 110: return 6;
      default: return f(x);
    }
  }

Since cases 102, 104, etc. are not constants, the lookup table has holes
in those positions. We therefore guard the table lookup with a bitmask check.

Patch by Jasper Neumann!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203694 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-12 18:35:40 +00:00
..
AddDiscriminators.cpp [Layering] Move DebugInfo.h into the IR library where its implementation 2014-03-06 00:46:21 +00:00
ASanStackFrameLayout.cpp [asan] fix ndebug build with strict warnings (-Wunused-variable) 2013-12-06 09:26:09 +00:00
BasicBlockUtils.cpp [Modules] Move ValueHandle into the IR library where Value itself lives. 2014-03-04 11:17:44 +00:00
BreakCriticalEdges.cpp [C++11] Add 'override' keyword to virtual methods that override their base class. 2014-03-05 09:10:37 +00:00
BuildLibCalls.cpp Revert r203488 and r203520. 2014-03-12 18:09:37 +00:00
BypassSlowDivision.cpp
CloneFunction.cpp Cloning a function now also clones its debug metadata if 'ModuleLevelChanges' is true. 2014-03-12 14:42:51 +00:00
CloneModule.cpp
CMakeLists.txt Pass to emit DWARF path discriminators. 2014-03-03 20:06:11 +00:00
CmpInstAnalysis.cpp
CodeExtractor.cpp [C++11] Add range based accessors for the Use-Def chain of a Value. 2014-03-09 03:16:01 +00:00
DemoteRegToStack.cpp [C++11] Add range based accessors for the Use-Def chain of a Value. 2014-03-09 03:16:01 +00:00
FlattenCFG.cpp Fix known typos 2014-01-24 17:20:08 +00:00
GlobalStatus.cpp [C++11] Add range based accessors for the Use-Def chain of a Value. 2014-03-09 03:16:01 +00:00
InlineFunction.cpp [C++11] Add range based accessors for the Use-Def chain of a Value. 2014-03-09 03:16:01 +00:00
InstructionNamer.cpp [C++11] Add 'override' keyword to virtual methods that override their base class. 2014-03-05 09:10:37 +00:00
IntegerDivision.cpp Add support for software expansion of 64-bit integer division instructions. 2013-11-19 06:54:19 +00:00
LCSSA.cpp [C++11] Add range based accessors for the Use-Def chain of a Value. 2014-03-09 03:16:01 +00:00
LLVMBuild.txt
Local.cpp [C++11] Add range based accessors for the Use-Def chain of a Value. 2014-03-09 03:16:01 +00:00
LoopSimplify.cpp [C++11] Add 'override' keyword to virtual methods that override their base class. 2014-03-05 09:10:37 +00:00
LoopUnroll.cpp [LPM] Fix PR18616 where the shifts to the loop pass manager to extract 2014-01-28 01:25:38 +00:00
LoopUnrollRuntime.cpp
LowerExpectIntrinsic.cpp [C++11] Add 'override' keyword to virtual methods that override their base class. 2014-03-05 09:10:37 +00:00
LowerInvoke.cpp [C++11] Add range based accessors for the Use-Def chain of a Value. 2014-03-09 03:16:01 +00:00
LowerSwitch.cpp [C++11] Add 'override' keyword to virtual methods that override their base class. 2014-03-05 09:10:37 +00:00
Makefile
Mem2Reg.cpp [C++11] Add 'override' keyword to virtual methods that override their base class. 2014-03-05 09:10:37 +00:00
MetaRenamer.cpp [C++11] Add 'override' keyword to virtual methods that override their base class. 2014-03-05 09:10:37 +00:00
ModuleUtils.cpp
PromoteMemoryToRegister.cpp [C++11] Add range based accessors for the Use-Def chain of a Value. 2014-03-09 03:16:01 +00:00
SimplifyCFG.cpp Allow switch-to-lookup table for tables with holes by adding bitmask check 2014-03-12 18:35:40 +00:00
SimplifyIndVar.cpp [C++11] Add range based accessors for the Use-Def chain of a Value. 2014-03-09 03:16:01 +00:00
SimplifyInstructions.cpp [C++11] Add range based accessors for the Use-Def chain of a Value. 2014-03-09 03:16:01 +00:00
SimplifyLibCalls.cpp [C++11] Add range based accessors for the Use-Def chain of a Value. 2014-03-09 03:16:01 +00:00
SpecialCaseList.cpp Replace OwningPtr<T> with std::unique_ptr<T>. 2014-03-06 05:51:42 +00:00
SSAUpdater.cpp [Modules] Move CFG.h to the IR library as it defines graph traits over 2014-03-04 11:45:46 +00:00
UnifyFunctionExitNodes.cpp
Utils.cpp Pass to emit DWARF path discriminators. 2014-03-03 20:06:11 +00:00
ValueMapper.cpp