summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis
Commit message (Collapse)AuthorAgeFilesLines
...
* Make DecomposeGEPExpression check SimplifyInstruction onlyDan Gohman2011-05-241-9/+12
| | | | | | | | after checking for a GEP, so that it matches what GetUnderlyingObject does. This fixes an obscure bug turned up by bugpoint in the testcase for PR9931. llvm-svn: 131971
* fix a really nasty basicaa mod/ref calculation bug that was causing ↵Chris Lattner2011-05-231-2/+5
| | | | | | | | miscompilation of UnitTests/ObjC/messages-2.m with the recent optimizer improvements. llvm-svn: 131897
* Teach valuetracking that byval arguments with a specified alignment areChris Lattner2011-05-231-1/+11
| | | | | | | | | | | | | | | | | | | | | | aligned. Teach memcpyopt to not give up all hope when confonted with an underaligned memcpy feeding an overaligned byval. If the *source* of the memcpy can be determined to be adequeately aligned, or if it can be forced to be, we can eliminate the memcpy. This addresses PR9794. We now compile the example into: define i32 @f(%struct.p* nocapture byval align 8 %q) nounwind ssp { entry: %call = call i32 @g(%struct.p* byval align 8 %q) nounwind ret i32 %call } in both x86-64 and x86-32 mode. We still don't get a tailcall though, because tailcalls apparently can't handle byval. llvm-svn: 131884
* implement PR9315, constant folding exp2 in terms of pow (since hosts withoutChris Lattner2011-05-221-1/+7
| | | | | | C99 runtimes don't have exp2). llvm-svn: 131872
* Teach ValueTracking about x86 crc32 intrinsics.Evan Cheng2011-05-221-0/+4
| | | | llvm-svn: 131861
* Revert commit 131781, to see if it fixes the x86-64 dragonegg buildbot.Duncan Sands2011-05-211-11/+1
| | | | | | | | | Original log message: When BasicAA can determine that two pointers have the same base but differ by a dynamic offset, return PartialAlias instead of MayAlias. See the comment in the code for details. This fixes PR9971. llvm-svn: 131809
* When BasicAA can determine that two pointers have the same base butDan Gohman2011-05-211-1/+11
| | | | | | | differ by a dynamic offset, return PartialAlias instead of MayAlias. See the comment in the code for details. This fixes PR9971. llvm-svn: 131781
* indvars: Prototyping Sign/ZeroExtend elimination without canonical IVs.Andrew Trick2011-05-201-7/+7
| | | | | | | | | | No functionality enabled by default. Use -disable-iv-rewrite. Extended IVUsers to keep track of the phi that represents the users' IV. Added the WidenIV transform to replace a narrow IV with a wide IV by doing a one-for-one replacement of IV users instead of expanding the SCEV expressions. [sz]exts are removed and truncs are inserted. llvm-svn: 131744
* @llvm.lifetime.begin acts as a load, not @llvm.lifetime.end.Owen Anderson2011-05-171-1/+1
| | | | llvm-svn: 131437
* Extra refactoring noticed by Eli Friedman.Rafael Espindola2011-05-161-9/+8
| | | | llvm-svn: 131405
* Fix a source of non determinism in FindUsedTypes, use a SetVector instead of aJulien Lerouge2011-05-131-2/+2
| | | | | | | | set. rdar://9423996 llvm-svn: 131283
* Change a few std::maps to DenseMaps.Dan Gohman2011-05-091-2/+2
| | | | llvm-svn: 131088
* The comparision "max(x,y)==x" is equivalent to "x>=y". Since the max isDuncan Sands2011-05-071-10/+56
| | | | | | | often expressed as "x >= y ? x : y", there is a good chance we can extract the existing "x >= y" from it and use that as a replacement for "max(x,y)==x". llvm-svn: 131049
* PR9838: Fix transform introduced in r127064 to not trigger when only one ↵Eli Friedman2011-05-051-1/+1
| | | | | | side of the icmp is an exact shift. llvm-svn: 130954
* Minor change: Fix the typo in RegionPass.h and RegionPass.cpp.Hongbin Zheng2011-05-051-1/+1
| | | | llvm-svn: 130920
* Add variations on: max(x,y) >= min(x,z) folds to true. This isn't that common,Duncan Sands2011-05-041-2/+46
| | | | | | | | but according to my super-optimizer there are only two missed simplifications of -instsimplify kind when compiling bzip2, and this is one of them. It amuses me to have bzip2 be perfectly optimized as far as instsimplify goes! llvm-svn: 130840
* indvars: Added DisableIVRewrite and WidenIVs.Andrew Trick2011-05-041-0/+15
| | | | | | | | This adds functionality to remove size/zero extension during indvars without generating a canonical IV and rewriting all IV users. It's disabled by default so should have no effect on codegen. Work in progress. llvm-svn: 130829
* Implement some basic simplifications involving min/max, for exampleDuncan Sands2011-05-031-0/+118
| | | | | | | | max(a,b) >= a -> true. According to my super-optimizer, these are by far the most common simplifications (of the -instsimplify kind) that occur in the testsuite and aren't caught by -std-compile-opts. llvm-svn: 130780
* Use llvm.dbg.cu named metadata to collect compile units.Devang Patel2011-05-031-0/+4
| | | | llvm-svn: 130756
* Fix PR9579: when simplifying a compare to "true" or "false", and it wasDuncan Sands2011-05-021-18/+22
| | | | | | a vector compare, generate a vector result rather than i1 (and crashing). llvm-svn: 130706
* Move some rem transforms out of instcombine and into instsimplify.Duncan Sands2011-05-021-0/+117
| | | | | | | This automagically provides a transform noticed by my super-optimizer as occurring quite often: "rem x, (select cond, x, 1)" -> 0. llvm-svn: 130694
* teach GVN to widen integer loads when they are overaligned, when doing an Chris Lattner2011-04-281-10/+31
| | | | | | | | | | | wider load would allow elimination of subsequent loads, and when the wider load is still a native integer type. This eliminates a ton of loads on various benchmarks involving struct fields, though it is somewhat hobbled by clang not being very aggressive about field alignment. This is yet another step along the way towards resolving PR6627. llvm-svn: 130390
* Teach BasicAA about arm.neon.vld1 and vst1.Dan Gohman2011-04-271-0/+20
| | | | llvm-svn: 130327
* When analyzing functions known to only access argument pointees,Dan Gohman2011-04-271-9/+28
| | | | | | | | | only check arguments with pointer types. Update the documentation of IntrReadArgMem reflect this. While here, add support for TBAA tags on intrinsic calls. llvm-svn: 130317
* Corrects an old, old typo in a case that doesn't seem to be reached in practice.Andrew Trick2011-04-271-1/+1
| | | | llvm-svn: 130316
* Test case and comment for PR9633.Andrew Trick2011-04-271-2/+3
| | | | llvm-svn: 130294
* Fix for PR9633 [indvars] Assertion `isa<X>(Val) && "cast<Ty>() argument of ↵Andrew Trick2011-04-271-2/+7
| | | | | | | | | incompatible type!"' failed. Added a type check in ScalarEvolution::computeSCEVAtScope to handle the case in which operands of an AddRecExpr in the current scope are folded. llvm-svn: 130271
* Enhance memdep to return clobber relation between noalias loads whenChris Lattner2011-04-261-3/+95
| | | | | | | | | | | | | | | | an earlier load could be widened to encompass a later load. For example, if we see: X = load i8* P, align 4 Y = load i8* (P+3), align 1 and we have a 32-bit native integer type, we can widen the former load to i32 which then makes the second load redundant. GVN can't actually do anything with this load/load relation yet, so this isn't testable, but it is the next step to resolving PR6627, and a fairly general class of "merge neighboring loads" missed optimizations. llvm-svn: 130250
* use AA::isMustAlias to simplify some calls.Chris Lattner2011-04-261-5/+3
| | | | llvm-svn: 130248
* remove support for llvm.invariant.end from memdep. It is a Chris Lattner2011-04-261-37/+0
| | | | | | work-in-progress that is not progressing, and it has issues. llvm-svn: 130247
* Fix an off by one error while accessing complex address element of a DIVariable.Devang Patel2011-04-261-0/+1
| | | | | | This worked untill now because stars are aligned (i.e. num of complex address elments are always 0 or 2+ and when it is 2+ at least two elements are access together) llvm-svn: 130225
* Enhance MemDep: When alias analysis returns a partial alias result,Chris Lattner2011-04-261-5/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | return it as a clobber. This allows GVN to do smart things. Enhance GVN to be smart about the case when a small load is clobbered by a larger overlapping load. In this case, forward the value. This allows us to compile stuff like this: int test(void *P) { int tmp = *(unsigned int*)P; return tmp+*((unsigned char*)P+1); } into: _test: ## @test movl (%rdi), %ecx movzbl %ch, %eax addl %ecx, %eax ret which has one load. We already handled the case where the smaller load was from a must-aliased base pointer. llvm-svn: 130180
* Fix an iterator invalidation bug.Dan Gohman2011-04-251-9/+16
| | | | llvm-svn: 130166
* PR9214: Convert the DIBuilder API to use ArrayRef.Jay Foad2011-04-241-8/+6
| | | | llvm-svn: 130086
* Remove unused STL header includes.Jay Foad2011-04-233-5/+0
| | | | llvm-svn: 130068
* Let front-end tie subprogram declaration with subprogram definition directly.Devang Patel2011-04-221-2/+4
| | | | llvm-svn: 130028
* PR9214: Convert Metadata API to use ArrayRef.Jay Foad2011-04-211-9/+11
| | | | llvm-svn: 129932
* Use ArrayRef variants.Devang Patel2011-04-181-35/+33
| | | | llvm-svn: 129735
* Mark some functions as used which are used within debug-only code. ThisChandler Carruth2011-04-181-0/+2
| | | | | | silences Clang's -Wunused-function when building in release mode. llvm-svn: 129709
* Introduce support to encode Objective-C property information in debugging ↵Devang Patel2011-04-161-0/+29
| | | | | | information generated for an interface. llvm-svn: 129624
* Fix a ton of comment typos found by codespell. Patch byChris Lattner2011-04-1510-15/+15
| | | | | | Luis Felipe Strano Moraes! llvm-svn: 129558
* PR9214: Convert ConstantExpr::getIndices() to return an ArrayRef, plusJay Foad2011-04-131-1/+1
| | | | | | related tweaks to ExprMapKeyType. llvm-svn: 129443
* Don't include Operator.h from InstrTypes.h.Jay Foad2011-04-116-0/+6
| | | | llvm-svn: 129271
* PR9604; try to deal with RAUW updates correctly in the AST. I'm not convincedEli Friedman2011-04-091-0/+4
| | | | | | | it's completely safe to cache the AST across LICM runs even with this fix, but this fix can't hurt. llvm-svn: 129198
* Add support to encode function's template parameters.Devang Patel2011-04-051-4/+8
| | | | llvm-svn: 128947
* remove postdom frontiers, because it is dead. Forward dom frontiers areChris Lattner2011-04-052-52/+0
| | | | | | still used by RegionInfo :( llvm-svn: 128943
* Region: Allow user control the printing style of the print function.Tobias Grosser2011-04-041-16/+16
| | | | | | Contributed by: etherzhhb@gmail.com llvm-svn: 128808
* Don't assume something which might be a constant expression is an instruction.Eli Friedman2011-04-021-3/+3
| | | | | | | Based on PR9429, but no testcase because I can't figure out how to trigger it anymore given other changes to the relevant code. llvm-svn: 128781
* Remove PHINode::reserveOperandSpace(). Instead, add a parameter toJay Foad2011-03-301-4/+3
| | | | | | PHINode::Create() giving the (known or expected) number of operands. llvm-svn: 128537
* (Almost) always call reserveOperandSpace() on newly created PHINodes.Jay Foad2011-03-301-6/+8
| | | | llvm-svn: 128535
OpenPOWER on IntegriCloud