summaryrefslogtreecommitdiff
path: root/lib/Analysis/SparsePropagation.cpp
Commit message (Collapse)AuthorAge
* Move all of the header files which are involved in modelling the LLVM IRChandler Carruth2013-01-02
| | | | | | | | | | | | | | | | | | | | | into their new header subdirectory: include/llvm/IR. This matches the directory structure of lib, and begins to correct a long standing point of file layout clutter in LLVM. There are still more header files to move here, but I wanted to handle them in separate commits to make tracking what files make sense at each layer easier. The only really questionable files here are the target intrinsic tablegen files. But that's a battle I'd rather not fight today. I've updated both CMake and Makefile build systems (I think, and my tests think, but I may have missed something). I've also re-sorted the includes throughout the project. I'll be committing updates to Clang, DragonEgg, and Polly momentarily. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171366 91177308-0d34-0410-b5e6-96231b3b80d8
* Taken into account Duncan's comments for r149481 dated by 2nd Feb 2012:Stepan Dyatkovskiy2012-03-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20120130/136146.html Implemented CaseIterator and it solves almost all described issues: we don't need to mix operand/case/successor indexing anymore. Base iterator class is implemented as a template since it may be initialized either from "const SwitchInst*" or from "SwitchInst*". ConstCaseIt is just a read-only iterator. CaseIt is read-write iterator; it allows to change case successor and case value. Usage of iterator allows totally remove resolveXXXX methods. All indexing convertions done automatically inside the iterator's getters. Main way of iterator usage looks like this: SwitchInst *SI = ... // intialize it somehow for (SwitchInst::CaseIt i = SI->caseBegin(), e = SI->caseEnd(); i != e; ++i) { BasicBlock *BB = i.getCaseSuccessor(); ConstantInt *V = i.getCaseValue(); // Do something. } If you want to convert case number to TerminatorInst successor index, just use getSuccessorIndex iterator's method. If you want initialize iterator from TerminatorInst successor index, use CaseIt::fromSuccessorIndex(...) method. There are also related changes in llvm-clients: klee and clang. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152297 91177308-0d34-0410-b5e6-96231b3b80d8
* SwitchInst refactoring.Stepan Dyatkovskiy2012-02-01
| | | | | | | | | | | | | | | | | | | | The purpose of refactoring is to hide operand roles from SwitchInst user (programmer). If you want to play with operands directly, probably you will need lower level methods than SwitchInst ones (TerminatorInst or may be User). After this patch we can reorganize SwitchInst operands and successors as we want. What was done: 1. Changed semantics of index inside the getCaseValue method: getCaseValue(0) means "get first case", not a condition. Use getCondition() if you want to resolve the condition. I propose don't mix SwitchInst case indexing with low level indexing (TI successors indexing, User's operands indexing), since it may be dangerous. 2. By the same reason findCaseValue(ConstantInt*) returns actual number of case value. 0 means first case, not default. If there is no case with given value, ErrorIndex will returned. 3. Added getCaseSuccessor method. I propose to avoid usage of TerminatorInst::getSuccessor if you want to resolve case successor BB. Use getCaseSuccessor instead, since internal SwitchInst organization of operands/successors is hidden and may be changed in any moment. 4. Added resolveSuccessorIndex and resolveCaseIndex. The main purpose of these methods is to see how case successors are really mapped in TerminatorInst. 4.1 "resolveSuccessorIndex" was created if you need to level down from SwitchInst to TerminatorInst. It returns TerminatorInst's successor index for given case successor. 4.2 "resolveCaseIndex" converts low level successors index to case index that curresponds to the given successor. Note: There are also related compatability fix patches for dragonegg, klee, llvm-gcc-4.0, llvm-gcc-4.2, safecode, clang. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149481 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove all remaining uses of Value::getNameStr().Benjamin Kramer2011-11-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144648 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert debug messages to use dbgs(). Generally this meansDavid Greene2009-12-23
| | | | | | | s/errs/dbgs/g except for certain special cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92068 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate unnecessary LLVMContexts.Dan Gohman2009-12-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91729 91177308-0d34-0410-b5e6-96231b3b80d8
* rename indbr -> indirectbr to appease the residents of #llvm.Chris Lattner2009-10-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85351 91177308-0d34-0410-b5e6-96231b3b80d8
* make the build build.Chris Lattner2009-10-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85319 91177308-0d34-0410-b5e6-96231b3b80d8
* Random updates to passes for indbr, I need blockaddress before I can do much ↵Chris Lattner2009-10-27
| | | | | | more. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85316 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a comment explaining why you would ever want to do this.Nick Lewycky2009-09-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82319 91177308-0d34-0410-b5e6-96231b3b80d8
* Lett users of sparse propagation do their own thing with phi nodes if they wantNick Lewycky2009-09-19
| | | | | | | | to. This can be combined with LCSSA or SSI form to store more information on a PHINode than can be computed by looking at its incoming values. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82317 91177308-0d34-0410-b5e6-96231b3b80d8
* Add newlines.Nick Lewycky2009-09-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82206 91177308-0d34-0410-b5e6-96231b3b80d8
* eliminate the "Value" printing methods that print to a std::ostream.Chris Lattner2009-08-23
| | | | | | | This required converting a bunch of stuff off DOUT and other cleanups. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79819 91177308-0d34-0410-b5e6-96231b3b80d8
* Move getTrue() and getFalse() to 2.5-like APIs.Owen Anderson2009-07-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77685 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove Value::getName{Start,End}, the last of the old Name APIs.Daniel Dunbar2009-07-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77152 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename getConstantInt{True|False} to get{True|False} at Chris' behest.Owen Anderson2009-07-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76598 91177308-0d34-0410-b5e6-96231b3b80d8
* Finish LLVMContext-ing lib/Analysis. This required pushing LLVMContext's ↵Owen Anderson2009-07-06
| | | | | | through the ValueTracking API. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74873 91177308-0d34-0410-b5e6-96231b3b80d8
* Make Print callable from a pass's print method: add const qualifier. NoTorok Edwin2009-03-11
| | | | | | | functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66700 91177308-0d34-0410-b5e6-96231b3b80d8
* "This patch adds a virtual call to AbstractLatticeFunction to derive a Chris Lattner2008-08-09
| | | | | | | | | | | type lattice value for an Argument*, giving clients the opportunity to use something other than Top for it if they choose to." Patch by John McCall! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54589 91177308-0d34-0410-b5e6-96231b3b80d8
* Use Function::getEntryBlock instead of Function::begin, for clarity.Dan Gohman2008-05-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51613 91177308-0d34-0410-b5e6-96231b3b80d8
* Print debug output when any edge becomes executable, includingDan Gohman2008-05-27
| | | | | | | the first visited edge. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51612 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a bool to isEdgeFeasible that tells it whether to treat unknownChris Lattner2008-05-20
| | | | | | | value as undef or untracked. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51295 91177308-0d34-0410-b5e6-96231b3b80d8
* prune #includes.Chris Lattner2008-05-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50962 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a new SparsePropagation analysis utility, which allows you to doChris Lattner2008-05-12
SCCP like sparse lattice analysis with relative ease. Just pick your lattice function and implement the transfer function and you're good. Just make sure you don't break monotonicity ;-) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50961 91177308-0d34-0410-b5e6-96231b3b80d8