summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis
Commit message (Collapse)AuthorAgeFilesLines
...
* PHINode::hasConstantValue(): return undef if the PHI is fully recursive.Nuno Lopes2012-07-031-1/+1
| | | | | | Thanks Duncan for the idea llvm-svn: 159687
* fold PHI nodes in SizeOffsetEvaluator whenever possible.Nuno Lopes2012-07-031-1/+13
| | | | | | Unfortunately this change requires the cache map to hold WeakVHs instead llvm-svn: 159667
* Reduce use list thrashing by using DenseMap's find_as for maps with ↵Benjamin Kramer2012-06-302-9/+11
| | | | | | | | ValueHandle keys. No functionality change. llvm-svn: 159497
* RefreshCallGraph: ignore 'invoke intrinsic'. IntrinsicInst doesnt not ↵Nuno Lopes2012-06-291-1/+3
| | | | | | recognize invoke, and shouldnt at this point, since the rest of LLVM codebase doesnt expect invoke of intrinsics llvm-svn: 159441
* Update the CMake files.Bill Wendling2012-06-291-1/+0
| | | | llvm-svn: 159417
* The DIBuilder class is just a wrapper around debug info creationBill Wendling2012-06-291-1018/+0
| | | | | | | (a.k.a. MDNodes). The module doesn't belong in Analysis. Move it to the VMCore instead. llvm-svn: 159414
* If the step value is a constant zero, the loop isn't going to terminate. FixesNick Lewycky2012-06-281-1/+1
| | | | | | the assert reported in PR13228! llvm-svn: 159393
* MemoryBuiltins:Nuno Lopes2012-06-281-14/+37
| | | | | | | | - recognize C++ new(std::nothrow) friends - ignore ExtractElement and ExtractValue instructions in size/offset analysis (all easy cases are probably folded away before we get here) - also recognize realloc as noalias llvm-svn: 159356
* make LazyValueInfo analyze the default case of switch statements (we know ↵Nuno Lopes2012-06-281-16/+15
| | | | | | that in the default branch the value cannot be any of the switch cases) llvm-svn: 159353
* make LVI::getEdgeValue() always intersect the constraints of the edge with ↵Nuno Lopes2012-06-281-36/+53
| | | | | | the range of the block. Previously it was only performing the intersection for a few cases, thus losing precision llvm-svn: 159320
* Fix cmake failure from moving files around.Bill Wendling2012-06-281-1/+0
| | | | llvm-svn: 159314
* Move lib/Analysis/DebugInfo.cpp to lib/VMCore/DebugInfo.cpp andBill Wendling2012-06-284-1188/+6
| | | | | | | | | include/llvm/Analysis/DebugInfo.h to include/llvm/DebugInfo.h. The reasoning is because the DebugInfo module is simply an interface to the debug info MDNodes and has nothing to do with analysis. llvm-svn: 159312
* Reduce indentation in function. Rearrange some methods. No functionality change.Bill Wendling2012-06-261-223/+222
| | | | llvm-svn: 159239
* Revamp how debugging information is emitted for debug info objects.Bill Wendling2012-06-261-134/+84
| | | | | | | | | It's not necessary for each DI class to have its own copy of `print' and `dump'. Instead, just give DIDescriptor those methods and have it call the appropriate debugging printing routine based on the type of the debug information. llvm-svn: 159237
* Enable the new LoopInfo algorithm by default.Andrew Trick2012-06-262-11/+8
| | | | | | | | | | | | | | | | | | | | | | | | The primary advantage is that loop optimizations will be applied in a stable order. This helps debugging and unit test creation. It is also a better overall implementation without pathologically bad performance on deep functions. On large functions (llvm-stress --size=200000 | opt -loops) Before: 0.1263s After: 0.0225s On deep functions (after tweaking llvm-stress, thanks Nadav): Before: 0.2281s After: 0.0227s See r158790 for more comments. The loop tree is now consistently generated in forward order, but loop passes are applied in reverse order over the program. If we have a loop optimization that prefers forward order, that can easily be achieved by adding a different type of LoopPassManager. llvm-svn: 159183
* Remove unnecessary FIXMEAndrew Trick2012-06-261-3/+0
| | | | llvm-svn: 159182
* check for the NoAlias attribute through CallSiteNuno Lopes2012-06-251-2/+2
| | | | llvm-svn: 159145
* llvm/lib: [CMake] Add explicit dependency to intrinsics_gen.NAKAMURA Takumi2012-06-242-0/+4
| | | | llvm-svn: 159112
* simplify code from previous commits (Thanks Duncan)Nuno Lopes2012-06-221-7/+2
| | | | llvm-svn: 158999
* remove extractMallocCallFromBitCast, since it was tailor maded for its sole ↵Nuno Lopes2012-06-221-8/+1
| | | | | | user. Update GlobalOpt accordingly. llvm-svn: 158952
* Add support for invoke to the MemoryBuiltin analysid.Nuno Lopes2012-06-211-15/+22
| | | | | | | | Update comments accordingly. Make instcombine remove useless invokes to C++'s 'new' allocation function (test attached). llvm-svn: 158937
* fix build in C++11 mode.Nuno Lopes2012-06-211-7/+7
| | | | | | Thanks to Chandler for pointing out the problem. llvm-svn: 158928
* hopefully fix the buildbots: some tests have wrong definitions of malloc ↵Nuno Lopes2012-06-211-3/+5
| | | | | | and were crashing this code on 64 bits machines llvm-svn: 158923
* refactor the MemoryBuiltin analysis:Nuno Lopes2012-06-214-145/+533
| | | | | | | | | | | | - provide more extensive set of functions to detect library allocation functions (e.g., malloc, calloc, strdup, etc) - provide an API to compute the size and offset of an object pointed by Move a few clients (GVN, AA, instcombine, ...) to the new API. This implementation is a lot more aggressive than each of the custom implementations being replaced. Patch reviewed by Nick Lewycky and Chandler Carruth, thanks. llvm-svn: 158919
* A new algorithm for computing LoopInfo. Temporarily disabled.Andrew Trick2012-06-201-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | -stable-loops enables a new algorithm for generating the Loop forest. It differs from the original algorithm in a few respects: - Not determined by use-list order. - Initially guarantees RPO order of block and subloops. - Linear in the number of CFG edges. - Nonrecursive. I didn't want to change the LoopInfo API yet, so the block lists are still inclusive. This seems strange to me, and it means that building LoopInfo is not strictly linear, but it may not be a problem in practice. At least the block lists start out in RPO order now. In the future we may add an attribute or wrapper analysis that allows other passes to assume RPO order. The primary motivation of this work was not to optimize LoopInfo, but to allow reproducing performance issues by decomposing the compilation stages. I'm often unable to do this with the current LoopInfo, because the loop tree order determines Loop pass order. Serializing the IR tends to invert the order, which reverses the optimization order. This makes it nearly impossible to debug interdependent loop optimizations such as LSR. I also believe this will provide more stable performance results across time. llvm-svn: 158790
* Move the implementation of LoopInfo into LoopInfoImpl.h.Andrew Trick2012-06-201-0/+5
| | | | | | | | | The implementation only needs inclusion from LoopInfo.cpp and MachineLoopInfo.cpp. Clients of the interface should only include the interface. This makes the interface readable and speeds up rebuilds after modifying the implementation. llvm-svn: 158787
* Round 2 of dead private variable removal.Benjamin Kramer2012-06-062-5/+3
| | | | | | | | LLVM is now -Wunused-private-field clean except for - lib/MC/MCDisassembler/Disassembler.h. Not sure why it keeps all those unaccessible fields. - gtest. llvm-svn: 158096
* Fix typos found by http://github.com/lyda/misspell-checkBenjamin Kramer2012-06-023-3/+3
| | | | llvm-svn: 157885
* Add support for enum forward declarations.Eric Christopher2012-06-011-2/+2
| | | | | | Part of rdar://11570854 llvm-svn: 157786
* Make sure that we're dealing with a binary SCEVExpr when simplifying.Benjamin Kramer2012-05-301-1/+2
| | | | llvm-svn: 157704
* Teach SCEV's icmp simplification logic that a-b == 0 is equivalent to a == b.Benjamin Kramer2012-05-301-1/+20
| | | | | | | | | | | | | | | This also required making recursive simplifications until nothing changes or a hard limit (currently 3) is hit. With the simplification in place indvars can canonicalize loops of the form for (unsigned i = 0; i < a-b; ++i) into for (unsigned i = 0; i != a-b; ++i) which used to fail because SCEV created a weird umax expr for the backedge taken count. llvm-svn: 157701
* SCEV: Handle a corner case reducing AddRecExpr * AddRecExprAndrew Trick2012-05-301-1/+4
| | | | | | | | | If integer overflow causes one of the terms to reach zero, that can force the entire expression to zero. Fixes PR12929: cast<Ty>() argument of incompatible type llvm-svn: 157673
* Reformat the loop that does AddRecExpr * AddRecExpr reduction.Andrew Trick2012-05-301-55/+56
| | | | | | No functionality. llvm-svn: 157672
* Mark some static arrays as const.Craig Topper2012-05-241-2/+2
| | | | llvm-svn: 157377
* Add support for C++11 enum classes in llvm.Eric Christopher2012-05-231-2/+3
| | | | | | Part of rdar://11496790 llvm-svn: 157303
* LSR fix: add a missing phi check during IV hoisting.Andrew Trick2012-05-221-1/+2
| | | | | | Fixes PR12898: SCEVExpander crash. llvm-svn: 157263
* Actually support DW_TAG_rvalue_reference_type that we were tryingEric Christopher2012-05-192-9/+14
| | | | | | | | to generate out of the front end. rdar://11479676 llvm-svn: 157094
* SCEV: Add MarkPendingLoopPredicates to avoid recursive isImpliedCond.Andrew Trick2012-05-191-0/+24
| | | | | | | | | | getUDivExpr attempts to simplify by checking for overflow. isLoopEntryGuardedByCond then evaluates the loop predicate which may lead to the same getUDivExpr causing endless recursion. Fixes PR12868: clang 3.2 segmentation fault. llvm-svn: 157092
* allow LazyValueInfo::getEdgeValue() to reason about multiple edges from the ↵Nuno Lopes2012-05-181-11/+6
| | | | | | same switch instruction by doing union of ranges (which may still be conservative, but it's more aggressive than before) llvm-svn: 157071
* Clarify comment.Eric Christopher2012-05-181-1/+1
| | | | llvm-svn: 157033
* minor simplification in the call to ConstantRange constructorNuno Lopes2012-05-171-1/+1
| | | | llvm-svn: 157024
* Remove extraneous ';'.Bill Wendling2012-05-171-1/+1
| | | | llvm-svn: 157011
* reuse the result of some expensive computations in getSignExtendExpr() and ↵Nuno Lopes2012-05-151-18/+20
| | | | | | | | getZeroExtendExpr() this gives a speedup of > 80 in a debug build in the test case of PR12825 (php_sha512_crypt_r) llvm-svn: 156849
* minor simplification to code: Ty is already a SCEV type; don't need to run ↵Nuno Lopes2012-05-151-6/+3
| | | | | | getEffectiveSCEVType() twice llvm-svn: 156823
* Move the capture analysis from MemoryDependencyAnalysis to a more general placeChad Rosier2012-05-142-85/+88
| | | | | | | | | so that it can be reused in MemCpyOptimizer. This analysis is needed to remove an unnecessary memcpy when returning a struct into a local variable. rdar://11341081 PR12686 llvm-svn: 156776
* Hoist simpler checks above llvm::PointerMayBeCaptured. No functional change ↵Chad Rosier2012-05-121-4/+6
| | | | | | intended. llvm-svn: 156687
* Fix intendation.Chad Rosier2012-05-101-1/+1
| | | | llvm-svn: 156589
* Teach DeadStoreElimination to eliminate exit-block stores with phi addresses.Dan Gohman2012-05-101-0/+31
| | | | llvm-svn: 156558
* Rewrite ScalarEvolution::hasOperand to use an explicit worklist insteadDan Gohman2012-05-101-35/+50
| | | | | | of recursion, to avoid excessive stack usage on deep expressions. llvm-svn: 156554
* Rename the Region::block_iterator to Region::block_node_iterator, andChandler Carruth2012-05-043-12/+29
| | | | | | | | | | | | | | | | | | | | | | | | add a new Region::block_iterator which actually iterates over the basic blocks of the region. The old iterator, now call 'block_node_iterator' iterates over RegionNodes which contain a single basic block. This works well with the GraphTraits-based iterator design, however most users actually want an iterator over the BasicBlocks inside these RegionNodes. Now the 'block_iterator' is a wrapper which exposes exactly this interface. Internally it uses the block_node_iterator to walk all nodes which are single basic blocks, but transparently unwraps the basic block to make user code simpler. While this patch is a bit of a wash, most of the updates are to internal users, not external users of the RegionInfo. I have an accompanying patch to Polly that is a strict simplification of every user of this interface, and I'm working on a pass that also wants the same simplified interface. This patch alone should have no functional impact. llvm-svn: 156202
OpenPOWER on IntegriCloud