summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
...
* Add an option to this pass. If it is set, we are allowed to internalizeChris Lattner2005-10-181-4/+10
| | | | | | | all but main. If it's not set, we can still internalize, but only if an explicit symbol list is provided. llvm-svn: 23783
* Make this work for FP constantexprsChris Lattner2005-10-171-2/+3
| | | | llvm-svn: 23773
* Oops, X+0.0 isn't foldable, but X+-0.0 is.Chris Lattner2005-10-171-4/+5
| | | | llvm-svn: 23772
* relax this a bit, as we only support the default rounding modeChris Lattner2005-10-171-2/+4
| | | | llvm-svn: 23771
* Fix (hopefully the last) issue where LSR is nondeterminstic. When pullingChris Lattner2005-10-111-8/+14
| | | | | | | out CSE's of base expressions it could build a result whose order was nondet. llvm-svn: 23698
* Fix another problem where LSR was being nondeterminstic. Also remove elementsChris Lattner2005-10-111-10/+16
| | | | | | from the end of a vector instead of the beginning llvm-svn: 23697
* Fix another lsr-is-nondeterministic caseChris Lattner2005-10-111-6/+10
| | | | llvm-svn: 23695
* Make MaskedValueIsZero a bit more aggressiveChris Lattner2005-10-091-3/+9
| | | | llvm-svn: 23677
* Fix funky xcode indentationChris Lattner2005-10-091-50/+50
| | | | llvm-svn: 23674
* Hrm, you didn't see this.Chris Lattner2005-10-091-3/+0
| | | | llvm-svn: 23673
* Fix a source of non-determinism in the backend: the order of processingChris Lattner2005-10-091-6/+25
| | | | | | | IV strides dependend on the pointer order of the strides in memory. Non-determinism is bad. llvm-svn: 23672
* Remove useless variable.Jeff Cohen2005-10-071-1/+1
| | | | llvm-svn: 23656
* Fix DemoteRegToStack on an invoke. This fixes PR634.Chris Lattner2005-10-041-1/+2
| | | | llvm-svn: 23618
* Clean up the code a bit. Use isInstructionTriviallyDead to be more aggressiveChris Lattner2005-10-031-4/+8
| | | | | | | and more correct than use_empty(). This fixes PR635 and SimplifyCFG/2005-10-02-InvokeSimplify.ll llvm-svn: 23616
* Make IVUseShouldUsePostIncValue more aggressive when the use is a PHI. InChris Lattner2005-10-031-6/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | particular, it should realize that phi's use their values in the pred block not the phi block itself. This change turns our em3d loop from this: _test: cmpwi cr0, r4, 0 bgt cr0, LBB_test_2 ; entry.no_exit_crit_edge LBB_test_1: ; entry.loopexit_crit_edge li r2, 0 b LBB_test_6 ; loopexit LBB_test_2: ; entry.no_exit_crit_edge li r6, 0 LBB_test_3: ; no_exit or r2, r6, r6 lwz r6, 0(r3) cmpw cr0, r6, r5 beq cr0, LBB_test_6 ; loopexit LBB_test_4: ; endif addi r3, r3, 4 addi r6, r2, 1 cmpw cr0, r6, r4 blt cr0, LBB_test_3 ; no_exit LBB_test_5: ; endif.loopexit.loopexit_crit_edge addi r3, r2, 1 blr LBB_test_6: ; loopexit or r3, r2, r2 blr into: _test: cmpwi cr0, r4, 0 bgt cr0, LBB_test_2 ; entry.no_exit_crit_edge LBB_test_1: ; entry.loopexit_crit_edge li r2, 0 b LBB_test_5 ; loopexit LBB_test_2: ; entry.no_exit_crit_edge li r6, 0 LBB_test_3: ; no_exit lwz r2, 0(r3) cmpw cr0, r2, r5 or r2, r6, r6 beq cr0, LBB_test_5 ; loopexit LBB_test_4: ; endif addi r3, r3, 4 addi r6, r6, 1 cmpw cr0, r6, r4 or r2, r6, r6 blt cr0, LBB_test_3 ; no_exit LBB_test_5: ; loopexit or r3, r2, r2 blr Unfortunately, this is actually worse code, because the register coallescer is getting confused somehow. If it were doing its job right, it could turn the code into this: _test: cmpwi cr0, r4, 0 bgt cr0, LBB_test_2 ; entry.no_exit_crit_edge LBB_test_1: ; entry.loopexit_crit_edge li r6, 0 b LBB_test_5 ; loopexit LBB_test_2: ; entry.no_exit_crit_edge li r6, 0 LBB_test_3: ; no_exit lwz r2, 0(r3) cmpw cr0, r2, r5 beq cr0, LBB_test_5 ; loopexit LBB_test_4: ; endif addi r3, r3, 4 addi r6, r6, 1 cmpw cr0, r6, r4 blt cr0, LBB_test_3 ; no_exit LBB_test_5: ; loopexit or r3, r6, r6 blr ... which I'll work on next. :) llvm-svn: 23604
* Refactor some code into a functionChris Lattner2005-10-031-7/+23
| | | | llvm-svn: 23603
* This break is bogus and I have no idea why it was there. Basically it preventsChris Lattner2005-10-031-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | memoizing code when IV's are used by phinodes outside of loops. In a simple example, we were getting this code before (note that r6 and r7 are isomorphic IV's): li r6, 0 or r7, r6, r6 LBB_test_3: ; no_exit lwz r2, 0(r3) cmpw cr0, r2, r5 or r2, r7, r7 beq cr0, LBB_test_5 ; loopexit LBB_test_4: ; endif addi r2, r7, 1 addi r7, r7, 1 addi r3, r3, 4 addi r6, r6, 1 cmpw cr0, r6, r4 blt cr0, LBB_test_3 ; no_exit Now we get: li r6, 0 LBB_test_3: ; no_exit or r2, r6, r6 lwz r6, 0(r3) cmpw cr0, r6, r5 beq cr0, LBB_test_6 ; loopexit LBB_test_4: ; endif addi r3, r3, 4 addi r6, r2, 1 cmpw cr0, r6, r4 blt cr0, LBB_test_3 ; no_exit this was noticed in em3d. llvm-svn: 23602
* when checking if we should move a split edge block outside of a loop,Chris Lattner2005-10-031-7/+6
| | | | | | | | check the presplit pred, not the post-split pred. This was causing us to make the wrong decision in some cases, leaving the critical edge block in the loop. llvm-svn: 23601
* Fix VC++ warnings.Jeff Cohen2005-10-011-1/+0
| | | | llvm-svn: 23579
* Insert stores after phi nodes in the normal dest. This fixesChris Lattner2005-09-291-2/+5
| | | | | | LowerInvoke/2005-08-03-InvokeWithPHI.ll llvm-svn: 23525
* Fold isascii into a simple comparison. This speeds up 197.parser by 7.4%,Chris Lattner2005-09-291-0/+26
| | | | | | bringing the LLC time down to the CBE time. llvm-svn: 23521
* remove a bunch of unneeded stuff, or self evident commentsChris Lattner2005-09-291-45/+6
| | | | llvm-svn: 23519
* Implement a couple of memcmp folds from the todo listChris Lattner2005-09-291-3/+121
| | | | llvm-svn: 23517
* Constant fold llvm.sqrtChris Lattner2005-09-281-1/+9
| | | | llvm-svn: 23487
* add a note about a way to improve this code further, that I won't be gettingChris Lattner2005-09-271-0/+8
| | | | | | to right now. llvm-svn: 23485
* Fix a regression in my previous patch, fixing GlobalOpt/2005-09-27-Crash.llChris Lattner2005-09-271-1/+1
| | | | | | and PR632. llvm-svn: 23484
* Avoid spilling stack slots... to stack slots.Chris Lattner2005-09-271-0/+6
| | | | llvm-svn: 23478
* Completely rewrite 'correct' eh support. This changes how setjmp insertionChris Lattner2005-09-271-140/+301
| | | | | | | | | | | | | | | | | is performed so it is only at most once per function that contains an invoke instead of once per invoke in the function. This patch has the following perks: 1. It fixes PR631, which complains about slowness. 2. If fixes PR240, which complains about non-volatile vars being live across setjmp/longjmps. 3. It improves (but does not fix) the jmpbuf alignment issue on itanium by not forcing the jmpbufs to always be 8-bytes off the alignment of the structure. 4. It speeds up 253.perlbmk from 338s to 13.70s (a 25x improvement!), making us now about 4% faster than GCC. Further improvements are also possible. llvm-svn: 23477
* Make the pass name simplerChris Lattner2005-09-271-1/+1
| | | | llvm-svn: 23476
* allow demotion to volatile values, add support for invokeChris Lattner2005-09-271-12/+15
| | | | llvm-svn: 23473
* Add support for external calls that we know how to constant fold. This ↵Chris Lattner2005-09-271-11/+20
| | | | | | | | implements ctor-list-opt.ll:CTOR8 llvm-svn: 23465
* Fix a bug where we would evaluate stores into linkonce objects which could beChris Lattner2005-09-271-1/+6
| | | | | | potentially replaced at link-time. llvm-svn: 23463
* Implement support for static constructors with calls in them. This is usefulChris Lattner2005-09-271-23/+54
| | | | | | | | because gccas runs globalopt before inlining. This implements ctor-list-opt.ll:CTOR7 llvm-svn: 23462
* Refactor this code a bit, no functionality changes.Chris Lattner2005-09-271-22/+40
| | | | llvm-svn: 23460
* Remove some dead code. ctor evaluation subsumes empty ctor elimChris Lattner2005-09-261-12/+0
| | | | llvm-svn: 23453
* Add support for alloca, implementing ctor-list-opt.ll:CTOR6Chris Lattner2005-09-261-17/+48
| | | | llvm-svn: 23452
* Add a debug printout, fix a crash on kc++Chris Lattner2005-09-261-1/+6
| | | | llvm-svn: 23450
* Implement loads/stores through GEP's of globals. This implementsChris Lattner2005-09-261-6/+98
| | | | | | ctor-list-opt.ll:CTOR5. llvm-svn: 23449
* Replace TraverseGEPInitializer with ConstantFoldLoadThroughGEPConstantExprChris Lattner2005-09-261-17/+5
| | | | llvm-svn: 23447
* Eliminate GetGEPGlobalInitializer in favor of the more powerfulChris Lattner2005-09-261-27/+1
| | | | | | ConstantFoldLoadThroughGEPConstantExpr function in the utils lib. llvm-svn: 23446
* Factor the GetGEPGlobalInitializer out of this pass and into Transforms/UtilsChris Lattner2005-09-261-44/+2
| | | | | | as ConstantFoldLoadThroughGEPConstantExpr. llvm-svn: 23445
* Move the ConstantFoldLoadThroughGEPConstantExpr function out of the InstCombineChris Lattner2005-09-261-1/+45
| | | | | | pass. llvm-svn: 23444
* add a commentChris Lattner2005-09-261-0/+3
| | | | llvm-svn: 23442
* Add support for getelementptr, load, and correctly reject volatile stores.Chris Lattner2005-09-261-0/+29
| | | | llvm-svn: 23441
* Add support for br/brcond/switch and phiChris Lattner2005-09-261-3/+47
| | | | llvm-svn: 23439
* Add a simple interpreter to this code, allowing us to statically evaluateChris Lattner2005-09-261-4/+110
| | | | | | global ctors that are simple enough. This implements ctor-list-opt.ll:CTOR2. llvm-svn: 23437
* factor some code into a InstallGlobalCtors method, add comments. No ↵Chris Lattner2005-09-261-35/+52
| | | | | | functionality change. llvm-svn: 23435
* Make the global opt optimizer work on modules with a null terminator, byChris Lattner2005-09-261-8/+13
| | | | | | accepting the null even with a non-65535 init prio llvm-svn: 23434
* Factor this code out into a few methods.Chris Lattner2005-09-261-33/+190
| | | | | | | | | | | | | Implement the start of global ctor optimization. It is currently smart enough to remove the global ctor for cases like this: struct foo { foo() {} } x; ... saving a bit of startup time for the program. llvm-svn: 23433
* Fix some logic I broke that caused a regression onChris Lattner2005-09-251-3/+5
| | | | | | SimplifyLibCalls/2005-05-20-sprintf-crash.ll llvm-svn: 23430
OpenPOWER on IntegriCloud