summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* Clean ups for loop deletion based on Chris' feedback.Owen Anderson2008-05-161-28/+32
| | | | | | | Also, use SCEV to determine the trip count of the loop, which is more powerful and accurate that Loop::getTripCount. llvm-svn: 51179
* implement PR2328.Chris Lattner2008-05-161-0/+4
| | | | llvm-svn: 51176
* Fix a bug in LoopStrengthReduce that caused it to emit IR withDan Gohman2008-05-151-3/+21
| | | | | | | | | | | | | | | | | use-before-def. The problem comes up in code with multiple PHIs where one PHI is being rewritten in terms of the other, but the other needs to be casted first. LLVM rules requre the cast instruction to be inserted after any PHI instructions, but when instructions were inserted to replace the second PHI value with a function of the first, they were ended up going before the cast instruction. Avoid this problem by remembering the location of the cast instruction, when one is needed, and inserting the expansion of the new value after it. This fixes a bug that surfaced in 255.vortex on x86-64 when instcombine was removed from the middle of the loop optimization passes. llvm-svn: 51169
* Remove useless check.Devang Patel2008-05-151-6/+2
| | | | | | Patch by Matthijs Kooijman. llvm-svn: 51154
* Use of UINT_MAX requires climits, at least whenDuncan Sands2008-05-151-0/+1
| | | | | | compiling with gcc 4.3. llvm-svn: 51145
* Fix a bunch of 80col violations that arose from the Create API change. Tweak ↵Gabor Greif2008-05-1510-23/+38
| | | | | | makefile targets to find these better. llvm-svn: 51143
* Situations can arise when you have a function called that returns a 'void', butBill Wendling2008-05-141-2/+2
| | | | | | | | | | is bitcast to return a floating point value. The result of the instruction may not be used by the program afterwards, and LLVM will happily remove all instructions except the call. But, on some platforms, if a value is returned as a floating point, it may need to be removed from the stack (like x87). Thus, we can't get rid of the bitcast even if there isn't a use of the value. llvm-svn: 51134
* rename SimplifyCFG.cpp -> SimplifyCFGPass.cppChris Lattner2008-05-141-1/+1
| | | | llvm-svn: 51130
* Simplify internalize pass. Add test case.Devang Patel2008-05-141-19/+21
| | | | | | Patch by Matthijs Kooijman! llvm-svn: 51114
* Split the loop unroll mechanism logic out into a utility function.Dan Gohman2008-05-142-379/+385
| | | | | | Patch by Matthijs Kooijman! llvm-svn: 51083
* 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
* Fix for PR 2323, infinite loop in tail dup.Dale Johannesen2008-05-131-4/+15
| | | | llvm-svn: 51063
* 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
* Change class' public PassInfo variables to by initialized with theDan Gohman2008-05-138-8/+8
| | | | | | | | | | | address of the PassInfo directly instead of calling getPassInfo. This eliminates a bunch of dynamic initializations of static data. Also, fold RegisterPassBase into PassInfo, make a bunch of its data members const, and rearrange some code to initialize data members in constructors instead of using setter member functions. llvm-svn: 51022
* 80 col / tabs fixesNate Begeman2008-05-132-6/+7
| | | | llvm-svn: 51021
* Clean up the use of static and anonymous namespaces. This turned upDan Gohman2008-05-1357-254/+307
| | | | | | | several things that were neither in an anonymous namespace nor static but not intended to be global. llvm-svn: 51017
* 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
* Fix various DOUTs to not call the extremely expensive Value::getName() Chris Lattner2008-05-111-5/+5
| | | | | | | | method. DOUT statements are disabled when assertions are off, but the side effects of getName() are still evaluated. Just call getNameSTart, which is close enough and doesn't cause heap traffic. llvm-svn: 50958
* Simplify code by using SwitchInst::findCaseValue instead of reimplementing it.Chris Lattner2008-05-101-14/+2
| | | | llvm-svn: 50957
* don't sink invokes, even if they are readonly. This fixes aChris Lattner2008-05-091-1/+2
| | | | | | crash on kimwitu++. llvm-svn: 50901
* Fix a type and formatting.Duncan Sands2008-05-091-2/+2
| | | | llvm-svn: 50900
* Implement PR2298. This transforms:Chris Lattner2008-05-091-0/+13
| | | | | | | ~x < ~y --> y < x -x == -y --> x == y llvm-svn: 50882
* restore doxygen comment.Chris Lattner2008-05-091-17/+16
| | | | llvm-svn: 50881
* Improve pass documentation and comments.Gordon Henriksen2008-05-085-26/+38
| | | | | | Patch by Matthijs Kooijman! llvm-svn: 50861
* More than just loads can read from memory: readonly calls like strlenChris Lattner2008-05-081-4/+4
| | | | | | | also need to be checked for memory modifying instructions before we can sink them. THis fixes the second half of PR2297. llvm-svn: 50860
* Make instcombine's DSE respect loads as well as stores. It is not safe toChris Lattner2008-05-081-1/+1
| | | | | | | | | | | | delete the first store in: store x -> p load p store y -> p This is for PR2297. llvm-svn: 50859
* Check linkage.Devang Patel2008-05-081-1/+1
| | | | llvm-svn: 50851
* Turn StripPointerCast() into a methodAnton Korobeynikov2008-05-071-1/+1
| | | | llvm-svn: 50836
* Fix a bug in the ComputeMaskedBits logic for multiply.Dan Gohman2008-05-071-2/+2
| | | | llvm-svn: 50793
* Make StripPointerCast a common function (should we mak it method of Value ↵Anton Korobeynikov2008-05-061-2/+1
| | | | | | instead?) llvm-svn: 50775
* We need to update PHIs containing the exiting block, not the exit block. We ↵Owen Anderson2008-05-061-3/+8
| | | | | | really should come up with better names for these. llvm-svn: 50770
* Fix typo.Devang Patel2008-05-061-1/+1
| | | | llvm-svn: 50713
* fix typo Duncan noticedChris Lattner2008-05-061-1/+1
| | | | llvm-svn: 50699
* Make several variable declarations static.Dan Gohman2008-05-068-10/+10
| | | | llvm-svn: 50696
* Remove uses of llvm/System/IncludeFile.h that are no longer needed.Dan Gohman2008-05-061-2/+0
| | | | llvm-svn: 50695
* Correct the value of LowBits in srem and urem handling inDan Gohman2008-05-061-6/+6
| | | | | | ComputeMaskedBits. llvm-svn: 50692
* Fix: Some classes were derived from a class in an anonymous namespace, but theyBill Wendling2008-05-051-0/+2
| | | | | | themselves weren't in the anonymous namespace. llvm-svn: 50673
* Fix a crash when threading a block that includes a MRV call result.Chris Lattner2008-05-051-4/+19
| | | | | | | | | DemoteRegToStack doesn't work with MRVs yet, because it relies on the ability to load/store things. This fixes PR2285. llvm-svn: 50667
* processStore may delete the instruction, avoidTorok Edwin2008-05-041-2/+1
| | | | | | using dyn_cast<> on already freed memory. llvm-svn: 50618
* Handle multiple return values.Devang Patel2008-05-031-1/+23
| | | | llvm-svn: 50604
* Do not sink getresult.Devang Patel2008-05-031-1/+3
| | | | llvm-svn: 50600
* Fix a mistake in the computation of leading zeros for udiv.Dan Gohman2008-05-021-3/+5
| | | | llvm-svn: 50591
* strength reduce exp2 into ldexp, rdar://5852514Chris Lattner2008-05-021-1/+52
| | | | llvm-svn: 50586
* add a FIXME so we remember to eventually remove this code.Chris Lattner2008-05-021-5/+6
| | | | llvm-svn: 50582
* Porting r50563 from Tak to mainline.Bill Wendling2008-05-021-0/+5
| | | | llvm-svn: 50564
* Don't try to create PHIs of struct types. FalloutDale Johannesen2008-05-011-8/+31
| | | | | | from x86-64 calling convention work. llvm-svn: 50545
* Fix an overaggressive SimplifyDemandedBits optimization on urem. ThisDan Gohman2008-05-011-4/+5
| | | | | | fixes the 254.gap regression on x86 and the 403.gcc regression on x86-64. llvm-svn: 50537
* 1) add '-debug' outputChris Lattner2008-05-011-11/+19
| | | | | | | 2) Return NULL instead of false in several places for tidiness. 3) fix a bug optimizing sprintf(p, "%c", x) llvm-svn: 50521
OpenPOWER on IntegriCloud