summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Fix a typo and an 80-column violation in comments.Dan Gohman2010-01-191-3/+3
| | | | llvm-svn: 93931
* Give ScalarEvolution access to the DominatorTree. It'll need thisDan Gohman2010-01-191-0/+2
| | | | | | to make more intellegent AddRec folding decisions. llvm-svn: 93930
* 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. llvm-svn: 93921
* Make findDbgDeclare/findDbgGlobalDeclare local static functions; avoid Elts ↵Victor Hernandez2010-01-181-6/+7
| | | | | | array llvm-svn: 93764
* 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. llvm-svn: 93632
* Replace DebugLocTuple with DILocation.Devang Patel2010-01-161-12/+4
| | | | llvm-svn: 93630
* 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. llvm-svn: 93531
* Revert r93504 because older uses of llvm.dbg.declare intrinsics need to be ↵Victor Hernandez2010-01-151-22/+29
| | | | | | auto-upgraded llvm-svn: 93515
* 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. llvm-svn: 93504
* Pad my commit stats by reducing indentation in this now separateEric Christopher2010-01-141-19/+20
| | | | | | commit. llvm-svn: 93473
* Few minor changes that were requested. No functional change.Eric Christopher2010-01-141-2/+6
| | | | llvm-svn: 93462
* Small tweak to inline cost computation. Ext of i/fcmp results are mostly ↵Evan Cheng2010-01-141-1/+6
| | | | | | optimized away in codegen. llvm-svn: 93453
* Reduce the inlining cost of functions that contain calls to easily,Eric Christopher2010-01-141-1/+27
| | | | | | and frequently optimized functions. llvm-svn: 93448
* Respond to Chris' review:Victor Hernandez2010-01-111-8/+8
| | | | | | | Make InsertDbgValueIntrinsic() and get Offset take and recieve a uint64_t. Get constness correct for getVariable() and getValue(). llvm-svn: 93149
* "In order to ease automatic bindings generation, it would be helpful if ↵Chris Lattner2010-01-091-4/+4
| | | | | | | | boolean values were distinguishable from integers. The attached patch introduces "typedef int LLVMBool;", and uses LLVMBool instead of int throughout the C API, wherever a boolean value is called for." Patch by James Y Knight! llvm-svn: 93079
* Use WriteAsOperand instead of getName() to print loop header names,Dan Gohman2010-01-092-8/+19
| | | | | | so that unnamed blocks are handled. llvm-svn: 93059
* fix PR5978 by peeling the loop so that we avoid shifting theChris Lattner2010-01-081-2/+2
| | | | | | | result int by 8 for the first byte. While normally harmless, if the result is smaller than a byte, this shift is invalid. llvm-svn: 93018
* teach ComputeNumSignBits to look through PHI nodes.Chris Lattner2010-01-071-4/+19
| | | | llvm-svn: 92964
* Partially address a README by having functionattrs consider calls toDuncan Sands2010-01-061-4/+7
| | | | | | | | | | 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
OpenPOWER on IntegriCloud