aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Analysis
Commit message (Collapse)AuthorAgeFilesLines
* Use an AssemblyAnnotatorWriter to clean up IVUsers' debug output.Dan Gohman2010-02-101-1/+10
| | | | | | | The "uses=" comments are just clutter in this context. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95799 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix "the the" and similar typos.Dan Gohman2010-02-104-5/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95781 91177308-0d34-0410-b5e6-96231b3b80d8
* Add const qualifiers.Dan Gohman2010-02-081-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95582 91177308-0d34-0410-b5e6-96231b3b80d8
* Set DW_AT_artificial only if argument is marked as artificial.Devang Patel2010-02-061-0/+23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95461 91177308-0d34-0410-b5e6-96231b3b80d8
* Update CodeMetrics to count 'big' function calls explicitly.Jakob Stoklund Olesen2010-02-051-5/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95453 91177308-0d34-0410-b5e6-96231b3b80d8
* Change the argument to getIntegerSCEV to be an int64_t, ratherDan Gohman2010-02-041-1/+1
| | | | | | | | than int. This will make it more convenient for LSR, which does a lot of things with int64_t offsets. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95281 91177308-0d34-0410-b5e6-96231b3b80d8
* Provide interface to identifiy artificial methods.Devang Patel2010-02-031-5/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95240 91177308-0d34-0410-b5e6-96231b3b80d8
* Various code simplifications.Dan Gohman2010-02-021-31/+28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95044 91177308-0d34-0410-b5e6-96231b3b80d8
* Add "dump" method to IVUsersOneStride.Bill Wendling2010-02-011-0/+23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95022 91177308-0d34-0410-b5e6-96231b3b80d8
* Generalize target-independent folding rules for sizeof to handle moreDan Gohman2010-02-013-40/+98
| | | | | | | | | | | | | | | | | | | | cases, and implement target-independent folding rules for alignof and offsetof. Also, reassociate reassociative operators when it leads to more folding. Generalize ScalarEvolution's isOffsetOf to recognize offsetof on arrays. Rename getAllocSizeExpr to getSizeOfExpr, and getFieldOffsetExpr to getOffsetOfExpr, for consistency with analagous ConstantExpr routines. Make the target-dependent folder promote GEP array indices to pointer-sized integers, to make implicit casting explicit and exposed to subsequent folding. And add a bunch of testcases for this new functionality, and a bunch of related existing functionality. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94987 91177308-0d34-0410-b5e6-96231b3b80d8
* Before inserting llvm.dbg.declare intrinsic at the end of a basic block, ↵Devang Patel2010-01-291-2/+7
| | | | | | | | | check whether the basic block has a terminator or not. This API is used by clang and the test case is test/CodeGen/debug-info-crash.c in clang module. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94820 91177308-0d34-0410-b5e6-96231b3b80d8
* It looks like the changes to the SRem logic of SimplifyDemandedUseBitsDuncan Sands2010-01-291-8/+17
| | | | | | | (fix for PR6165) are needed here too. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94801 91177308-0d34-0410-b5e6-96231b3b80d8
* Check Type::isSized before calling ScalarEvolution::getAllocSizeExpr,Dan Gohman2010-01-281-21/+23
| | | | | | | rather than after. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94742 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove SCEVAllocSizeExpr and SCEVFieldOffsetExpr, and in their placeDan Gohman2010-01-282-105/+100
| | | | | | | | | | | | | | | | | use plain SCEVUnknowns with ConstantExpr::getSizeOf and ConstantExpr::getOffsetOf constants. This eliminates a bunch of special-case code. Also add code for pattern-matching these expressions, for clients that want to recognize them. Move ScalarEvolution's logic for expanding array and vector sizeof expressions into an element count times the element size, to expose the multiplication to subsequent folding, into the regular constant folder. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94737 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix inline cost predictions with SCIENCE.Jakob Stoklund Olesen2010-01-261-28/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | After running a batch of measurements, it is clear that the inliner metrics need some adjustments: Own argument bonus: 20 -> 5 Outgoing argument penalty: 0 -> 5 Alloca bonus: 10 -> 5 Constant instr bonus: 7 -> 5 Dead successor bonus: 40 -> 5*(avg instrs/block) The new cost metrics are generaly 25 points higher than before, so we may need to move thresholds. With this change, InlineConstants::CallPenalty becomes a political correction: if (!isa<IntrinsicInst>(II) && !callIsSmall(CS.getCalledFunction())) NumInsts += InlineConstants::CallPenalty + CS.arg_size(); The code size is accurately modelled by CS.arg_size(). CallPenalty is added because calls tend to take a long time, so it may not be worth it to inline a function with lots of calls. All of the political corrections are in the InlineConstants namespace: IndirectCallBonus, CallPenalty, LastCallToStaticBonus, ColdccPenalty, NoreturnPenalty. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94615 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert test polarity to match comment and desired outcome. Remove undeserved ↵Jakob Stoklund Olesen2010-01-261-2/+2
| | | | | | | | | | | | | | bonus. A GEP with all constant indices is already considered free by analyzeBasicBlock(), so don't give it an extra bonus in CountCodeReductionForAlloca(). This patch should remove a small positive bias toward inlining functions with variable-index GEPs, and remove a smaller negative bias from functions with all-constant index GEPs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94591 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove dead code.Jakob Stoklund Olesen2010-01-261-3/+0
| | | | | | | | | | Functions containing indirectbr are marked NeverInline by analyzeBasicBlock(), so there is no point in giving indirectbr special treatment in CountCodeReductionForConstant. It is never called. No functional change intended. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94590 91177308-0d34-0410-b5e6-96231b3b80d8
* Skip calculation of ArgumentWeights if it will never be used.Jakob Stoklund Olesen2010-01-261-0/+6
| | | | | | | | Save a few bytes by allocating the correct size vector. No functional change intended. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94589 91177308-0d34-0410-b5e6-96231b3b80d8
* Add extra element to composite type. This new element will be used to record ↵Devang Patel2010-01-261-3/+5
| | | | | | c++ class that holds current class's vtable. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94586 91177308-0d34-0410-b5e6-96231b3b80d8
* Make the unsigned-range code more consistent with the signed-range code,Dan Gohman2010-01-261-25/+29
| | | | | | | and clean up some loose ends. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94572 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a typo in a comment that Duncan noticed.Dan Gohman2010-01-261-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94562 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename ItCount to BECount, since it holds a backedge-taken count ratherDan Gohman2010-01-261-9/+9
| | | | | | | than an iteration count. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94549 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the the ceiling-division used in computing the MaxBECount so that it doesn'tDan Gohman2010-01-261-51/+72
| | | | | | | | | | | | | | have trouble with an intermediate add overflowing. Also, be more conservative about the case where the induction variable in an SLT loop exit can step past the RHS of the SLT and overflow in a single step. Make getSignedRange more aggressive, to recover for some common cases which the above fixes pessimized. This addresses rdar://7561161. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94512 91177308-0d34-0410-b5e6-96231b3b80d8
* Assert when debug intrinsic insert functions are passed empty argumentsVictor Hernandez2010-01-261-0/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94491 91177308-0d34-0410-b5e6-96231b3b80d8
* make -fno-rtti the default unless a directory builds with REQUIRES_RTTI.Chris Lattner2010-01-242-2/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94378 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid using "Type" as the variable name.Devang Patel2010-01-231-11/+12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94262 91177308-0d34-0410-b5e6-96231b3b80d8
* Make sure ValueFn starts off emptyVictor Hernandez2010-01-231-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94256 91177308-0d34-0410-b5e6-96231b3b80d8
* Stop building RTTI information for *most* llvm libraries. NotableChris Lattner2010-01-222-0/+3
| | | | | | | | | | | | | missing ones are libsupport, libsystem and libvmcore. libvmcore is currently blocked on bugpoint, which uses EH. Once it stops using EH, we can switch it off. This #if 0's out 3 unit tests, because gtest requires RTTI information. Suggestions welcome on how to fix this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94164 91177308-0d34-0410-b5e6-96231b3b80d8
* drop the pass name from the output.Chris Lattner2010-01-221-3/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94158 91177308-0d34-0410-b5e6-96231b3b80d8
* eliminate dynamic_cast from this file.Chris Lattner2010-01-221-17/+20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94157 91177308-0d34-0410-b5e6-96231b3b80d8
* eliminate a bunch more unneeded dynamic_cast's.Chris Lattner2010-01-222-35/+27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94156 91177308-0d34-0410-b5e6-96231b3b80d8
* eliminate a bunch of dynamic_cast's.Chris Lattner2010-01-221-0/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94155 91177308-0d34-0410-b5e6-96231b3b80d8
* When re-using an existing cast for a user, it's still necessary to callDan Gohman2010-01-211-1/+3
| | | | | | | | rememberInstruction so that future users of that user will be inserted in the correct position. This fixes the Darwin selfhost. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94070 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-implement the main strength-reduction portion of LoopStrengthReduction.Dan Gohman2010-01-213-81/+359
| | | | | | | | | | | | | | | This new version is much more aggressive about doing "full" reduction in cases where it reduces register pressure, and also more aggressive about rewriting induction variables to count down (or up) to zero when doing so reduces register pressure. It currently uses fairly simplistic algorithms for finding reuse opportunities, but it introduces a new framework allows it to combine multiple strategies at once to form hybrid solutions, instead of doing all full-reduction or all base+index. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94061 91177308-0d34-0410-b5e6-96231b3b80d8
* adopt getAdjustedAnalysisPointer in a few more passes.Chris Lattner2010-01-206-0/+64
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94018 91177308-0d34-0410-b5e6-96231b3b80d8
* adopt getAdjustedAnalysisPointer in two more passes.Chris Lattner2010-01-202-0/+20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94017 91177308-0d34-0410-b5e6-96231b3b80d8
* adopt getAdjustedAnalysisPointer in BasicCallGraph.Chris Lattner2010-01-201-1/+11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94015 91177308-0d34-0410-b5e6-96231b3b80d8
* add some new methods to adjust this pointers. Not used yet.Chris Lattner2010-01-201-0/+20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94013 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid unnecessary Elts arrayVictor Hernandez2010-01-201-4/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93978 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a comment and tidy up some whitespace.Dan Gohman2010-01-191-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93932 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a typo and an 80-column violation in comments.Dan Gohman2010-01-191-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93931 91177308-0d34-0410-b5e6-96231b3b80d8
* Give ScalarEvolution access to the DominatorTree. It'll need thisDan Gohman2010-01-191-0/+2
| | | | | | | to make more intellegent AddRec folding decisions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93930 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a new helper function to IVUsers for returning the "canonical"Dan Gohman2010-01-191-0/+13
| | | | | | | | | form of an expression. This is the expression without the post-increment adjustment made, which is useful in determining which registers will be used by the expansion. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93921 91177308-0d34-0410-b5e6-96231b3b80d8
* Make findDbgDeclare/findDbgGlobalDeclare local static functions; avoid Elts ↵Victor Hernandez2010-01-181-6/+7
| | | | | | array git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93764 91177308-0d34-0410-b5e6-96231b3b80d8
* Create Generic DOTGraphTraits Printer/ViewerTobias Grosser2010-01-161-56/+18
| | | | | | | | Move the DOTGraphTraits dotty printer/viewer templates, that were developed for the dominance tree into their own header file. This will allow reuse in future passes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93632 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace DebugLocTuple with DILocation.Devang Patel2010-01-161-12/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93630 91177308-0d34-0410-b5e6-96231b3b80d8
* Improve llvm.dbg.declare intrinsic by referring directly to the storage in ↵Victor Hernandez2010-01-151-29/+22
| | | | | | | | | | | its first argument, via function-local metadata (instead of via a bitcast). This patch also cleans up code that expects there to be a bitcast in the first argument and testcases that call llvm.dbg.declare. It also strips old llvm.dbg.declare intrinsics that did not pass metadata as the first argument. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93531 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r93504 because older uses of llvm.dbg.declare intrinsics need to be ↵Victor Hernandez2010-01-151-22/+29
| | | | | | auto-upgraded git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93515 91177308-0d34-0410-b5e6-96231b3b80d8
* Improve llvm.dbg.declare intrinsic by referring directly to the storage in ↵Victor Hernandez2010-01-151-29/+22
| | | | | | | | | | its first argument, via function-local metadata (instead of via a bitcast). This patch also cleans up code that expects there to be a bitcast in the first argument and testcases that call llvm.dbg.declare. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93504 91177308-0d34-0410-b5e6-96231b3b80d8
* Pad my commit stats by reducing indentation in this now separateEric Christopher2010-01-141-19/+20
| | | | | | | commit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93473 91177308-0d34-0410-b5e6-96231b3b80d8