summaryrefslogtreecommitdiff
path: root/include/llvm/Support/IntegersSubsetMapping.h
Commit message (Collapse)AuthorAge
* Fix include guards so they exactly match file names.Jakub Staszak2013-01-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172025 91177308-0d34-0410-b5e6-96231b3b80d8
* BranchProb: modify the definition of an edge in BranchProbabilityInfo to handleManman Ren2012-08-24
| | | | | | | | | | | | | | | | the case of multiple edges from one block to another. A simple example is a switch statement with multiple values to the same destination. The definition of an edge is modified from a pair of blocks to a pair of PredBlock and an index into the successors. Also set the weight correctly when building SelectionDAG from LLVM IR, especially when converting a Switch. IntegersSubsetMapping is updated to calculate the weight for each cluster. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162572 91177308-0d34-0410-b5e6-96231b3b80d8
* Reverted r159658:Stepan Dyatkovskiy2012-07-04
| | | | | | | | Optimized diff operation: implemented the case when LHS and RHS subsets contains single numbers only. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159704 91177308-0d34-0410-b5e6-96231b3b80d8
* Reverted r156659, due to probable performance regressions, DenseMap should ↵Stepan Dyatkovskiy2012-07-04
| | | | | | | | | | | | be used here: IntegersSubsetMapping - Replaced type of Items field from std::list with std::map. In neares future I'll test it with DenseMap and do the correspond replacement if possible. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159703 91177308-0d34-0410-b5e6-96231b3b80d8
* IntegersSubsetMappin: cosmetic changes in diff operation.Stepan Dyatkovskiy2012-07-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159661 91177308-0d34-0410-b5e6-96231b3b80d8
* Part of r159527. Splitted into series of patches and gone with fixed PR13256:Stepan Dyatkovskiy2012-07-03
| | | | | | | | | | | | | | | | IntegersSubsetMapping Added new methods - add(self& RHS, SuccessorClass *S) - detachCase - removeCase - findSuccessor - getCases - getCaseSingleNumber - isOverlapped git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159660 91177308-0d34-0410-b5e6-96231b3b80d8
* Part of r159527. Splitted into series of patches and gone with fixed PR13256:Stepan Dyatkovskiy2012-07-03
| | | | | | | | | | IntegersSubsetMapping - Replaced type of Items field from std::list with std::map. In neares future I'll test it with DenseMap and do the correspond replacement if possible. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159659 91177308-0d34-0410-b5e6-96231b3b80d8
* Part of r159527. Splitted into series of patches and gone with fixed PR13256:Stepan Dyatkovskiy2012-07-03
| | | | | | | | Optimized diff operation: implemented the case when LHS and RHS subsets contains single numbers only. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159658 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "IntRange:" as it appears to be breaking self hosting.Eric Christopher2012-07-02
| | | | | | This reverts commit b2833d9dcba88c6f0520cad760619200adc0442c. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159618 91177308-0d34-0410-b5e6-96231b3b80d8
* IntRange:Stepan Dyatkovskiy2012-07-02
| | | | | | | | | | | | | | | | | | | | | | | | - Changed isSingleNumber method behaviour. Now this flag is calculated on demand. IntegersSubsetMapping - Optimized diff operation. - Replaced type of Items field from std::list with std::map. - Added new methods: bool isOverlapped(self &RHS) void add(self& RHS, SuccessorClass *S) void detachCase(self& NewMapping, SuccessorClass *Succ) void removeCase(SuccessorClass *Succ) SuccessorClass *findSuccessor(const IntTy& Val) const IntTy* getCaseSingleNumber(SuccessorClass *Succ) IntegersSubsetTest - DiffTest: Added checks for successors. SimplifyCFG Updated SwitchInst usage (now it is case-ragnes compatible) for - SimplifyEqualityComparisonWithOnlyPredecessor - FoldValueComparisonIntoPredecessors git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159527 91177308-0d34-0410-b5e6-96231b3b80d8
* IntegersSubsetMapping: implemented "diff" operation. Operation allows at the ↵Stepan Dyatkovskiy2012-06-26
| | | | | | | | | | | | | | | same time perform up to three operations: - LHS exclude RHS - LHS intersect RHS (LHS successors will keeped) - RHS exclude LHS The complexity is N+M, where N is size of LHS M is size of RHS. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159201 91177308-0d34-0410-b5e6-96231b3b80d8
* IntegersSubsetMapping: removed exclude operation, it will replaced with more ↵Stepan Dyatkovskiy2012-06-26
| | | | | | | | | | universal "diff" operation in next commit. Changes was separated onto two commits for better readability. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159200 91177308-0d34-0410-b5e6-96231b3b80d8
* IntegersSubsetMapping: added exclude operation, that allows to exclude ↵Stepan Dyatkovskiy2012-06-05
| | | | | | subset of integers from current mapping. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157989 91177308-0d34-0410-b5e6-96231b3b80d8
* IntegersSubsetMapping:Stepan Dyatkovskiy2012-06-05
| | | | | | | | | Changed type of Items collection: from std::vector to std::list. Also some small fixes made in IntegersSubset.h, IntegersSubsetMapping.h and IntegersSubsetTest.cpp. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157987 91177308-0d34-0410-b5e6-96231b3b80d8
* Added unittests for IntegersSubset and IntegersSubsetMapping.Stepan Dyatkovskiy2012-06-02
| | | | | | | | | | | | - Fixed IntegersSubsetGeneric copy/assignment behaviour. - Fixed IntegersSubsetGeneric::getSize/getSingleValue methods. - Fixed IntegersSubsetGeneric::verify method. Also IntegersSubset.h and IntegersSubsetMapping.h headers was fixed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157887 91177308-0d34-0410-b5e6-96231b3b80d8
* PR1255: case ranges.Stepan Dyatkovskiy2012-06-02
| | | | | | | | IntRange converted from struct to class. So main change everywhere is replacement of ".Low/High" with ".getLow/getHigh()" git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157884 91177308-0d34-0410-b5e6-96231b3b80d8
* PR1255: case ranges.Stepan Dyatkovskiy2012-06-02
| | | | | | | | IntegersSubsetGeneric, IntegersSubsetMapping: added IntTy template parameter, that allows use either APInt or IntItem. This change allows to write unittest for these classes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157880 91177308-0d34-0410-b5e6-96231b3b80d8
* PR1255: case ranges.Stepan Dyatkovskiy2012-06-01
| | | | | | | | | IntegersSubset devided into IntegersSubsetGeneric and into IntegersSubset itself. The first has no references to ConstantInt and works with IntItem only. IntegersSubsetMapping also made generic. Here added second template parameter "IntegersSubsetTy" that allows to use on of two IntegersSubset types described below. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157815 91177308-0d34-0410-b5e6-96231b3b80d8
* PR1255: case ranges.Stepan Dyatkovskiy2012-06-01
| | | | | | | | | | | | IntItem cleanup. IntItemBase, IntItemConstantIntImp and IntItem merged into IntItem. All arithmetic operators was propogated from APInt. Also added comparison operators <,>,<=,>=. Currently you will find set of macros that propogates operators from APInt to IntItem in the beginning of IntegerSubset. Note that THESE MACROS WILL REMOVED after all passes will case-ranges compatible. Also note that these macros much smaller pain that something like this: if (V->getValue().ugt(AnotherV->getValue()) { ... } These changes made IntItem full featured integer object. It allows to make IntegerSubset class generic (move out all ConstantInt references inside and add unit-tests) in next commits. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157810 91177308-0d34-0410-b5e6-96231b3b80d8
* ConstantRangesSet renamed to IntegersSubset. CRSBuilder renamed to ↵Stepan Dyatkovskiy2012-05-29
IntegersSubsetMapping. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157612 91177308-0d34-0410-b5e6-96231b3b80d8