summaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/EarlyCSE.cpp
Commit message (Collapse)AuthorAge
* Rename many DataLayout variables from TD to DL.Rafael Espindola2014-02-21
| | | | | | | | | I am really sorry for the noise, but the current state where some parts of the code use TD (from the old name: TargetData) and other parts use DL makes it hard to write a patch that changes where those variables come from and how they are passed along. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201827 91177308-0d34-0410-b5e6-96231b3b80d8
* Disable most IR-level transform passes on functions marked 'optnone'.Paul Robinson2014-02-06
| | | | | | | | | | Ideally only those transform passes that run at -O0 remain enabled, in reality we get as close as we reasonably can. Passes are responsible for disabling themselves, it's not the job of the pass manager to do it for them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200892 91177308-0d34-0410-b5e6-96231b3b80d8
* [PM] Split DominatorTree into a concrete analysis result object whichChandler Carruth2014-01-13
| | | | | | | | | | | | | | | | | | | | | | | can be used by both the new pass manager and the old. This removes it from any of the virtual mess of the pass interfaces and lets it derive cleanly from the DominatorTreeBase<> template. In turn, tons of boilerplate interface can be nuked and it turns into a very straightforward extension of the base DominatorTree interface. The old analysis pass is now a simple wrapper. The names and style of this split should match the split between CallGraph and CallGraphWrapperPass. All of the users of DominatorTree have been updated to match using many of the same tricks as with CallGraph. The goal is that the common type remains the resulting DominatorTree rather than the pass. This will make subsequent work toward the new pass manager significantly easier. Also in numerous places things became cleaner because I switched from re-running the pass (!!! mid way through some other passes run!!!) to directly recomputing the domtree. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199104 91177308-0d34-0410-b5e6-96231b3b80d8
* [cleanup] Move the Dominators.h and Verifier.h headers into the IRChandler Carruth2014-01-13
| | | | | | | | | | | | | | | | | | directory. These passes are already defined in the IR library, and it doesn't make any sense to have the headers in Analysis. Long term, I think there is going to be a much better way to divide these matters. The dominators code should be fully separated into the abstract graph algorithm and have that put in Support where it becomes obvious that evn Clang's CFGBlock's can use it. Then the verifier can manually construct dominance information from the Support-driven interface while the Analysis library can provide a pass which both caches, reconstructs, and supports a nice update API. But those are very long term, and so I don't want to leave the really confusing structure until that day arrives. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199082 91177308-0d34-0410-b5e6-96231b3b80d8
* Change std::deque => std::vector. No functionality change.Michael Gottesman2013-12-05
| | | | | | | | There is no reason to use std::deque here over std::vector. Thus given the performance differences inbetween the two it makes sense to change deque to vector. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196524 91177308-0d34-0410-b5e6-96231b3b80d8
* Get rid of unused isPodLike definitions.Eli Friedman2013-09-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190461 91177308-0d34-0410-b5e6-96231b3b80d8
* 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
* Use the new script to sort the includes of every file under lib.Chandler Carruth2012-12-03
| | | | | | | | | | | | | | | | | Sooooo many of these had incorrect or strange main module includes. I have manually inspected all of these, and fixed the main module include to be the nearest plausible thing I could find. If you own or care about any of these source files, I encourage you to take some time and check that these edits were sensible. I can't have broken anything (I strictly added headers, and reordered them, never removed), but they may not be the headers you'd really like to identify as containing the API being implemented. Many forward declarations and missing includes were added to a header files to allow them to parse cleanly when included first. The main module rule does in fact have its merits. =] git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169131 91177308-0d34-0410-b5e6-96231b3b80d8
* Update EarlyCSE's SimpleValues to use Hashing.h for their hashes. Expanded ↵Michael Ilseman2012-10-09
| | | | | | the hashing and equality to allow for equality modulo commutativity for binary ops, and comparisons with swapping of predicates. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165509 91177308-0d34-0410-b5e6-96231b3b80d8
* Move TargetData to DataLayout.Micah Villmow2012-10-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165402 91177308-0d34-0410-b5e6-96231b3b80d8
* Use LLVM_DELETED_FUNCTION in place of 'DO NOT IMPLEMENT' comments.Craig Topper2012-09-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163974 91177308-0d34-0410-b5e6-96231b3b80d8
* Make MemoryBuiltins aware of TargetLibraryInfo.Benjamin Kramer2012-08-29
| | | | | | | | | | | | | | | | This disables malloc-specific optimization when -fno-builtin (or -ffreestanding) is specified. This has been a problem for a long time but became more severe with the recent memory builtin improvements. Since the memory builtin functions are used everywhere, this required passing TLI in many places. This means that functions that now have an optional TLI argument, like RecursivelyDeleteTriviallyDeadFunctions, won't remove dead mallocs anymore if the TLI argument is missing. I've updated most passes to do the right thing. Fixes PR13694 and probably others. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162841 91177308-0d34-0410-b5e6-96231b3b80d8
* Clean whitespaces.Nadav Rotem2012-07-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160668 91177308-0d34-0410-b5e6-96231b3b80d8
* bz11794 : EarlyCSE stack overflow on long functions.Lenny Maiorani2012-01-31
| | | | | | | | Make the EarlyCSE optimizer not use recursion to do a depth first iteration. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149445 91177308-0d34-0410-b5e6-96231b3b80d8
* Propagate TargetLibraryInfo throughout ConstantFolding.cpp and Chad Rosier2011-12-01
| | | | | | | InstructionSimplify.cpp. Other fixups as needed. Part of rdar://10500969 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145559 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a couple hash functions so that they do not depend on undefined shifts. ↵Eli Friedman2011-10-12
| | | | | | Based on patch by Ahmed Charles. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141820 91177308-0d34-0410-b5e6-96231b3b80d8
* Change a bunch of isVolatile() checks to check for atomic load/store as well.Eli Friedman2011-09-12
| | | | | | | | | | No tests; these changes aren't really interesting in the sense that the logic is the same for volatile and atomic. I believe this completes all of the changes necessary for the optimizer to handle loads and stores correctly. I'm going to try and come up with some additional testing, though. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139533 91177308-0d34-0410-b5e6-96231b3b80d8
* Duncan deftly points out that readnone functions aren'tChris Lattner2011-01-03
| | | | | | | | invalidated by stores, so they can be handled as 'simple' operations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122785 91177308-0d34-0410-b5e6-96231b3b80d8
* stength reduce my previous patch a bit. The only instructionsChris Lattner2011-01-03
| | | | | | | | | | | | that are allowed to have metadata operands are intrinsic calls, and the only ones that take metadata currently return void. Just reject all void instructions, which should not be value numbered anyway. To future proof things, add an assert to the getHashValue impl for calls to check that metadata operands aren't present. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122759 91177308-0d34-0410-b5e6-96231b3b80d8
* fix PR8895: metadata operands don't have a strong use of theirChris Lattner2011-01-03
| | | | | | | | | | | | nested values, so they can change and drop to null, which can change the hash and cause havok. It turns out that it isn't a good idea to value number stuff with metadata operands anyway, so... don't. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122758 91177308-0d34-0410-b5e6-96231b3b80d8
* earlycse can do trivial with-a-block dead store Chris Lattner2011-01-03
| | | | | | | | elimination as well. This deletes 60 stores in 176.gcc that largely come from bitfield code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122736 91177308-0d34-0410-b5e6-96231b3b80d8
* switch the load table to use a recycling bump pointer allocator,Chris Lattner2011-01-03
| | | | | | | speeding earlycse up by 6%. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122733 91177308-0d34-0410-b5e6-96231b3b80d8
* now that loads are in their own table, we can implementChris Lattner2011-01-03
| | | | | | | | store->load forwarding. This allows EarlyCSE to zap 600 more loads from 176.gcc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122732 91177308-0d34-0410-b5e6-96231b3b80d8
* split loads and calls into separate tables. Loads are now just indexedChris Lattner2011-01-03
| | | | | | | by their pointer instead of using MemoryValue to wrap it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122731 91177308-0d34-0410-b5e6-96231b3b80d8
* various cleanups, no functionality change.Chris Lattner2011-01-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122729 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach EarlyCSE to do trivial CSE of loads and read-only calls.Chris Lattner2011-01-03
| | | | | | | | | On 176.gcc, this catches 13090 loads and calls, and increases the number of simple instructions CSE'd from 29658 to 36208. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122727 91177308-0d34-0410-b5e6-96231b3b80d8
* rename InstValue to SimpleValue, add some comments.Chris Lattner2011-01-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122725 91177308-0d34-0410-b5e6-96231b3b80d8
* Allocate nodes for the scoped hash table from a recyling bump pointerChris Lattner2011-01-03
| | | | | | | allocator. This speeds up early cse by about 20% git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122723 91177308-0d34-0410-b5e6-96231b3b80d8
* reduce redundancy in the hashing code and other misc cleanups.Chris Lattner2011-01-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122720 91177308-0d34-0410-b5e6-96231b3b80d8
* fix some pastosChris Lattner2011-01-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122718 91177308-0d34-0410-b5e6-96231b3b80d8
* add DEBUG and -stats output to earlycse.Chris Lattner2011-01-02
| | | | | | | | Teach it to CSE the rest of the non-side-effecting instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122716 91177308-0d34-0410-b5e6-96231b3b80d8
* Enhance earlycse to do CSE of casts, instsimplify and die.Chris Lattner2011-01-02
| | | | | | | | Add a testcase. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122715 91177308-0d34-0410-b5e6-96231b3b80d8
* sketch out a new early cse pass. No functionality yet.Chris Lattner2011-01-02
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122713 91177308-0d34-0410-b5e6-96231b3b80d8