summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* VisualStudio project files updated. #include <algorithm> added to make ↵Chuck Rose III2008-04-151-0/+15
| | | | | | VisualStudio happy. Also had to undefine setjmp because of #include <csetjmp> turning setjmp into _setjmp in VisualStudio. llvm-svn: 49743
* Remove unnecessary <sstream> includes.Dan Gohman2008-04-141-1/+0
| | | | llvm-svn: 49681
* Minor whitespace and comment cleanups.Dan Gohman2008-04-141-3/+3
| | | | llvm-svn: 49671
* Revert r49614. As Dan pointed out, some of these aren't correct.Owen Anderson2008-04-144-5/+5
| | | | llvm-svn: 49657
* Replace calls of the form V1->setName(V2->getName()) with V1->takeName(V2), Owen Anderson2008-04-134-5/+5
| | | | | | which is significantly more efficient. llvm-svn: 49614
* 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
* Teach InstCombine's ComputeMaskedBits to handle pointer expressionsDan Gohman2008-04-101-140/+299
| | | | | | | | | | | | | | | in addition to integer expressions. Rewrite GetOrEnforceKnownAlignment as a ComputeMaskedBits problem, moving all of its special alignment knowledge to ComputeMaskedBits as low-zero-bits knowledge. Also, teach ComputeMaskedBits a few basic things about Mul and PHI instructions. This improves ComputeMaskedBits-based simplifications in a few cases, but more noticeably it significantly improves instcombine's alignment detection for loads, stores, and memory intrinsics. llvm-svn: 49492
* Disable an xform we've had for a long time, pow(x,0.5) -> sqrt.Chris Lattner2008-04-101-0/+8
| | | | | | This is not safe for all inputs. llvm-svn: 49458
* Generalize getUnaryFloatFunction to handle any FP unary function, automaticallyChris Lattner2008-04-091-17/+33
| | | | | | figuring out the suffix to use. implement pow(2,x) -> exp2(x). llvm-svn: 49437
* use the new ConstantFP::get method to make this work withChris Lattner2008-04-091-11/+4
| | | | | | long double and simplify the code. llvm-svn: 49435
* Be conservative if getresult operand is neither call nor invoke.Devang Patel2008-04-091-2/+3
| | | | llvm-svn: 49430
* Factor a bunch of functionality related to memcpy and memset transforms out of Owen Anderson2008-04-092-620/+769
| | | | | | GVN and into its own pass. llvm-svn: 49419
* Remove accidentally duplicated code.Owen Anderson2008-04-091-4/+0
| | | | llvm-svn: 49418
* many cleanups to the pow optimizer. Allow it to handle powf,Chris Lattner2008-04-091-34/+50
| | | | | | add support for pow(x, 2.0) -> x*x. llvm-svn: 49411
* Fix insert point handling for multiple return values.Devang Patel2008-04-081-4/+12
| | | | llvm-svn: 49367
* 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
* Use Intrinsic::getDeclaration in more places.Duncan Sands2008-04-072-22/+9
| | | | llvm-svn: 49338
* The "stacksave is not nounwind problem" no longerDuncan Sands2008-04-071-8/+3
| | | | | | | | | needs to be fixed here - a previous commit made sure that intrinsics always get the right attributes. So remove no-longer needed code, and while there use Intrinsic::getDeclaration rather than getOrInsertFunction. llvm-svn: 49337
* Use Intrinsic::getDeclaration to get hold ofDuncan Sands2008-04-071-7/+8
| | | | | | | intrinsics. Fix up the argument type (should be i8*, was an array*). llvm-svn: 49336
* 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
* Mark calls to llvm.stacksave, llvm.stackrestore asDale Johannesen2008-04-071-1/+4
| | | | | | | | nounwind. When such calls are inlined into something else that is invoked, they were getting changed to invokes, which is badness. llvm-svn: 49299
* silence a warning when assertions are disabled.Chris Lattner2008-04-061-1/+1
| | | | llvm-svn: 49283
* API changes for class Use size reduction, wave 1.Gabor Greif2008-04-0641-448/+448
| | | | | | | | Specifically, introduction of XXX::Create methods for Users that have a potentially variable number of Uses. llvm-svn: 49277
* Iterators folloring a SmallVector erased element are invalidated soDavid Greene2008-04-021-6/+4
| | | | | | | | don't access cached iterators from after the erased element. Re-apply 49056 with SmallVector support. llvm-svn: 49106
* 1. Drop default inline threshold back down to 200.Evan Cheng2008-04-012-10/+15
| | | | | | | 2. Do not use # of basic blocks as part of the cost computation since it doesn't really figure into function size. 3. More aggressively inline function with vector code. llvm-svn: 49061
* Reverting 49056 due to the build being broken.Tanya Lattner2008-04-011-4/+6
| | | | llvm-svn: 49060
* Iterators folloring a SmallVector erased element are invalidated soDavid Greene2008-04-011-6/+4
| | | | | | don't access cached iterators from after the erased element. llvm-svn: 49056
* Revert 49006 for the moment.Dale Johannesen2008-04-011-9/+0
| | | | llvm-svn: 49046
* Emit exception handling info for functions which areDale Johannesen2008-03-311-0/+9
| | | | | | | | | | | not marked nounwind, or for all functions when -enable-eh is set, provided the target supports Dwarf EH. llvm-gcc generates nounwind in the right places; other FEs will need to do so also. Given such a FE, -enable-eh should no longer be needed. llvm-svn: 49006
* Don't eliminate bitcast instructions that change the type of a pointerNate Begeman2008-03-311-0/+5
| | | | llvm-svn: 48971
* Fix "Control reaches the end of non-void function" warnings, Chris Lattner2008-03-301-0/+2
| | | | | | patch by David Chisnall. llvm-svn: 48963
* 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
* PHI->removeIncomingValue may remove PHInode.Devang Patel2008-03-271-1/+2
| | | | | | Increment iterator in advance. llvm-svn: 48890
* Handle a special case xor undef, undef -> 0. Technically this should be ↵Evan Cheng2008-03-251-1/+6
| | | | | | transformed to undef. But this is such a common idiom (misuse) we are going to handle it. llvm-svn: 48791
* Add incoming value from header only if phi node has any use inside the loop.Devang Patel2008-03-241-2/+3
| | | | llvm-svn: 48738
* Increasing the inline limit from (overly conservative) 200 to 300. Given ↵Evan Cheng2008-03-243-9/+38
| | | | | | | | each BB costs 20 and each instruction costs 5, 200 means a 4 BB function + 24 instructions (actually less because caller's size also contributes to it). Furthermore, double the limit when more than 10% of the callee instructions are vector instructions. Multimedia kernels tend to love inlining. llvm-svn: 48725
* Temporarily disabling memset forming optimization. Add an option.Evan Cheng2008-03-241-0/+8
| | | | llvm-svn: 48720
* Transform (zext (or (icmp), (icmp))) to (or (zext (cimp), (zext icmp))) if ↵Evan Cheng2008-03-241-96/+129
| | | | | | at least one of the (zext icmp) can be transformed to eliminate an icmp. llvm-svn: 48715
* Preserve calling convention during function cloningAnton Korobeynikov2008-03-231-0/+3
| | | | llvm-svn: 48708
* 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
* Don't include <map> in Pass.h, which doesn't need it. This requiresDan Gohman2008-03-217-0/+7
| | | | | | adding <map> to many files that actually do need it. llvm-svn: 48667
* 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
* Handle getresult instructions in different basic blocksDan Gohman2008-03-211-0/+9
| | | | | | | from their aggregate operands by moving the getresult instructions. llvm-svn: 48657
OpenPOWER on IntegriCloud