llvm-6502/lib/Transforms/Utils
Stepan Dyatkovskiy 484fc93eff PR1255: Case Ranges
Implemented IntItem - the wrapper around APInt. Why not to use APInt item directly right now?
1. It will very difficult to implement case ranges as series of small patches. We got several large and heavy patches. Each patch will about 90-120 kb. If you replace ConstantInt with APInt in SwitchInst you will need to changes at the same time all Readers,Writers and absolutely all passes that uses SwitchInst.
2. We can implement APInt pool inside and save memory space. E.g. we use several switches that works with 256 bit items (switch on signatures, or strings). We can avoid value duplicates in this case.
3. IntItem can be easyly easily replaced with APInt.
4. Currenly we can interpret IntItem both as ConstantInt and as APInt. It allows to provide SwitchInst methods that works with ConstantInt for non-updated passes.

Why I need it right now? Currently I need to update SimplifyCFG pass (EqualityComparisons). I need to work with APInts directly a lot, so peaces of code
ConstantInt *V = ...;
if (V->getValue().ugt(AnotherV->getValue()) {
  ...
}
will look awful. Much more better this way:
IntItem V = ConstantIntVal->getValue();
if (AnotherV < V) {
}

Of course any reviews are welcome.

P.S.: I'm also going to rename ConstantRangesSet to IntegersSubset, and CRSBuilder to IntegersSubsetMapping (allows to map individual subsets of integers to the BasicBlocks).
Since in future these classes will founded on APInt, it will possible to use them in more generic ways.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157576 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-28 12:39:09 +00:00
..
AddrModeMatcher.cpp Add a little heuristic to Value::isUsedInBasicBlock to speed it up for small basic blocks. 2011-12-05 17:23:27 +00:00
BasicBlockUtils.cpp Remove unreachable code. (replace with llvm_unreachable to help GCC where necessary) 2012-01-17 04:43:56 +00:00
BreakCriticalEdges.cpp Second attempt at PR12573: 2012-04-30 10:44:54 +00:00
BuildLibCalls.cpp switch AttrListPtr::get to take an ArrayRef, simplifying a lot of clients. 2012-05-28 01:47:44 +00:00
CloneFunction.cpp Sink the collection of return instructions until after *all* 2012-04-06 17:21:31 +00:00
CloneModule.cpp Fix llvm::CloneModule to correctly clone globals. Patch per bug report by Simon Moll on llvmdev. 2011-08-15 21:05:06 +00:00
CMakeLists.txt Remove the basic inliner. This was added in 2007, and hasn't really 2012-03-15 01:37:56 +00:00
CmpInstAnalysis.cpp Convert assert(0) to llvm_unreachable 2012-02-07 05:05:23 +00:00
CodeExtractor.cpp Teach the code extractor how to extract a sequence of blocks from 2012-05-04 21:33:30 +00:00
DemoteRegToStack.cpp Remove redundant comment. Use a more efficient datatype. 2012-02-17 02:12:54 +00:00
InlineFunction.cpp Tidy. 2012-03-26 19:09:40 +00:00
InstructionNamer.cpp Get rid of static constructors for pass registration. Instead, every pass exposes an initializeMyPassFunction(), which 2010-10-19 17:21:58 +00:00
LCSSA.cpp There is no need to force DebugLoc on a PHI at this point. 2011-05-16 22:05:03 +00:00
LLVMBuild.txt LLVMBuild: Remove trailing newline, which irked me. 2011-12-12 19:48:00 +00:00
Local.cpp PR1255: Case Ranges 2012-05-28 12:39:09 +00:00
LoopSimplify.cpp LoopSimplify bug fix. Handle indirect loop back edges. 2012-03-20 21:24:52 +00:00
LoopUnroll.cpp Allow NULL LoopPassManager argument in UnrollLoop. PR12734. 2012-05-08 02:52:09 +00:00
LoopUnrollRuntime.cpp Allow NULL LoopPassManager argument in UnrollLoop. PR12734. 2012-05-08 02:52:09 +00:00
LowerExpectIntrinsic.cpp Add support for branch weight metadata to MDBuilder and use it in various places. 2012-05-26 13:59:43 +00:00
LowerInvoke.cpp [unwind removal] We no longer have 'unwind' instructions being generated, so 2012-02-06 21:16:41 +00:00
LowerSwitch.cpp PR1255: Case Ranges 2012-05-28 12:39:09 +00:00
Makefile make -fno-rtti the default unless a directory builds with REQUIRES_RTTI. 2010-01-24 20:43:08 +00:00
Mem2Reg.cpp Remove outdated references to dominance frontiers. 2011-01-18 03:53:26 +00:00
ModuleUtils.cpp [asan] fix a bug (issue 19) where dlclose and the following mmap caused a false positive. compiler part. 2011-12-15 21:59:03 +00:00
PromoteMemoryToRegister.cpp Switch mem2reg to use the new hashing infrastructure. 2012-03-05 11:29:56 +00:00
SimplifyCFG.cpp SimplifyCFG: Turn the ad-hoc std::pair that represents switch cases into an explicit struct. 2012-05-26 14:29:37 +00:00
SimplifyIndVar.cpp Remove unused simplifyIVUsers 2012-03-22 17:47:30 +00:00
SimplifyInstructions.cpp Propagate TargetLibraryInfo throughout ConstantFolding.cpp and 2011-12-01 03:08:23 +00:00
SSAUpdater.cpp Make headers standalone, move a virtual method out of line. 2011-11-14 17:22:45 +00:00
UnifyFunctionExitNodes.cpp [unwind removal] We no longer have 'unwind' instructions being generated, so 2012-02-06 21:16:41 +00:00
Utils.cpp Add a new convenience pass for testing InstructionSimplify. Previously 2010-12-20 20:54:37 +00:00
ValueMapper.cpp We need to map DebugLoc. It leads to Fuction * (through subprogram entry node) which should be appropriately mapped. 2011-08-04 20:02:18 +00:00