summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* only factor from expressions whose uses are empty and whoseChris Lattner2010-01-091-0/+5
| | | | | | base is the right expression type. This fixes PR5981. llvm-svn: 93045
* Fix nondeterministic behavior.Julien Lerouge2010-01-091-6/+7
| | | | llvm-svn: 93038
* Remove unnecessary dyn_cast and add a comment. Part of a WIP.Eric Christopher2010-01-081-4/+4
| | | | llvm-svn: 93026
* mplement a theoretical fixme.Chris Lattner2010-01-081-3/+7
| | | | llvm-svn: 93024
* rename CanEvaluateInDifferentType -> CanEvaluateTruncated and Chris Lattner2010-01-081-71/+28
| | | | | | simplify it now that it is only used for truncates. llvm-svn: 93021
* teach instcombine to delete sign extending shift pairs (sra(shl X, C), C) whenChris Lattner2010-01-081-4/+15
| | | | | | the input is already sign extended. llvm-svn: 93019
* Suppress an unused variable warning when assertions are off;Duncan Sands2010-01-081-2/+3
| | | | | | remove some trailing whitespace while there. llvm-svn: 93008
* tidy up some stuff duncan pointed out.Chris Lattner2010-01-081-2/+3
| | | | llvm-svn: 93007
* teach ComputeNumSignBits to look through PHI nodes.Chris Lattner2010-01-071-3/+0
| | | | llvm-svn: 92964
* Enhance instcombine to reason more strongly about promoting computationChris Lattner2010-01-071-51/+144
| | | | | | | that feeds into a zext, similar to the patch I did yesterday for sext. There is a lot of room for extension beyond this patch. llvm-svn: 92962
* Use a do-while loop instead of while + boolean.Benjamin Kramer2010-01-071-6/+4
| | | | llvm-svn: 92912
* Be less stingy as to how many selects and phi nodes weDuncan Sands2010-01-071-2/+2
| | | | | | are prepared to look through. llvm-svn: 92898
* handle ConstantVector while I'm in here.Chris Lattner2010-01-071-0/+3
| | | | llvm-svn: 92892
* fix a globalopt crash on 'bullet' (handling evaluation of a storeChris Lattner2010-01-071-16/+20
| | | | | | | | | | to an element of a vector in a static ctor) which occurs with an unrelated patch I'm testing. Annoyingly, EvaluateStoreInto basically does exactly the same stuff as InsertElement constant folding, but it now handles vectors, and you can't insertelement into a vector. It would be 'really nice' if GEP into a vector were not legal. llvm-svn: 92889
* Move the object size intrinsic optimization to inst-combine and makeEric Christopher2010-01-062-24/+12
| | | | | | it work for any integer size return type. llvm-svn: 92853
* Fix a README item: have functionattrs look through selects andDuncan Sands2010-01-061-10/+41
| | | | | | | | | phi nodes when deciding which pointers point to local memory. I actually checked long ago how useful this is, and it isn't very: it hardly ever fires in the testsuite, but since Chris wants it here it is! llvm-svn: 92836
* Formatting.Mikhail Glushenkov2010-01-061-2/+2
| | | | llvm-svn: 92831
* Partially address a README by having functionattrs consider calls toDuncan Sands2010-01-061-0/+15
| | | | | | | | | | memcpy, memset and other intrinsics that only access their arguments to be readnone if the intrinsic's arguments all point to local memory. This improves the testcase in the README to readonly, but it could in theory be made readnone, however this would involve more sophisticated analysis that looks through the memcpy. llvm-svn: 92829
* tweaks suggested by DuncanChris Lattner2010-01-061-7/+7
| | | | llvm-svn: 92824
* Teach instcombine's sext elimination logic to be more aggressive.Chris Lattner2010-01-061-18/+168
| | | | | | | | | | | | | | Previously, instcombine would only promote an expression tree to the larger type if doing so eliminated two casts. This is because a need to manually do the sign extend after the promoted expression tree with two shifts. Now, we keep track of whether the result of the computation is going to be properly sign extended already. If so, we can unconditionally promote the expression, which allows us to zap more sext's. This implements rdar://6598839 (aka gcc pr38751) llvm-svn: 92815
* simplify this code.Chris Lattner2010-01-051-109/+66
| | | | llvm-svn: 92800
* make this a static function instead of a method.Chris Lattner2010-01-052-6/+5
| | | | llvm-svn: 92795
* more rearrangement and cleanup, fix my test failure.Chris Lattner2010-01-051-118/+104
| | | | llvm-svn: 92792
* cleanupChris Lattner2010-01-051-18/+15
| | | | llvm-svn: 92790
* remove two trunc xforms that are subsumed by EvaluateInDifferentType.Chris Lattner2010-01-051-36/+0
| | | | | | | The only difference is that EvaluateInDifferentType checks to ensure they are profitable before doing them :) llvm-svn: 92788
* just remove this xform which is subsumed by others.Chris Lattner2010-01-051-26/+1
| | | | llvm-svn: 92775
* move a trunc-specific transform out of commonIntCastTransforms into visitTrunc.Chris Lattner2010-01-051-32/+34
| | | | llvm-svn: 92773
* Move remaining stuff to the isInteger predicate.Benjamin Kramer2010-01-055-17/+13
| | | | llvm-svn: 92771
* move a zext specific xform out of commonIntCastTransforms into visitZExt and ↵Chris Lattner2010-01-051-10/+9
| | | | | | modernize it. llvm-svn: 92770
* move a trunc-specific xform out of commonIntCastTransforms into visitTruncChris Lattner2010-01-051-16/+25
| | | | llvm-svn: 92768
* reduce indentationChris Lattner2010-01-051-15/+18
| | | | llvm-svn: 92766
* Convert a ton of simple integer type equality tests to the new predicate.Benjamin Kramer2010-01-058-16/+15
| | | | llvm-svn: 92760
* optimize comparisons against cttz/ctlz/ctpop, patch by Alastair Lynn!Chris Lattner2010-01-051-1/+23
| | | | llvm-svn: 92745
* Nick Lewycky pointed out that this code makes changes unconditionally.Dan Gohman2010-01-051-1/+2
| | | | llvm-svn: 92739
* Set Changed properly after calling DeleteDeadPHIs.Dan Gohman2010-01-052-2/+2
| | | | llvm-svn: 92735
* Use do+while instead of while for loops which obviously have aDan Gohman2010-01-0512-29/+23
| | | | | | non-zero trip count. Use SmallVector's pop_back_val(). llvm-svn: 92734
* Fix indentation.Dan Gohman2010-01-051-1/+1
| | | | llvm-svn: 92733
* Make RecursivelyDeleteTriviallyDeadInstructions,Dan Gohman2010-01-052-9/+17
| | | | | | | RecursivelyDeleteDeadPHINode, and DeleteDeadPHIs return a flag indicating whether they made any changes. llvm-svn: 92732
* Add newline at EOF.Benjamin Kramer2010-01-051-1/+1
| | | | llvm-svn: 92727
* Avoid going through the LLVMContext for type equality where it's safe to ↵Benjamin Kramer2010-01-0511-14/+13
| | | | | | dereference the type pointer. llvm-svn: 92726
* prune some #includes.Chris Lattner2010-01-051-8/+1
| | | | llvm-svn: 92712
* split and/or/xor out into one overly-large (2000LOC) file. However, I thinkChris Lattner2010-01-053-1963/+1978
| | | | | | it does make sense to keep them together, at least for now. llvm-svn: 92711
* missed file with previous commit.Chris Lattner2010-01-051-418/+0
| | | | llvm-svn: 92710
* split instcombine of shifts out to its own file.Chris Lattner2010-01-052-0/+437
| | | | llvm-svn: 92709
* eliminate getBitCastOperand and simplify some over-complex inbounds stuff.Chris Lattner2010-01-051-46/+22
| | | | llvm-svn: 92708
* split call handling out to InstCombineCalls.cppChris Lattner2010-01-053-1110/+1133
| | | | llvm-svn: 92707
* optimize cttz and ctlz when we can prove something about the Chris Lattner2010-01-051-1/+34
| | | | | | leading/trailing bits. Patch by Alastair Lynn! llvm-svn: 92706
* this inline function moved to addsubChris Lattner2010-01-051-24/+0
| | | | llvm-svn: 92705
* split add/sub out to its own file. Eliminate use ofChris Lattner2010-01-053-695/+749
| | | | | | | dyn_castNotVal in the X+~X transform. dyn_castNotVal is dramatic overkill for what the xform needed. llvm-svn: 92704
* all the places we use hasOneUse() we know are instructions, so inlineChris Lattner2010-01-051-12/+9
| | | | | | and simplify. llvm-svn: 92700
OpenPOWER on IntegriCloud