llvm-6502/include/llvm
Stepan Dyatkovskiy 6ce1c88a4f Related to PR1255. Let's begin. I'll commit classes that corresponds to our latest PR1255 discussion posts in llvm-commits.
Strategy.
0. Implement new classes. Classes doesn't affect anything. They still work with ConstantInt base values at this stage.
1. Fictitious replacement of current ConstantInt case values with ConstantRangesSet. Case ranges set will still hold single value, and ConstantInt *getCaseValue() will return it. But additionally implement new method in SwitchInst that allows to work with case ranges. Currenly I think it should be some wrapper that returns either single value or ConstantRangesSet object.
2. Step-by-step replacement of old "ConstantInt* getCaseValue()" with new alternative. Modify algorithms for all passes that works with SwitchInst. But don't modify LLParser and BitcodeReader/Writer. Still hold single value in each ConstantRangesSet object. On this stage some parts of LLVM will use old-style methods, and some ones new-style.
3. After all getCaseValue() usages will removed and whole LLVM and its clients will work in new style - modify LLParser, Reader and Writer. Remove getCaseValue().
4. Replace ConstantInt*-based case ranges set items with APInt ones.

Currently we are on Zero Stage: New classes.
ConstantRangesSet.
I selected ConstantArrays as case ranges set "holder" object (it is a temporary decision, I'll explain why below). The array items are may be ConstantVectors with single item, and ConstantVectors with two items (that means single number and range respectively).
The ConstantInt will used as basic value representation. It will replaced with APInt then. Of course ConstantArray and ConstantVector will go away after ConstantInt => APInt replacement.

New class mandatory features:
- bool isSatisfies(ConstantInt *V) method (need better name?). Returns true if the given value satisfies this case.
- Case's ranges and values enumeration. In some passes we need to analize each case (SwitchLowering for example).

Factory + unified clusterify.
I also propose to implement the factory that allows to build case object with user friendly way. I called it CRSBuilder by now.
Currenly I implemented the factory that allows add,remove pairs of range+successor. It also allows add existing ConstantRangesSet decompiling it to separated ranges. Factory can emit either clusters set (single case range + successor) or the set of "ConstantRangesSet + Successor" pairs.
So you can use it either as builder for new cases set for SwitchInst, or for clusterification of existing cases set.
Just call Factory.optimize() and it emits optimized and sorted clusters collection for you!
I tested clusterification on SelectionDAGBuilder - it works fine. Don't worry it was not included in this patch. Just new classes.
Factory is a template. There are two params: SuccessorClass and IsReadonly. So you can specify what successor you need (BB or MBB). And you can also restrict your factory to use values in read-only mode (SelectionDAGBuilder need IsReadonly=true). Read-only factory couldn't build the cases ranges.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155464 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-24 18:31:10 +00:00
..
ADT stop hiding SmallVector's append that takes a count + element. 2012-04-21 21:02:03 +00:00
Analysis Allow forward declarations to take a context. This helps the debugger 2012-04-23 19:00:11 +00:00
Assembly Prune some includes and forward declarations. 2012-03-26 06:58:25 +00:00
Bitcode Fix windows compilation warning. Patch by Micah. 2012-03-21 20:00:30 +00:00
CodeGen misched: DAG builder support for tracking register pressure within the current scheduling region. 2012-04-24 17:56:43 +00:00
Config add configure flag --with-default-sysroot 2012-04-16 04:11:45 +00:00
DebugInfo DebugInfo: Add equality operators and default constructor to DILineInfo. 2011-09-21 01:13:16 +00:00
ExecutionEngine Re-factored RuntimeDyLd: 2012-03-30 16:45:19 +00:00
MC Make member variables of AsmToken private. Remove unnecessary forward declarations. Remove an unnecessary include. 2012-04-15 22:00:22 +00:00
Object Implement GDB integration for source level debugging of code JITed using 2012-04-16 22:12:58 +00:00
Support Conflict with st_dev/st_ino identifiers under Debian GNU/Hurd 2012-04-23 16:37:23 +00:00
TableGen Tidy up. Trailing whitespace. 2012-04-18 17:46:37 +00:00
Target This patch fixes a problem which arose when using the Post-RA scheduler 2012-04-23 21:39:35 +00:00
Transforms Enhance BBVectorize to more-properly handle pointer values and vectorize GEPs. 2012-04-14 07:32:43 +00:00
Argument.h Unweaken vtables as per http://llvm.org/docs/CodingStandards.html#ll_virtual_anch 2011-12-20 02:50:00 +00:00
Attributes.h Don't use static CTORs for the Attributes constants, while still keeping the class type-safe 2012-02-08 01:11:21 +00:00
AutoUpgrade.h remove autoupgrade support for really old-style debug info intrinsics. 2011-11-27 06:18:33 +00:00
BasicBlock.h Add a constified getLandingPad() method. 2012-01-31 00:26:24 +00:00
CallGraphSCCPass.h
CallingConv.h
CMakeLists.txt build/cmake: Use tblgen macro directly instead of llvm_tablegen, which just 2011-11-04 19:04:23 +00:00
Constant.h Convert assert(0) to llvm_unreachable 2012-02-05 22:14:15 +00:00
ConstantRangesSet.h Related to PR1255. Let's begin. I'll commit classes that corresponds to our latest PR1255 discussion posts in llvm-commits. 2012-04-24 18:31:10 +00:00
Constants.h Efficient Constant Uniquing. 2012-02-05 20:54:10 +00:00
CRSBuilder.h Related to PR1255. Let's begin. I'll commit classes that corresponds to our latest PR1255 discussion posts in llvm-commits. 2012-04-24 18:31:10 +00:00
DefaultPasses.h Add a couple missing includes; found while analyzing LLVM headers. 2011-11-04 18:19:43 +00:00
DerivedTypes.h Cache the sized-ness of struct types, once we reach the steady state of 2012-03-07 02:33:09 +00:00
Function.h [Support] Drop verbose _ATTRIBUTE from LLVM_ATTRIBUTE_{READONLY,READNONE} macro 2012-03-09 16:30:33 +00:00
GlobalAlias.h Remove DEFINE_TRANSPARENT_CASTED_OPERAND_ACCESSORS, folding its 2011-08-22 09:37:03 +00:00
GlobalValue.h Re-fix the issue Bill fixed in r147899 in a slightly different way, which doesn't abuse the semantics of linker_private. We don't really want to merge any string constant with a weak_odr global. 2012-01-11 22:06:46 +00:00
GlobalVariable.h land David Blaikie's patch to de-constify Type, with a few tweaks. 2011-07-18 04:54:35 +00:00
GVMaterializer.h
InitializePasses.h ThreadSanitizer, a race detector. First LLVM commit. 2012-02-13 22:50:51 +00:00
InlineAsm.h Prune some includes and forward declarations. 2012-03-26 06:58:25 +00:00
InstrTypes.h Add some missing anchors. 2011-12-01 08:00:17 +00:00
Instruction.def [unwind removal] Remove all of the code for the dead 'unwind' instruction. There 2012-02-06 21:44:22 +00:00
Instruction.h Move Instruction::isSafeToSpeculativelyExecute out of VMCore and 2011-12-14 23:49:11 +00:00
Instructions.h Fix accidentally constant conditions found by uncommitted improvements to -Wconstant-conversion. 2012-04-09 16:29:35 +00:00
IntrinsicInst.h Remove the eh.exception and eh.selector intrinsics. Also remove a hack to copy 2012-01-31 01:46:13 +00:00
Intrinsics.h land David Blaikie's patch to de-constify Type, with a few tweaks. 2011-07-18 04:54:35 +00:00
Intrinsics.td Remove the now-dead llvm.eh.exception and llvm.eh.selector intrinsics. 2012-01-31 01:58:48 +00:00
IntrinsicsARM.td Add support for ARM ldrexd/strexd intrinsics. They both use i32 register pairs 2011-05-28 04:07:29 +00:00
IntrinsicsCellSPU.td
IntrinsicsHexagon.td Revert r155365, r155366, and r155367. All three of these have regression 2012-04-23 18:25:57 +00:00
IntrinsicsPowerPC.td
IntrinsicsPTX.td
IntrinsicsX86.td Remove AVX vpermil intrinsics. I removed their uses from clang headers and builtins a while back. 2012-04-18 05:24:00 +00:00
IntrinsicsXCore.td Update IntrinsicsXCore.td with the normal LLVM notice at the top of the file. 2011-10-13 21:08:11 +00:00
LinkAllPasses.h Add a basic-block autovectorization pass. 2012-02-01 03:51:43 +00:00
LinkAllVMCore.h
Linker.h Prune some includes and forward declarations. 2012-03-26 06:58:25 +00:00
LLVMContext.h Rename "fpaccuracy" metadata to the more generic "fpmath". That's because I'm 2012-04-14 12:36:06 +00:00
Metadata.h Fix pasto. 2012-04-11 20:20:37 +00:00
Module.h Add a flag to the struct type finder to collect only those types which have 2012-04-21 23:59:16 +00:00
OperandTraits.h Remove DEFINE_TRANSPARENT_CASTED_OPERAND_ACCESSORS, folding its 2011-08-22 09:37:03 +00:00
Operator.h Remove support for the special 'fast' value for fpmath accuracy for the moment. 2012-04-16 19:39:33 +00:00
Pass.h Added TargetPassConfig::disablePass/substitutePass as a general mechanism to override specific passes. 2012-02-15 03:21:47 +00:00
PassAnalysisSupport.h Add a couple missing includes; found while analyzing LLVM headers. 2011-11-04 18:19:43 +00:00
PassManager.h Add pass printer passes in the right place. 2012-02-01 07:16:20 +00:00
PassManagers.h Add pass printer passes in the right place. 2012-02-01 07:16:20 +00:00
PassRegistry.h
PassSupport.h Add Tsan annotations to the pass system. 2011-12-08 00:15:41 +00:00
SymbolTableListTraits.h
Type.h add StructType helpers too. 2012-01-26 00:06:44 +00:00
Use.h Reinstate r133513 (reverted in r133700) with an additional fix for a 2011-06-23 09:09:15 +00:00
User.h Convert assert(0) to llvm_unreachable 2012-02-05 22:14:15 +00:00
Value.h The MDString class stored a StringRef to the string which was already in a 2012-04-10 20:12:16 +00:00
ValueSymbolTable.h