summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis
Commit message (Collapse)AuthorAgeFilesLines
* stub out some LazyValueInfo interfaces, and have JumpThreadingChris Lattner2009-11-111-1/+116
| | | | | | | | start using them in a trivial way when -enable-jump-threading-lvi is passed. enable-jump-threading-lvi will be my playground for awhile. llvm-svn: 86789
* Stub out a new lazy value info pass, which will eventuallyChris Lattner2009-11-112-0/+32
| | | | | | vend value constraint information to the optimizer. llvm-svn: 86767
* remove redundant foward declaration. This function is already in Chris Lattner2009-11-111-1/+3
| | | | | | Analysis/Passes.h llvm-svn: 86765
* Implement support to debug inlined functions.Devang Patel2009-11-101-18/+0
| | | | llvm-svn: 86748
* move some generally useful functions out of jump threadingChris Lattner2009-11-101-0/+35
| | | | | | into libanalysis and transformutils. llvm-svn: 86735
* Process InlinedAt location info.Devang Patel2009-11-101-16/+21
| | | | | | Update InsertDeclare to return newly inserted llvm.dbg.declare intrinsic. llvm-svn: 86727
* Update computeArraySize() to use ComputeMultiple() to determine the array ↵Victor Hernandez2009-11-101-90/+19
| | | | | | size associated with a malloc; also extend PerformHeapAllocSRoA() to check if the optimized malloc's arg had its highest bit set, so that it is safe for ComputeMultiple() to look through sext instructions while determining the optimized malloc's array size llvm-svn: 86676
* Add ComputeMultiple() analysis function that recursively determines if a ↵Victor Hernandez2009-11-101-0/+125
| | | | | | Value V is a multiple of unsigned Base llvm-svn: 86675
* I misread the parens, not so redundant after all.Chris Lattner2009-11-101-4/+4
| | | | llvm-svn: 86648
* remove some redundant parens.Chris Lattner2009-11-101-4/+4
| | | | llvm-svn: 86645
* add a new SimplifyInstruction API, which is like ConstantFoldInstruction, Chris Lattner2009-11-101-0/+20
| | | | | | | | except that the result may not be a constant. Switch jump threading to use it so that it gets things like (X & 0) -> 0, which occur when phi preds are deleted and the remaining phi pred was a zero. llvm-svn: 86637
* Fix DenseMap iterator constness.Jeffrey Yasskin2009-11-101-3/+3
| | | | | | | | | | | | | | | | | | | This patch forbids implicit conversion of DenseMap::const_iterator to DenseMap::iterator which was possible because DenseMapIterator inherited (publicly) from DenseMapConstIterator. Conversion the other way around is now allowed as one may expect. The template DenseMapConstIterator is removed and the template parameter IsConst which specifies whether the iterator is constant is added to DenseMapIterator. Actually IsConst parameter is not necessary since the constness can be determined from KeyT but this is not relevant to the fix and can be addressed later. Patch by Victor Zverovich! llvm-svn: 86636
* factor simplification logic for AND and OR out to InstSimplify from instcombine.Chris Lattner2009-11-101-24/+149
| | | | llvm-svn: 86635
* pull a bunch of logic out of instcombine into instsimplify for compare Chris Lattner2009-11-091-5/+93
| | | | | | simplification, this handles the foldable fcmp x,x cases among many others. llvm-svn: 86627
* Pass the (optional) TargetData object to ConstantFoldInstOperandsDan Gohman2009-11-091-9/+10
| | | | | | and ConstantFoldCompareInstOperands. llvm-svn: 86626
* rename SimplifyCompare -> SimplifyCmpInst and split it into Chris Lattner2009-11-091-10/+35
| | | | | | | Simplify[IF]Cmp pieces. Add some predicates to CmpInst to determine whether a predicate is fp or int. llvm-svn: 86624
* fix ConstantFoldCompareInstOperands to take the LHS/RHS asChris Lattner2009-11-093-33/+25
| | | | | | individual operands instead of taking a temporary array llvm-svn: 86619
* stub out a new libanalysis "instruction simplify" interface thatChris Lattner2009-11-092-0/+58
| | | | | | | | takes decimated instructions and applies identities to them. This is pretty minimal at this point, but I plan to pull some instcombine logic out into these and similar routines. llvm-svn: 86613
* Default-addressspace null pointers don't alias anything. This allowsDan Gohman2009-11-091-0/+9
| | | | | | GVN to be more aggressive. Patch by Hans Wennborg! (with a comment added by me) llvm-svn: 86582
* Minor tidiness fixes.Dan Gohman2009-11-091-4/+3
| | | | llvm-svn: 86565
* Re-commit r86077 now that r86290 fixes the 179.art and 175.vpr ARM regressions.Victor Hernandez2009-11-071-35/+41
| | | | | | | | | | | | | | | | | | | | | | | Here is the original commit message: This commit updates malloc optimizations to operate on malloc calls that have constant int size arguments. Update CreateMalloc so that its callers specify the size to allocate: MallocInst-autoupgrade users use non-TargetData-computed allocation sizes. Optimization uses use TargetData to compute the allocation size. Now that malloc calls can have constant sizes, update isArrayMallocHelper() to use TargetData to determine the size of the malloced type and the size of malloced arrays. Extend getMallocType() to support malloc calls that have non-bitcast uses. Update OptimizeGlobalAddressOfMalloc() to optimize malloc calls that have non-bitcast uses. The bitcast use of a malloc call has to be treated specially here because the uses of the bitcast need to be replaced and the bitcast needs to be erased (just like the malloc call) for OptimizeGlobalAddressOfMalloc() to work correctly. Update PerformHeapAllocSRoA() to optimize malloc calls that have non-bitcast uses. The bitcast use of the malloc is not handled specially here because ReplaceUsesOfMallocWithGlobal replaces through the bitcast use. Update OptimizeOnceStoredGlobal() to not care about the malloc calls' bitcast use. Update all globalopt malloc tests to not rely on autoupgraded-MallocInsts, but instead use explicit malloc calls with correct allocation sizes. llvm-svn: 86311
* Tolerate invalid derived type.Devang Patel2009-11-061-0/+4
| | | | llvm-svn: 86269
* Do not bother to emit debug info for nameless global variable.Devang Patel2009-11-061-0/+3
| | | | llvm-svn: 86259
* remove a bunch of extraneous LLVMContext argumentsChris Lattner2009-11-065-117/+93
| | | | | | from various APIs, addressing PR5325. llvm-svn: 86231
* Revert r86077 because it caused crashes in 179.art and 175.vpr on ARMVictor Hernandez2009-11-061-41/+35
| | | | llvm-svn: 86213
* Fix IVUsers to avoid assuming that the loop has a unique backedge.Dan Gohman2009-11-051-0/+2
| | | | llvm-svn: 86161
* Factor out the predicate code for loopsimplify form exit blocks intoDan Gohman2009-11-051-6/+8
| | | | | | a separate helper function. llvm-svn: 86159
* Update CreateMalloc so that its callers specify the size to allocate:Victor Hernandez2009-11-051-35/+41
| | | | | | | | | | | | | | | | | | MallocInst-autoupgrade users use non-TargetData-computed allocation sizes. Optimization uses use TargetData to compute the allocation size. Now that malloc calls can have constant sizes, update isArrayMallocHelper() to use TargetData to determine the size of the malloced type and the size of malloced arrays. Extend getMallocType() to support malloc calls that have non-bitcast uses. Update OptimizeGlobalAddressOfMalloc() to optimize malloc calls that have non-bitcast uses. The bitcast use of a malloc call has to be treated specially here because the uses of the bitcast need to be replaced and the bitcast needs to be erased (just like the malloc call) for OptimizeGlobalAddressOfMalloc() to work correctly. Update PerformHeapAllocSRoA() to optimize malloc calls that have non-bitcast uses. The bitcast use of the malloc is not handled specially here because ReplaceUsesOfMallocWithGlobal replaces through the bitcast use. Update OptimizeOnceStoredGlobal() to not care about the malloc calls' bitcast use. Update all globalopt malloc tests to not rely on autoupgraded-MallocInsts, but instead use explicit malloc calls with correct allocation sizes. llvm-svn: 86077
* While calculating original type size for a derived type, handle type ↵Devang Patel2009-11-041-6/+12
| | | | | | | | variants encoded as DIDerivedType appropriately. This improves bitfield support. llvm-svn: 86073
* Changes requested (avoid getFunction(), avoid Type creation via isVoidTy(), ↵Victor Hernandez2009-11-031-13/+8
| | | | | | and avoid redundant isFreeCall cases) in feedback to r85176 llvm-svn: 85936
* Changes (* location in pointer variables, avoiding include, and using ↵Victor Hernandez2009-11-031-39/+34
| | | | | | APInt::getLimitedValue) based on feedback to r85814 llvm-svn: 85933
* remove unneeded checks of isFreeCallChris Lattner2009-11-031-16/+0
| | | | llvm-svn: 85866
* remove a check of isFreeCall: the argument to free is already nocapture so ↵Chris Lattner2009-11-031-4/+0
| | | | | | the generic call code works fine. llvm-svn: 85865
* Set bit instead of calling pow() to compute 2 << nVictor Hernandez2009-11-021-5/+13
| | | | llvm-svn: 85814
* Fix for warning seen on DF-BSD, Victor, please fix this to use a shift ↵Edward O'Callaghan2009-11-021-1/+1
| | | | | | instead of pow() llvm-svn: 85781
* Apply fix for PR5135, Credit to Andreas Neustifter.Edward O'Callaghan2009-11-022-5/+6
| | | | llvm-svn: 85779
* Add a missing closing parenthesis, and tweak to fit in 80Duncan Sands2009-11-011-2/+2
| | | | | | columns. llvm-svn: 85732
* add a comment about why we don't allow inlining indbr.Chris Lattner2009-11-011-0/+5
| | | | llvm-svn: 85724
* Reverting 85714, 85715, 85716, which are breaking the buildDouglas Gregor2009-11-012-3/+0
| | | | llvm-svn: 85717
* Add a function to Passes.h to allow clients to create instancesDan Gohman2009-11-011-0/+2
| | | | | | of the ScalarEvolution pass without needing to #include ScalarEvolution.h. llvm-svn: 85716
* Don't #include Pass.h from CallGraph.h.Dan Gohman2009-11-011-0/+1
| | | | llvm-svn: 85715
* pull check for return inst out of loop, never inline a callee that containsChris Lattner2009-11-011-5/+7
| | | | | | an indirectbr. llvm-svn: 85702
* Rename forgetLoopBackedgeTakenCount to forgetLoop, because itDan Gohman2009-10-311-8/+8
| | | | | | clears out more information than just the stored backedge taken count. llvm-svn: 85664
* Make ScalarEvolutionAliasAnalysis slightly more aggressive, by making anDan Gohman2009-10-311-13/+10
| | | | | | underlying alias call even for non-identified-object values. llvm-svn: 85656
* If string field is empty then return NULL.Devang Patel2009-10-301-1/+4
| | | | llvm-svn: 85630
* If a type is derived from a derived type then calculate size appropriately.Devang Patel2009-10-301-3/+3
| | | | llvm-svn: 85619
* First bitcase use may not lead to a dbg.declare intrinsic. Iterate uses ↵Devang Patel2009-10-291-3/+4
| | | | | | | | until one find's dbg.declare intrinsic. Patch by Sunae Seo. llvm-svn: 85518
* fix 80-col.Zhongxing Xu2009-10-291-1/+1
| | | | llvm-svn: 85480
* Explicitly convert to double to suppress Visual C++ 2008 build error C2668 ↵Zhongxing Xu2009-10-291-1/+1
| | | | | | pow is ambiguous call to overloaded function llvm-svn: 85478
* Extend getMallocArraySize() to determine the array size if the malloc ↵Victor Hernandez2009-10-281-112/+96
| | | | | | | | | | | | | | argument is: ArraySize * ElementSize ElementSize * ArraySize ArraySize << log2(ElementSize) ElementSize << log2(ArraySize) Refactor isArrayMallocHelper and delete isSafeToGetMallocArraySize, so that there is only 1 copy of the malloc array determining logic. Update users of getMallocArraySize() to not bother calling isArrayMalloc() as well. llvm-svn: 85421
OpenPOWER on IntegriCloud