summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis
Commit message (Collapse)AuthorAgeFilesLines
* Unbreak CMake build.Ted Kremenek2011-03-011-5/+4
| | | | llvm-svn: 126717
* Delete the LiveValues pass. I won't get get back to the project itDan Gohman2011-02-282-201/+0
| | | | | | was started for in the foreseeable future. llvm-svn: 126668
* Fix comment.Nick Lewycky2011-02-281-1/+1
| | | | llvm-svn: 126645
* srem doesn't actually have the same resulting sign as its numerator, you couldNick Lewycky2011-02-281-12/+0
| | | | | | | also have a zero when numerator = denominator. Reverts parts of r126635 and r126637. llvm-svn: 126644
* Teach value tracking to make use of flags in more situations.Nick Lewycky2011-02-281-0/+25
| | | | llvm-svn: 126642
* Teach ValueTracking to look at the dividend when determining the sign bit of anNick Lewycky2011-02-281-0/+12
| | | | | | srem instruction. llvm-svn: 126637
* RegionPrinter: Ignore back edges when layouting the graphTobias Grosser2011-02-271-0/+26
| | | | llvm-svn: 126564
* Follow LLVM coding style. Devang Patel2011-02-221-77/+77
| | | | | | clang uses DBuilder, so it requries corresponding change. llvm-svn: 126231
* Move "A | ~(A & ?) -> -1" from InstCombine to InstructionSimplify.Benjamin Kramer2011-02-201-0/+10
| | | | llvm-svn: 126082
* Stores of null pointers should turn into memset, we weren't recognizingChris Lattner2011-02-191-0/+5
| | | | | | them as splat values. llvm-svn: 126041
* Move library stuff out of the toplevel CMakeLists.txt file.Oscar Fuentes2011-02-181-0/+2
| | | | llvm-svn: 125968
* Move DbgInfoPrinter specific utlities inside DbgInfoPrinter.cppDevang Patel2011-02-152-111/+112
| | | | llvm-svn: 125571
* Print function info. Patch by Minjang Kim.Devang Patel2011-02-152-2/+34
| | | | llvm-svn: 125567
* convert ConstantVector::get to use ArrayRef.Chris Lattner2011-02-151-2/+2
| | | | llvm-svn: 125537
* revert my ConstantVector patch, it seems to have made the llvm-gccChris Lattner2011-02-141-2/+2
| | | | | | builders unhappy. llvm-svn: 125504
* Switch ConstantVector::get to use ArrayRef instead of a pointer+sizeChris Lattner2011-02-141-2/+2
| | | | | | idiom. Change various clients to simplify their code. llvm-svn: 125487
* Remove pointless blank line.Duncan Sands2011-02-131-1/+0
| | | | llvm-svn: 125463
* Teach instsimplify that X+Y>=X+Z is the same as Y>=Z if neither side overflows,Duncan Sands2011-02-131-2/+49
| | | | | | | | plus some variations of this. According to my auto-simplifier this occurs a lot but usually in combination with max/min idioms. Because max/min aren't handled yet this unfortunately doesn't have much effect in the testsuite. llvm-svn: 125462
* teach SCEV that the scale and addition of an inbounds gep don't NSW.Chris Lattner2011-02-131-2/+5
| | | | | | | This fixes a FIXME in scev-aa.ll (allowing a new no-alias result) and generally makes things more precise. llvm-svn: 125449
* Per discussion with Dan G, inbounds geps *certainly* can haveChris Lattner2011-02-111-3/+14
| | | | | | | | | | | unsigned overflow (e.g. "gep P, -1"), and while they can have signed wrap in theoretical situations, modelling an AddRec as not having signed wrap is going enough for any case we can think of today. In the future if this isn't enough, we can revisit this. Modeling them as having NUW isn't causing any known problems either FWIW. llvm-svn: 125410
* Tolerate degenerate phi nodes that can occur in the middle of optimizationNick Lewycky2011-02-101-0/+4
| | | | | | passes. Fixes PR9112. Patch by Jakub Staszak! llvm-svn: 125319
* Formatting and comment tweaks.Duncan Sands2011-02-091-5/+5
| | | | llvm-svn: 125200
* Teach instsimplify some tricks about exact/nuw/nsw shifts.Chris Lattner2011-02-091-39/+69
| | | | | | improve interfaces to instsimplify to take this info. llvm-svn: 125196
* Rework InstrTypes.h so to reduce the repetition around the NSW/NUW/ExactChris Lattner2011-02-091-2/+2
| | | | | | | | | | | | | | | | | versions of creation functions. Eventually, the "insertion point" versions of these should just be removed, we do have IRBuilder afterall. Do a massive rewrite of much of pattern match. It is now shorter and less redundant and has several other widgets I will be using in other patches. Among other changes, m_Div is renamed to m_IDiv (since it only matches integer divides) and m_Shift is gone (it used to match all binops!!) and we now have m_LogicalShift for the one client to use. Enhance IRBuilder to have "isExact" arguments to things like CreateUDiv and reduce redundancy within IRbuilder by having these methods chain to each other more instead of duplicating code. llvm-svn: 125194
* Add an m_Div pattern for matching either a udiv or an sdiv and use itDuncan Sands2011-02-071-4/+2
| | | | | | to simplify the "(X/Y)*Y->X when the division is exact" transform. llvm-svn: 125004
* teach instsimplify to transform (X / Y) * Y to XChris Lattner2011-02-061-3/+5
| | | | | | when the div is an exact udiv. llvm-svn: 124994
* Remove premature optimization that avoided calculating argument weightsEric Christopher2011-02-061-5/+0
| | | | | | | | | if we weren't going to inline the function. The rest of the code using this was removed. Fixes PR9154. llvm-svn: 124991
* Simplify test, as suggested by Chris.Anders Carlsson2011-02-061-6/+2
| | | | llvm-svn: 124990
* When loading from a constant, fold inttoptr if the integer type and the ↵Anders Carlsson2011-02-061-0/+11
| | | | | | resulting pointer type both have the same size. llvm-svn: 124987
* Fix another warning.Anders Carlsson2011-02-051-1/+1
| | | | llvm-svn: 124961
* Fix cut and paste error spotted by Jakob.Eric Christopher2011-02-051-1/+1
| | | | llvm-svn: 124930
* Rewrite how the indirect call bonus is handled. This now works by:Eric Christopher2011-02-051-78/+125
| | | | | | | | | | | | | | | | | a) Making it a per call site bonus for functions that we can move from indirect to direct calls. b) Reduces the bonus from 500 to 100 per call site. c) Subtracts the size of the possible newly inlineable call from the bonus to only add a bonus if we can inline a small function to devirtualize it. Also changes the bonus from a positive that's subtracted to a negative that's added. Fixes the remainder of rdar://8546196 by reducing the object file size after inlining by 84%. llvm-svn: 124916
* Improve threading of comparisons over select instructions (spotted by myDuncan Sands2011-02-031-3/+25
| | | | | | | | | | auto-simplifier). This has a big impact on Ada code, but not much else. Unfortunately the impact is mostly negative! This is due to PR9004 (aka SCCP failing to resolve conditional branch conditions in the destination blocks of the branch), in which simple correlated expressions are not resolved but complicated ones are, so simplifying has a bad effect! llvm-svn: 124788
* Fix typo in comment.Devang Patel2011-02-031-1/+1
| | | | llvm-svn: 124759
* Add support to describe template value parameter in debug info.Devang Patel2011-02-022-0/+27
| | | | llvm-svn: 124755
* Add support to describe template parameter type in debug info.Devang Patel2011-02-022-2/+28
| | | | llvm-svn: 124752
* Reenable the transform "(X*Y)/Y->X" when the multiplication is known not toDuncan Sands2011-02-021-5/+5
| | | | | | | | overflow (nsw flag), which was disabled because it breaks 254.gap. I have informed the GAP authors of the mistake in their code, and arranged for the testsuite to use -fwrapv when compiling this benchmark. llvm-svn: 124746
* Add a m_Undef pattern for convenience. This is so that code that usesDuncan Sands2011-02-011-16/+16
| | | | | | | pattern matching can also pattern match undef, creating a more uniform style. llvm-svn: 124657
* Add a m_SignBit pattern for convenience.Duncan Sands2011-02-011-3/+1
| | | | llvm-svn: 124656
* Have m_One also match constant vectors for which every element is 1.Duncan Sands2011-02-011-6/+0
| | | | llvm-svn: 124655
* Reapply 124275 since the Dragonegg failure was unreproducible.Eric Christopher2011-02-011-82/+85
| | | | llvm-svn: 124641
* Commit 124487 broke 254.gap. See if disabling the part that might be triggeredDuncan Sands2011-01-301-5/+5
| | | | | | by PR9088 fixes things. llvm-svn: 124561
* Transform (X/Y)*Y into X if the division is exact. Instcombine already ↵Duncan Sands2011-01-301-0/+9
| | | | | | | | | | | | knows how to do this and more, but would only do it if X/Y had only one use. Spotted as the most common missed simplification in SPEC by my auto-simplifier, now that it knows about nuw/nsw/exact flags. This removes a bunch of multiplications from 447.dealII and 483.xalancbmk. It also removes a lot from tramp3d-v4, which results in much more inlining. llvm-svn: 124560
* Fix comment.Nick Lewycky2011-01-291-1/+1
| | | | llvm-svn: 124544
* Move InstCombine's knowledge of fdiv to SimplifyInstruction().Frits van Bommel2011-01-291-2/+24
| | | | llvm-svn: 124534
* Fix typo: should have been testing that X was odd, not V.Duncan Sands2011-01-291-3/+3
| | | | llvm-svn: 124533
* Implementation of path profiling.Andrew Trick2011-01-295-3/+1176
| | | | | | | | | | Modified patch by Adam Preuss. This builds on the existing framework for block tracing, edge profiling and optimal edge profiling. See -help-hidden for new flags. For documentation, see the technical report "Implementation of Path Profiling..." in llvm.org/pubs. llvm-svn: 124515
* This dyn_cast should be a cast. Pointed out by Frits van Bommel.Duncan Sands2011-01-281-1/+1
| | | | llvm-svn: 124497
* Thread divisions over selects and phis. This doesn't fire much and has ↵Duncan Sands2011-01-281-9/+19
| | | | | | | | basically zero effect on the testsuite (it improves two Ada testcases). llvm-svn: 124496
* My auto-simplifier noticed that ((X/Y)*Y)/Y occurs several times in SPECDuncan Sands2011-01-281-0/+107
| | | | | | | | | | | | | | | | | benchmarks, and that it can be simplified to X/Y. (In general you can only simplify (Z*Y)/Y to Z if the multiplication did not overflow; if Z has the form "X/Y" then this is the case). This patch implements that transform and moves some Div logic out of instcombine and into InstructionSimplify. Unfortunately instcombine gets in the way somewhat, since it likes to change (X/Y)*Y into X-(X rem Y), so I had to teach instcombine about this too. Finally, thanks to the NSW/NUW flags, sometimes we know directly that "Z*Y" does not overflow, because the flag says so, so I added that logic too. This eliminates a bunch of divisions and subtractions in 447.dealII, and has good effects on some other benchmarks too. It seems to have quite an effect on tramp3d-v4 but it's hard to say if it's good or bad because inlining decisions changed, resulting in massive changes all over. llvm-svn: 124487
OpenPOWER on IntegriCloud