summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis
Commit message (Collapse)AuthorAgeFilesLines
* Canonicalize ConstantInts to the right operand of commutativeDan Gohman2010-02-221-2/+2
| | | | | | | | | | operators. The test difference is just due to the multiplication operands being commuted (and thus requiring a more elaborate match). In optimized code, that expression would be folded. llvm-svn: 96816
* Minor formatting cleanup.Dan Gohman2010-02-221-2/+1
| | | | llvm-svn: 96808
* Remove unused variables and parameters.Dan Gohman2010-02-222-6/+4
| | | | llvm-svn: 96780
* Constant-fold certain comparisons with infinity and negative infinity.Dan Gohman2010-02-221-0/+26
| | | | llvm-svn: 96777
* Add a comment.Dan Gohman2010-02-191-0/+6
| | | | llvm-svn: 96688
* Teach ScalarEvolution how to compute a tripcount for a loop withDan Gohman2010-02-191-0/+13
| | | | | | | | true or false as its exit condition. These are usually eliminated by SimplifyCFG, but the may be left around during a pass which wishes to preserve the CFG. llvm-svn: 96683
* recommit 96626, evidence that it broke things appearsDale Johannesen2010-02-191-0/+29
| | | | | | to be spurious llvm-svn: 96662
* Revert 96626, which causes build failure on ppc Darwin.Dale Johannesen2010-02-191-29/+0
| | | | llvm-svn: 96653
* Indvars needs to explicitly notify ScalarEvolution when it is replacingDan Gohman2010-02-181-0/+29
| | | | | | | | a loop exit value, so that if a loop gets deleted, ScalarEvolution isn't stick holding on to dangling SCEVAddRecExprs for that loop. This fixes PR6339. llvm-svn: 96626
* Fix SCEVExpander's existing PHI reuse checking to recognize theDan Gohman2010-02-171-0/+13
| | | | | | | | case where there are loop-invariant instructions somehow left inside the loop, and in a position where they won't dominate the IV increment position. llvm-svn: 96448
* Fold bswap(undef) to undef.Dan Gohman2010-02-171-0/+6
| | | | llvm-svn: 96432
* Use line and column number to distinguish two lexical blocks at the same level.Devang Patel2010-02-161-3/+6
| | | | llvm-svn: 96395
* Split critical edges as needed for load PRE.Bob Wilson2010-02-161-0/+7
| | | | llvm-svn: 96378
* 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
OpenPOWER on IntegriCloud