llvm-6502/lib
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
..
Analysis Mark some static arrays as const. 2012-05-24 06:35:32 +00:00
Archive
AsmParser switch AttrListPtr::get to take an ArrayRef, simplifying a lot of clients. 2012-05-28 01:47:44 +00:00
Bitcode PR1255: Case Ranges 2012-05-28 12:39:09 +00:00
CodeGen PR1255: Case Ranges 2012-05-28 12:39:09 +00:00
DebugInfo
ExecutionEngine PR1255: Case Ranges 2012-05-28 12:39:09 +00:00
Linker Supply a C interface to the "LinkModules" method. 2012-05-09 08:55:40 +00:00
MC Compress MCRegisterInfo register name tables. 2012-05-25 00:21:41 +00:00
Object Mark some static arrays as const. 2012-05-24 06:35:32 +00:00
Support Path::GetTemporaryDirectory(): Add an assertion if TempDirectory is alive, to check when someone would remove the tempdir. 2012-05-27 13:02:04 +00:00
TableGen Add support for range expressions in TableGen foreach loops. 2012-05-24 22:17:39 +00:00
Target Fix predicate HasStandardEncoding in MipsInstrInfo.td per suggestion of 2012-05-25 22:15:15 +00:00
Transforms PR1255: Case Ranges 2012-05-28 12:39:09 +00:00
VMCore PR1255: Case Ranges 2012-05-28 12:39:09 +00:00
CMakeLists.txt
LLVMBuild.txt
Makefile