summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis
Commit message (Collapse)AuthorAgeFilesLines
* There are two ways of checking for a given type, for example isa<PointerType>(T)Duncan Sands2010-02-1613-84/+84
| | | | | | | and T->isPointerTy(). Convert most instances of the first form to the second form. Requested by Chris. llvm-svn: 96344
* When reusing an existing PHI node in a loop, be even moreDan Gohman2010-02-161-11/+39
| | | | | | strict about the requirements. llvm-svn: 96301
* Uniformize the names of type predicates: rather than having isFloatTy andDuncan Sands2010-02-154-35/+35
| | | | | | isInteger, we now have isFloatTy and isIntegerTy. Requested by Chris! llvm-svn: 96223
* When testing whether a given SCEV depends on a temporary symbolicDan Gohman2010-02-151-1/+1
| | | | | | | | name, test whether the SCEV itself is that temporary symbolic name, in addition to checking whether the symbolic name appears as a possibly-indirect operand. llvm-svn: 96216
* When restoring a saved insert location, check to see if the savedDan Gohman2010-02-151-4/+12
| | | | | | | insert location has become an "inserted" instruction since the time it was saved. If so, advance to the first non-"inserted" instruction. llvm-svn: 96203
* In rememberInstruction, if the value being remembered is theDan Gohman2010-02-141-0/+14
| | | | | | | | | current insertion point, advance the current insertion point. This avoids a use-before-def situation in a testcase extracted from clang which is difficult to reduce to a reasonable-sized regression test. llvm-svn: 96151
* Simplify this code; no need for a custom subclass if it doesn't needDan Gohman2010-02-141-8/+3
| | | | | | to override anything from the parent class. llvm-svn: 96150
* Override dominates and properlyDominates for SCEVAddRecExpr, as aDan Gohman2010-02-131-0/+15
| | | | | | | SCEVAddRecExpr doesn't necessarily dominate blocks merely dominated by all of its operands. This fixes an abort compiling 403.gcc. llvm-svn: 96056
* Fix a case of mismatched types in an Add that turned up in 447.dealII.Dan Gohman2010-02-121-0/+2
| | | | llvm-svn: 96007
* Reapply the new LoopStrengthReduction code, with compile time andDan Gohman2010-02-122-125/+90
| | | | | | | | | | bug fixes, and with improved heuristics for analyzing foreign-loop addrecs. This change also flattens IVUsers, eliminating the stride-oriented groupings, which makes it easier to work with. llvm-svn: 95975
* Use an AssemblyAnnotatorWriter to clean up IVUsers' debug output.Dan Gohman2010-02-101-1/+10
| | | | | | The "uses=" comments are just clutter in this context. llvm-svn: 95799
* Fix "the the" and similar typos.Dan Gohman2010-02-104-5/+5
| | | | llvm-svn: 95781
* Add const qualifiers.Dan Gohman2010-02-081-2/+2
| | | | llvm-svn: 95582
* Set DW_AT_artificial only if argument is marked as artificial.Devang Patel2010-02-061-0/+23
| | | | llvm-svn: 95461
* Update CodeMetrics to count 'big' function calls explicitly.Jakob Stoklund Olesen2010-02-051-5/+9
| | | | llvm-svn: 95453
* 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. llvm-svn: 95281
* Provide interface to identifiy artificial methods.Devang Patel2010-02-031-5/+8
| | | | llvm-svn: 95240
* Various code simplifications.Dan Gohman2010-02-021-31/+28
| | | | llvm-svn: 95044
* Add "dump" method to IVUsersOneStride.Bill Wendling2010-02-011-0/+23
| | | | llvm-svn: 95022
* 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. llvm-svn: 94987
* 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. llvm-svn: 94820
* It looks like the changes to the SRem logic of SimplifyDemandedUseBitsDuncan Sands2010-01-291-8/+17
| | | | | | (fix for PR6165) are needed here too. llvm-svn: 94801
* Check Type::isSized before calling ScalarEvolution::getAllocSizeExpr,Dan Gohman2010-01-281-21/+23
| | | | | | rather than after. llvm-svn: 94742
* 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. llvm-svn: 94737
* 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. llvm-svn: 94615
* 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. llvm-svn: 94591
* 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. llvm-svn: 94590
* 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. llvm-svn: 94589
* 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. llvm-svn: 94586
* Make the unsigned-range code more consistent with the signed-range code,Dan Gohman2010-01-261-25/+29
| | | | | | and clean up some loose ends. llvm-svn: 94572
* Fix a typo in a comment that Duncan noticed.Dan Gohman2010-01-261-1/+1
| | | | llvm-svn: 94562
* Rename ItCount to BECount, since it holds a backedge-taken count ratherDan Gohman2010-01-261-9/+9
| | | | | | than an iteration count. llvm-svn: 94549
* 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. llvm-svn: 94512
* Assert when debug intrinsic insert functions are passed empty argumentsVictor Hernandez2010-01-261-0/+6
| | | | llvm-svn: 94491
* make -fno-rtti the default unless a directory builds with REQUIRES_RTTI.Chris Lattner2010-01-242-2/+0
| | | | llvm-svn: 94378
* Avoid using "Type" as the variable name.Devang Patel2010-01-231-11/+12
| | | | llvm-svn: 94262
* Make sure ValueFn starts off emptyVictor Hernandez2010-01-231-1/+1
| | | | llvm-svn: 94256
* 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. llvm-svn: 94164
* drop the pass name from the output.Chris Lattner2010-01-221-3/+1
| | | | llvm-svn: 94158
* eliminate dynamic_cast from this file.Chris Lattner2010-01-221-17/+20
| | | | llvm-svn: 94157
* eliminate a bunch more unneeded dynamic_cast's.Chris Lattner2010-01-222-35/+27
| | | | llvm-svn: 94156
* eliminate a bunch of dynamic_cast's.Chris Lattner2010-01-221-0/+3
| | | | llvm-svn: 94155
* 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. llvm-svn: 94070
* 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. llvm-svn: 94061
* adopt getAdjustedAnalysisPointer in a few more passes.Chris Lattner2010-01-206-0/+64
| | | | llvm-svn: 94018
* adopt getAdjustedAnalysisPointer in two more passes.Chris Lattner2010-01-202-0/+20
| | | | llvm-svn: 94017
* adopt getAdjustedAnalysisPointer in BasicCallGraph.Chris Lattner2010-01-201-1/+11
| | | | llvm-svn: 94015
* add some new methods to adjust this pointers. Not used yet.Chris Lattner2010-01-201-0/+20
| | | | llvm-svn: 94013
* Avoid unnecessary Elts arrayVictor Hernandez2010-01-201-4/+2
| | | | llvm-svn: 93978
* Add a comment and tidy up some whitespace.Dan Gohman2010-01-191-2/+2
| | | | llvm-svn: 93932
OpenPOWER on IntegriCloud