summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* Add LCSSA as a requirement for LoopUnswitch, and assert that LoopUnswitch ↵Owen Anderson2006-06-091-0/+4
| | | | | | | | preserves LCSSA. llvm-svn: 28739
* Make Loop able to verify that it is in LCSSA-form, and have the LCSSA pass ↵Owen Anderson2006-06-091-1/+3
| | | | | | | | assert on this. llvm-svn: 28738
* RewriteExpr, either the new PHI node of induction variable or theEvan Cheng2006-06-091-0/+3
| | | | | | | | post-increment value, should be first cast to the appropriated type (to the type of the common expr). Otherwise, the rewrite of a use based on (common + iv) may end up with an incorrect type. llvm-svn: 28735
* Update some comments, and expose LCSSAID in preparation for having other passesOwen Anderson2006-06-081-1/+8
| | | | | | require LCSSA. llvm-svn: 28734
* Fix a spello in a comment.Reid Spencer2006-06-071-1/+1
| | | | llvm-svn: 28714
* Fix a bug in a recent patch. This fixes UnitTests/Vector/Altivec/casts.c onChris Lattner2006-06-061-1/+1
| | | | | | PPC/altivec llvm-svn: 28698
* Fix some formatting, and use inLoop() when appropriate.Owen Anderson2006-06-061-3/+3
| | | | llvm-svn: 28694
* Stop a memory leak, and update some comments.Owen Anderson2006-06-061-10/+10
| | | | llvm-svn: 28693
* Some more clean-up, and squash an IDF-Phi related bug.Owen Anderson2006-06-041-16/+13
| | | | llvm-svn: 28680
* Various clean-ups suggested by Chris.Owen Anderson2006-06-041-30/+32
| | | | llvm-svn: 28678
* Fix a bug in Phi-noded insertion. Also, update some comments to reflect what'sOwen Anderson2006-06-031-12/+21
| | | | | | actually going on. llvm-svn: 28677
* Remove unneeded hook. Patch by Anton K. Thanks!Chris Lattner2006-06-021-2/+0
| | | | llvm-svn: 28664
* Force anything that #includes llvm/Transforms/Utils/UnifyFunctionExitNodes.hChris Lattner2006-06-021-0/+2
| | | | | | | to link in the implementation. Thanks to Anton Korobeynikov for figuring out what was going on here. llvm-svn: 28660
* Remove dead #includeChris Lattner2006-06-011-2/+0
| | | | llvm-svn: 28642
* Make the "pruning cloner" smarter. As it propagates constants through theChris Lattner2006-06-011-23/+146
| | | | | | | | | | code (while cloning) it often gets the branch/switch instructions. Since it knows that edges of the CFG are dead, it need not clone (or even look) at the obviously dead blocks. This should speed up the inliner substantially on code where there are lots of inlinable calls to functions with constant arguments. On C++ code in particular, this kicks in. llvm-svn: 28641
* Silence a -pedantic warning.Chris Lattner2006-06-011-1/+1
| | | | llvm-svn: 28632
* Remove a FIXME that was fixed with my last patch.Owen Anderson2006-06-011-2/+0
| | | | llvm-svn: 28619
* More cleanups. Also, add a special case for updating PHI nodes, andOwen Anderson2006-06-011-21/+33
| | | | | | | reimplement getValueDominatingFunction to walk the DominanceTree rather than just searching blindly. llvm-svn: 28618
* Swap the order of operands created here. For +&|^, the order doesn't matter,Chris Lattner2006-05-311-2/+3
| | | | | | | but for sub, it really does! Fix fixes a miscompilation of fibheap_cut in llvmgcc4. llvm-svn: 28600
* Extract a huge loop into a helper method. Fix a few iterator-invalidation bugs.Owen Anderson2006-05-311-86/+113
| | | | llvm-svn: 28599
* Add Use replacement. Assuming there is nothing horribly wrong with this, LCSSAOwen Anderson2006-05-291-2/+35
| | | | | | | is now theoretically feature-complete. It has not, however, been thoroughly test, and is still considered experimental. llvm-svn: 28529
* Major think-o. Iterate over all live out-of-loop values, and perform theOwen Anderson2006-05-281-36/+36
| | | | | | | other calculations on each individually, rather than trying to delay it and do them all at the end. llvm-svn: 28527
* Make LCSSA insert proper Phi nodes throughout the rest of the CFG by computingOwen Anderson2006-05-271-8/+51
| | | | | | | | the iterated Dominance Frontier of the loop-closure Phi's. This is the second phase of the LCSSA pass. The third phase (coming soon) will be to update all uses of loop variables to use the loop-closure Phi's instead. llvm-svn: 28524
* Fix some regression from the inliner patch I committed last night. This fixesChris Lattner2006-05-271-1/+1
| | | | | | ldecod, lencod, and SPASS. llvm-svn: 28523
* Switch the inliner over to using CloneAndPruneFunctionInto. This effectivelyChris Lattner2006-05-271-5/+9
| | | | | | | | | | | | | | | | | | | | | | | makes it so that it constant folds instructions on the fly. This is good for several reasons: 0. Many instructions are constant foldable after inlining, particularly if inlining a call with constant arguments. 1. Without this, the inliner has to allocate memory for all of the instructions that can be constant folded, then a subsequent pass has to delete them. This gets the job done without this extra work. 2. This makes the inliner *pass* a bit more aggressive: in particular, it partially solves a phase order issue where the inliner would inline lots of code that folds away to nothing, but think that the resultant function is big because of this code that will be gone. Now the code never exists. This is the first part of a 2-step process. The second part will be smart enough to see when this implicit constant folding propagates a constant into a branch or switch instruction, making CFG edges dead. This implements Transforms/Inline/inline_constprop.ll llvm-svn: 28521
* Implement a new method, CloneAndPruneFunctionInto, as documented.Chris Lattner2006-05-272-3/+189
| | | | llvm-svn: 28519
* Refactor some code to expose an interface to constant fold and instruction ↵Chris Lattner2006-05-271-35/+49
| | | | | | given it's opcode, typeand operands. llvm-svn: 28517
* A few small clean-ups, and the addition of an LCSSA statistic.Owen Anderson2006-05-271-2/+8
| | | | llvm-svn: 28512
* Fix a copy-and-paste-o that would break some compilers.Owen Anderson2006-05-261-1/+1
| | | | llvm-svn: 28507
* Clean up and refactor LCSSA a bunch. It should also run faster now, thoughOwen Anderson2006-05-261-66/+50
| | | | | | there's still a lot of work to be done on it. llvm-svn: 28506
* Implement Transforms/InstCombine/store.ll:test2.Chris Lattner2006-05-261-1/+15
| | | | llvm-svn: 28503
* Skeletal LCSSA pass. This is currently non-functional. Expect functionalityOwen Anderson2006-05-261-0/+159
| | | | | | and documentation updates soo. llvm-svn: 28495
* Transform things like (splat(splat)) -> splatChris Lattner2006-05-261-4/+50
| | | | llvm-svn: 28490
* Introduce a helper function that simplifies interpretation of shuffle masks.Chris Lattner2006-05-251-91/+64
| | | | | | No functionality change. llvm-svn: 28489
* Turn (cast (shuffle (cast)) -> shuffle (cast) if it reduces the # casts inChris Lattner2006-05-251-2/+31
| | | | | | | the program. This exposes more opportunities for the instcombiner, and implements vec_shuffle.ll:test6 llvm-svn: 28487
* extract element from a shuffle vector can be trivially turned into anChris Lattner2006-05-251-12/+41
| | | | | | extractelement from the SV's source. This implement vec_shuffle.ll:test[45] llvm-svn: 28485
* Revert a patch that is unsafe, due to out of range array accesses in innerChris Lattner2006-05-251-2/+2
| | | | | | array scopes possibly accessing valid memory in outer subscripts. llvm-svn: 28478
* Patch for a new instcombine xform, patch contributed by Nick Lewycky!Chris Lattner2006-05-241-2/+4
| | | | | | This implements Transforms/InstCombine/2006-05-10-InvalidIndexUndef.ll llvm-svn: 28450
* Patches to make the LLVM sources more -pedantic clean. Patch providedChris Lattner2006-05-242-2/+2
| | | | | | by Anton Korobeynikov! This is a step towards closing PR786. llvm-svn: 28447
* Silence a bogus gcc warningChris Lattner2006-05-201-1/+1
| | | | llvm-svn: 28422
* Fix a doxygen problem and break lines at 80 columnsReid Spencer2006-05-191-3/+3
| | | | llvm-svn: 28395
* Declare that lowerinvoke doesn't interact with other lowering passes.Chris Lattner2006-05-175-7/+22
| | | | | | Patch written by Domagoj Babic! llvm-svn: 28367
* Add a CloneModule call that exposes the mapping of values from the old moduleChris Lattner2006-05-171-4/+8
| | | | | | to the new module. Patch provided by Nick Lewycky! llvm-svn: 28349
* remove some dead code identified by coverityChris Lattner2006-05-141-1/+1
| | | | llvm-svn: 28289
* remove dead variablesChris Lattner2006-05-142-3/+0
| | | | llvm-svn: 28286
* Backing out last check-in for now. It's causing an infinite loop gccas lencode.Evan Cheng2006-05-141-6/+0
| | | | llvm-svn: 28284
* Add/Sub/Mul are safe to promote here as well. Incrementing a single-bitChris Lattner2006-05-131-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | bitfield now gives this code: _plus: lwz r2, 0(r3) rlwimi r2, r2, 0, 1, 31 xoris r2, r2, 32768 stw r2, 0(r3) blr instead of this: _plus: lwz r2, 0(r3) srwi r4, r2, 31 slwi r4, r4, 31 addis r4, r4, -32768 rlwimi r2, r4, 0, 0, 0 stw r2, 0(r3) blr this can obviously still be improved. llvm-svn: 28275
* Implement simple promotion for cast elimination in instcombine. This isChris Lattner2006-05-131-0/+119
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | currently very limited, but can be extended in the future. For example, we now compile: uint %test30(uint %c1) { %c2 = cast uint %c1 to ubyte %c3 = xor ubyte %c2, 1 %c4 = cast ubyte %c3 to uint ret uint %c4 } to: _xor: movzbl 4(%esp), %eax xorl $1, %eax ret instead of: _xor: movb $1, %al xorb 4(%esp), %al movzbl %al, %eax ret More impressively, we now compile: struct B { unsigned bit : 1; }; void xor(struct B *b) { b->bit = b->bit ^ 1; } To (X86/PPC): _xor: movl 4(%esp), %eax xorl $-2147483648, (%eax) ret _xor: lwz r2, 0(r3) xoris r2, r2, 32768 stw r2, 0(r3) blr instead of (X86/PPC): _xor: movl 4(%esp), %eax movl (%eax), %ecx movl %ecx, %edx shrl $31, %edx # TRUNCATE movb %dl, %dl xorb $1, %dl movzbl %dl, %edx andl $2147483647, %ecx shll $31, %edx orl %ecx, %edx movl %edx, (%eax) ret _xor: lwz r2, 0(r3) srwi r4, r2, 31 xori r4, r4, 1 rlwimi r2, r4, 31, 0, 0 stw r2, 0(r3) blr This implements InstCombine/cast.ll:test30. llvm-svn: 28273
* Remove some dead variables.Chris Lattner2006-05-122-7/+2
| | | | | | Fix a nasty bug in the memcmp optimizer where we used the wrong variable! llvm-svn: 28269
* Remove dead stuffChris Lattner2006-05-121-4/+0
| | | | llvm-svn: 28268
OpenPOWER on IntegriCloud