summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/GVN.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* We don't want to find dependencies within the same block in this case. It ↵Owen Anderson2008-06-171-1/+1
| | | | | | | | leads to incorrect results because we're detecting something at or after the call we're querying on. llvm-svn: 52433
* Switch GVN to use ScopedHashTable.Owen Anderson2008-06-121-134/+64
| | | | llvm-svn: 52242
* Update comments and documentation to reflect that GCSE and ValueNumbering areMatthijs Kooijman2008-06-051-0/+3
| | | | | | deprecated by the GVN and GVNPRE passes. llvm-svn: 51983
* Remove unneeded #include.Owen Anderson2008-06-041-1/+0
| | | | llvm-svn: 51955
* Teach GVN to not assert on vector comparisonsNate Begeman2008-05-181-2/+2
| | | | llvm-svn: 51230
* Fix Analysis/BasicAA/pure-const-dce.ll. This turned out to be a correctnessOwen Anderson2008-05-131-1/+38
| | | | | | | | bug as well as a missed optimization. We weren't properly checking for local dependencies before moving on to non-local ones when doing non-local read-only call CSE. llvm-svn: 51082
* Make the non-local CSE safety checks slightly more thorough.Owen Anderson2008-05-131-6/+8
| | | | llvm-svn: 51035
* Add support for non-local CSE of read-only calls.Owen Anderson2008-05-131-12/+45
| | | | llvm-svn: 51024
* Go back to passing the analyses around as parameters.Owen Anderson2008-05-121-21/+33
| | | | llvm-svn: 50995
* Move the various analyses used by GVN into static variables so we don't have ↵Owen Anderson2008-05-121-30/+21
| | | | | | to keep passing them around or refetching them. llvm-svn: 50963
* Remove unneeded #include's.Owen Anderson2008-04-211-7/+0
| | | | llvm-svn: 50035
* Make GVN able to remove unnecessary calls to read-only functions again.Owen Anderson2008-04-171-16/+30
| | | | llvm-svn: 49842
* Fix PR2213 by simultaneously making GVN more aggressive with the return valuesOwen Anderson2008-04-111-29/+20
| | | | | | of calls and less aggressive with non-readnone calls. llvm-svn: 49516
* Factor a bunch of functionality related to memcpy and memset transforms out of Owen Anderson2008-04-091-620/+0
| | | | | | GVN and into its own pass. llvm-svn: 49419
* Remove accidentally duplicated code.Owen Anderson2008-04-091-4/+0
| | | | llvm-svn: 49418
* Add operator= implementations to SparseBitVector, allowing it to be used in ↵Owen Anderson2008-04-071-16/+8
| | | | | | | | | GVN. This results in both time and memory savings for GVN. For example, one testcase went from 10.5s to 6s with this patch. llvm-svn: 49345
* Make GVN more memory efficient, particularly on code that contains a large ↵Owen Anderson2008-04-071-1/+15
| | | | | | | | number of allocations, which GVN can't optimize anyways. llvm-svn: 49329
* API changes for class Use size reduction, wave 1.Gabor Greif2008-04-061-4/+4
| | | | | | | | Specifically, introduction of XXX::Create methods for Users that have a potentially variable number of Uses. llvm-svn: 49277
* change iterator invalidation avoidance to just move the iterator backwardChris Lattner2008-03-291-18/+25
| | | | | | | | | | | | | | | | | | | | | when something changes, instead of moving forward. This allows us to simplify memset lowering, inserting the memset at the end of the range of stuff we're touching instead of at the start. This, in turn, allows us to make use of the addressing instructions already used in the function instead of inserting our own. For example, we now codegen: %tmp41 = getelementptr [8 x i8]* %ref_idx, i32 0, i32 0 ; <i8*> [#uses=2] call void @llvm.memset.i64( i8* %tmp41, i8 -1, i64 8, i32 1 ) instead of: %tmp20 = getelementptr [8 x i8]* %ref_idx, i32 0, i32 7 ; <i8*> [#uses=1] %ptroffset = getelementptr i8* %tmp20, i64 -7 ; <i8*> [#uses=1] call void @llvm.memset.i64( i8* %ptroffset, i8 -1, i64 8, i32 1 ) llvm-svn: 48940
* make the common case of a single store (which clearly shouldn't be turnedChris Lattner2008-03-291-3/+12
| | | | | | into a memset!) faster by avoiding an allocation of an std::list node. llvm-svn: 48939
* give form-memset a significantly more sane heuristic, enable it by default.Chris Lattner2008-03-291-7/+49
| | | | llvm-svn: 48937
* make memset inference significantly more powerful: it can now handle Chris Lattner2008-03-281-82/+184
| | | | | | | | | | memsets that initialize "structs of arrays" and other store sequences that are not sequential. This is still only enabled if you pass -form-memset-from-stores. The flag is not heavily tested and I haven't analyzed the perf regressions when -form-memset-from-stores is passed either, but this causes no make check regressions. llvm-svn: 48909
* Temporarily disabling memset forming optimization. Add an option.Evan Cheng2008-03-241-0/+8
| | | | llvm-svn: 48720
* implement an initial hack at a straight-line store -> memset optimization.Chris Lattner2008-03-221-6/+59
| | | | | | | | This fires dozens of times across spec and multisource, but I don't know if it actually speeds stuff up. Hopefully the testers will show something nice :) llvm-svn: 48680
* implement the logic for memset insertion and store deletion.Chris Lattner2008-03-221-11/+49
| | | | llvm-svn: 48679
* This is a partially implemented and currently disabled start of a storeChris Lattner2008-03-221-0/+159
| | | | | | merging optimization. Nothing to see here, hopefully more later :) llvm-svn: 48670
* the size of a smallvector shouldn't be part of the interface to these methods.Chris Lattner2008-03-211-20/+18
| | | | llvm-svn: 48662
* make gvn marginally faster by reallocating the lastSeenLoad map forChris Lattner2008-03-211-3/+4
| | | | | | each basic block. llvm-svn: 48660
* Minor cleanups and shrinkification.Chris Lattner2008-03-211-186/+114
| | | | llvm-svn: 48658
* Fix a bug in GVN that Duncan noticed, where we potentially need to insert a Owen Anderson2008-03-131-1/+5
| | | | | | pointer bitcast when performing return slot optimization. llvm-svn: 48343
* Improve the return slot optimization to be both more aggressive (not limited ↵Owen Anderson2008-03-121-93/+109
| | | | | | | | | to sret parameters), and safer (when the passed pointer might be invalid). Thanks to Duncan and Chris for the idea behind this, and extra thanks to Duncan for helping me work out the trap-safety. llvm-svn: 48280
* Fix an issue where GVN had the sizes of the two memcpy's reverse, resultingOwen Anderson2008-02-261-2/+2
| | | | | | in an invalid transformation. llvm-svn: 47639
* Fix an issue where GVN was performing the return slot optimization when it wasOwen Anderson2008-02-251-8/+26
| | | | | | | not safe. This is fixed by more aggressively checking that the return slot is not used elsewhere in the function. llvm-svn: 47544
* Fix an issue where GVN would try to use an instruction before its definition ↵Owen Anderson2008-02-251-0/+7
| | | | | | when performing return slot optimization. llvm-svn: 47541
* Make Transforms to be 4.3 warnings-cleanAnton Korobeynikov2008-02-201-6/+6
| | | | llvm-svn: 47371
* When performing return slot optimization, remember to inform memdep when ↵Owen Anderson2008-02-201-0/+1
| | | | | | we're removing the memcpy. llvm-svn: 47364
* Refactor this method a bit, and correct a test that was completely wrong but ↵Owen Anderson2008-02-191-7/+11
| | | | | | happened to work out anyways. :-) llvm-svn: 47321
* isa+cast -> dyncast.Chris Lattner2008-02-191-2/+2
| | | | llvm-svn: 47320
* simplify this code again, try 2 :)Chris Lattner2008-02-191-7/+5
| | | | llvm-svn: 47319
* Fix a comment.Owen Anderson2008-02-191-1/+1
| | | | llvm-svn: 47318
* Major improvements to yesterday's return slot optimization. Remove some ↵Owen Anderson2008-02-191-14/+39
| | | | | | | | unneccessary constraints, and add some others that should have been in from the first place. Document the whole thing better. llvm-svn: 47315
* Factor the profitability check for return slot optimization out into a ↵Owen Anderson2008-02-191-14/+26
| | | | | | | | static function. At some point in the future, this check will become smarter. llvm-svn: 47310
* An sret parameter is required to be the first parameter, so there's no need ↵Owen Anderson2008-02-191-8/+3
| | | | | | | | to loop over all the parameters of the callee looking for it. llvm-svn: 47309
* Cleanup some of my patches from yesterday. Refactor the check for which xformOwen Anderson2008-02-191-22/+23
| | | | | | | to apply to a memcpy into processInstruction. Also, fix a bug in the check due to missing braces. llvm-svn: 47307
* Fix Transforms/GVN/memcpy.ll, which Chris broke in r47275 by reordering the ↵Owen Anderson2008-02-191-1/+2
| | | | | | branches. memcpy's are a kind of CallInst. llvm-svn: 47305
* minor code simplification, no functionality change.Chris Lattner2008-02-181-8/+6
| | | | llvm-svn: 47275
* Add support to GVN for performing sret return slot optimization. This means ↵Owen Anderson2008-02-181-2/+66
| | | | | | | | | | | that, if an sret function tail calls another sret function, it should pass its own sret parameter to the tail callee, allowing it to fill in the correct return value. llvm-gcc does not emit this by default. Instead, it allocates space in the caller for the sret of the tail call and then uses memcpy to copy the result into the caller's sret parameter. This optimization detects and optimizes that case. llvm-svn: 47265
* Fix PR2032. Inform the alias analysis of changes to the underlying program.Nick Lewycky2008-02-141-0/+2
| | | | llvm-svn: 47111
* Re-apply the patch to improve the optimizations of memcpy's, with severalOwen Anderson2008-02-121-1/+79
| | | | | | bugs fixed. This now passes PPC bootstrap. llvm-svn: 47026
* Fix for bug 1996: optimize out loads of undef. This code basically just Eli Friedman2008-02-121-1/+28
| | | | | | checks for a malloc/alloca immediately followed by a load. llvm-svn: 47006
OpenPOWER on IntegriCloud