summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* 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
* FunctionExtractorPass has been superceded by GVExtractorPassAndrew Lenharth2008-03-211-147/+0
| | | | llvm-svn: 48648
* Fix the build for gcc-4.2.Duncan Sands2008-03-211-1/+2
| | | | llvm-svn: 48639
* Teach masked value is zero about add and sub, and use MVIZ toChris Lattner2008-03-211-34/+87
| | | | | | | | simplify things like (X & 4) >> 1 == 2 --> (X & 4) == 4. since it is obvious that the shift doesn't remove any bits. llvm-svn: 48631
* Incorporate feedback.Devang Patel2008-03-201-24/+24
| | | | | | | | - Fix loop nest. - Use RetVals.size() - Check for null return value. llvm-svn: 48605
* C and Objective Caml bindings for mem2reg and reg2mem.Gordon Henriksen2008-03-201-0/+8
| | | | | | Patch by Erick Tryzelaar. llvm-svn: 48602
* Take the old function's name.Zhou Sheng2008-03-201-0/+1
| | | | llvm-svn: 48588
* 80 col violation.Evan Cheng2008-03-201-1/+2
| | | | llvm-svn: 48573
* Add comment.Devang Patel2008-03-191-0/+4
| | | | llvm-svn: 48567
* Remove dead options.Evan Cheng2008-03-192-20/+4
| | | | llvm-svn: 48556
* Update heuritics that estimates cost of call instructions.Devang Patel2008-03-171-0/+5
| | | | llvm-svn: 48474
* C and Objective Caml bindings for several scalar transforms.Gordon Henriksen2008-03-161-0/+39
| | | | | | Patch originally by Erick Tryzelaar, but has been modified somewhat. llvm-svn: 48419
* The inst combining of inttoptr into GEP with one index was using the bit size ofBill Wendling2008-03-141-1/+1
| | | | | | | | the type instead of the byte size. This was causing troublesome mis-compilations. True to form, this took 2 days to find and is a one-line fix. :-P llvm-svn: 48354
* 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
* Update -mem2reg to use succ_iterator instead of iterating across TerminatorInstNick Lewycky2008-03-131-13/+10
| | | | | | successors. This makes it support nounwind. llvm-svn: 48320
* Reimplement the parameter attributes support, phase #1. hilights:Chris Lattner2008-03-126-126/+91
| | | | | | | | | | | | | | | | | | | | | | | 1. There is now a "PAListPtr" class, which is a smart pointer around the underlying uniqued parameter attribute list object, and manages its refcount. It is now impossible to mess up the refcount. 2. PAListPtr is now the main interface to the underlying object, and the underlying object is now completely opaque. 3. Implementation details like SmallVector and FoldingSet are now no longer part of the interface. 4. You can create a PAListPtr with an arbitrary sequence of ParamAttrsWithIndex's, no need to make a SmallVector of a specific size (you can just use an array or scalar or vector if you wish). 5. All the client code that had to check for a null pointer before dereferencing the pointer is simplified to just access the PAListPtr directly. 6. The interfaces for adding attrs to a list and removing them is a bit simpler. Phase #2 will rename some stuff (e.g. PAListPtr) and do other less invasive changes. llvm-svn: 48289
* 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
* Check multiple return values.Devang Patel2008-03-121-1/+2
| | | | llvm-svn: 48267
* Fix attribute handling.Devang Patel2008-03-121-14/+14
| | | | llvm-svn: 48262
* Handle multiple ret values.Devang Patel2008-03-111-21/+59
| | | | llvm-svn: 48254
* Initialize.Devang Patel2008-03-111-2/+2
| | | | llvm-svn: 48253
* Check to see if a two-entry PHI block can be simplifiedDan Gohman2008-03-111-6/+6
| | | | | | | | before trying to merge the block into its predecessors. This allows two-entry-phi-return.ll to be simplified into a single basic block. llvm-svn: 48252
* Skip functions that return multiple values.Devang Patel2008-03-111-0/+3
| | | | llvm-svn: 48233
* Become multiple return value aware.Devang Patel2008-03-111-1/+5
| | | | | | | Right now, the pass does not optimize tail recursions involving multiple return values. llvm-svn: 48228
* Add TODO reminder.Devang Patel2008-03-111-0/+1
| | | | llvm-svn: 48227
* Initial multiple return values support.Devang Patel2008-03-111-19/+95
| | | | llvm-svn: 48210
* Restore optimization that merges blocks when inline function Devang Patel2008-03-101-6/+24
| | | | | | has single return value. llvm-svn: 48162
* SimplifyDevang Patel2008-03-101-18/+15
| | | | llvm-svn: 48161
OpenPOWER on IntegriCloud