summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis
Commit message (Collapse)AuthorAgeFilesLines
* Build fixes for STLPort + GCCMatt Arsenault2013-03-292-6/+6
| | | | llvm-svn: 178356
* Fix loop styleMatt Arsenault2013-03-291-2/+2
| | | | llvm-svn: 178355
* BasicAA: Only query twice if the result of the more general query was MayAliasArnold Schwaighofer2013-03-261-5/+5
| | | | | | | | | | | | | | This is a compile time optimization. Before the patch we would do two traversals on each call to aliasGEP - one with a set size parameter one with UnknownSize. We can do better by first checking the result of the alias query with UnknownSize. Only if this one returns MayAlias do we query a second time using size and type. This recovers an about 7% compile time regression on spec/ammp. radar://12349960 llvm-svn: 178045
* Fix SCEV forgetMemoizedResults should search and destroy backedge exprs.Andrew Trick2013-03-261-0/+30
| | | | | | | | | | | | | | | Fixes PR15570: SEGV: SCEV back-edge info invalid after dead code removal. Indvars creates a SCEV expression for the loop's back edge taken count, then determines that the comparison is always true and removes it. When loop-unroll asks for the expression, it contains a NULL SCEVUnknkown (as a CallbackVH). forgetMemoizedResults should invalidate the loop back edges expression. llvm-svn: 177986
* Support in AAEvaluator to print alias queries of loads/stores with TBAA tags.Manman Ren2013-03-221-0/+72
| | | | | | | | | Add "evaluate-tbaa" to print alias queries of loads/stores. Alias queries between pointers do not include TBAA tags. Add testing case for "placement new". TBAA currently says NoAlias. llvm-svn: 177772
* Remove 'else' after 'return'.Jakub Staszak2013-03-201-2/+4
| | | | llvm-svn: 177607
* Remove trailing spaces.Jakub Staszak2013-03-201-133/+133
| | | | llvm-svn: 177584
* Check whether a pointer is non-null (isKnownNonNull) in isKnownNonZero.Manman Ren2013-03-181-0/+2
| | | | | | | | This handles the case where we have an inbounds GEP with alloca as the pointer. This fixes the regression in PR12750 and rdar://13286434. Note that we can also fix this by handling some GEP cases in isKnownNonNull. llvm-svn: 177321
* Small fix for cost analysis of ptrtoint.Patrik Hagglund2013-03-121-2/+2
| | | | | | This seems to be a "copy-paste error" introducecd in r156140. llvm-svn: 176863
* Remove unneeded #includes. Use forward declarations instead.Jakub Staszak2013-03-101-0/+5
| | | | llvm-svn: 176783
* Early exit from getAllocationData() and isFreeCall() for intrinsics.Michael Ilseman2013-03-081-1/+5
| | | | llvm-svn: 176722
* Remove trailing whitespaceMichael Ilseman2013-03-081-5/+5
| | | | llvm-svn: 176720
* Remove -print-dbginfo as it is unused & bitrotten.David Blaikie2013-03-083-226/+0
| | | | | | | | This pass hasn't been touched in two years & would fail with assertions against the current debug info metadata format (the only test case for it still uses a many-versions old debug info metadata format) llvm-svn: 176707
* Simplify code. No functionality change.Jakub Staszak2013-03-071-3/+3
| | | | llvm-svn: 176646
* Change NULL to 0.Jakub Staszak2013-03-071-8/+8
| | | | llvm-svn: 176642
* ArrayRef ca accept one element. Simplify code a little bit, also it matches nowJakub Staszak2013-03-071-3/+5
| | | | | | coding in the other places of the file. llvm-svn: 176641
* Memory Dependence Analysis (not mem-dep test) take advantage of ↵Shuxin Yang2013-03-061-4/+14
| | | | | | | | | | | | | | | | "invariant.load" metadata. The "invariant.load" metadata indicates the memory unit being accessed is immutable. A load annotated with this metadata can be moved across any store. As I am not sure if it is legal to move such loads across barrier/fence, this change dose not allow such transformation. rdar://11311484 Thank Arnold for code review. llvm-svn: 176562
* Use dyn_cast instead of isa && cast. No functionality change.Jakub Staszak2013-03-061-4/+4
| | | | llvm-svn: 176537
* recommit r172363 & r171325 (reverted in r172756)Nuno Lopes2013-03-021-12/+29
| | | | | | | | This adds minimalistic support for PHI nodes to llvm.objectsize() evaluation fingers crossed so that it does break clang boostrap again.. llvm-svn: 176408
* add getUnderlyingObjectSize()Nuno Lopes2013-03-022-30/+21
| | | | | | | this is similar to getObjectSize(), but doesnt subtract the offset tweak the BasicAA code accordingly (per PR14988) llvm-svn: 176407
* Cost model support for lowered math builtins.Benjamin Kramer2013-02-281-0/+11
| | | | | | | | | | We make the cost for calling libm functions extremely high as emitting the calls is expensive and causes spills (on x86) so performance suffers. We still vectorize important calls like ceilf and friends on SSE4.1. and fabs. Differential Revision: http://llvm-reviews.chandlerc.com/D466 llvm-svn: 176287
* Fix a problem in alias analysis. It is about the misinterpretation of "Object".Shuxin Yang2013-02-281-0/+29
| | | | | | | | | | | | | | | | | This problem is exposed by r171325 which is already reverted. It is rather hard to fabricate a testing case without it. r171325 should *NOT* be resurrected as it has a potential problem although this problem dosen't directly contribute to PR14988. The bug is tracked by: - rdar://13063553, and - http://llvm.org/bugs/show_bug.cgi?id=14988 Thank Arnold for coming up a better solution to this problem. After comparing this solution and my original proposal, I decided to ditch mine. llvm-svn: 176225
* Constant fold vector bitcasts of halves similarly to how floats and doubles ↵Michael Ilseman2013-02-261-6/+8
| | | | | | are folded. Test case included. llvm-svn: 176131
* Unify clang/llvm attributes for asan/tsan/msan (LLVM part)Kostya Serebryany2013-02-261-2/+2
| | | | | | | | | | | | | | | | | | | These are two related changes (one in llvm, one in clang). LLVM: - rename address_safety => sanitize_address (the enum value is the same, so we preserve binary compatibility with old bitcode) - rename thread_safety => sanitize_thread - rename no_uninitialized_checks -> sanitize_memory CLANG: - add __attribute__((no_sanitize_address)) as a synonym for __attribute__((no_address_safety_analysis)) - add __attribute__((no_sanitize_thread)) - add __attribute__((no_sanitize_memory)) for S in address thread memory If -fsanitize=S is present and __attribute__((no_sanitize_S)) is not set llvm attribute sanitize_S llvm-svn: 176075
* Formatting.Chad Rosier2013-02-201-2/+1
| | | | llvm-svn: 175692
* Teach the DataLayout aware constant folder to be much more aggressive towardsNick Lewycky2013-02-141-8/+30
| | | | | | 'and' instructions. This is a pattern that shows up a lot in ubsan binaries. llvm-svn: 175128
* Metadata for annotating loops as parallel. The first consumer for this Pekka Jaaskelainen2013-02-131-0/+50
| | | | | | | | metadata is the loop vectorizer. See the documentation update for more info. llvm-svn: 175060
* [tsan] disable load widening in ThreadSanitizer modeKostya Serebryany2013-02-131-0/+6
| | | | llvm-svn: 175034
* Cost model: Add check for reverse shuffles to CostModel analysisArnold Schwaighofer2013-02-121-0/+18
| | | | | | | | | | Check for reverse shuffles in the CostModel analysis pass and query TargetTransform info accordingly. This allows us we can write test cases for reverse shuffles. radar://13171406 llvm-svn: 174932
* Revert "Add LLVMContext::emitWarning methods and use them. ↵Bob Wilson2013-02-082-11/+10
| | | | | | | | | | | | | <rdar://problem/12867368>" This reverts r171041. This was a nice idea that didn't work out well. Clang warnings need to be associated with warning groups so that they can be selectively disabled, promoted to errors, etc. This simplistic patch didn't allow for that. Enhancing it to provide some way for the backend to specify a front-end warning type seems like overkill for the few uses of this, at least for now. llvm-svn: 174748
* ARM cost model: Address computation in vector mem ops not freeArnold Schwaighofer2013-02-082-0/+12
| | | | | | | | | | | | | | | Adds a function to target transform info to query for the cost of address computation. The cost model analysis pass now also queries this interface. The code in LoopVectorize adds the cost of address computation as part of the memory instruction cost calculation. Only there, we know whether the instruction will be scalarized or not. Increase the penality for inserting in to D registers on swift. This becomes necessary because we now always assume that address computation has a cost and three is a closer value to the architecture. radar://13097204 llvm-svn: 174713
* Identify and simplify idempotent intrinsics. Test case included.Michael Ilseman2013-02-071-0/+36
| | | | llvm-svn: 174650
* Conditionalize constant folding of math intrinsics on the availability of an ↵Owen Anderson2013-02-071-0/+10
| | | | | | implementation on the host. This is a little bit unfortunate, but until someone decides to implement a full libm for APFloat, we don't have a better way to get this functionality. llvm-svn: 174561
* Signficantly generalize our ability to constant fold floating point ↵Owen Anderson2013-02-061-14/+88
| | | | | | intrinsics, including ones on half types. llvm-svn: 174555
* ConstantFolding: Fix a crash when encoutering a truncating inttoptr.Benjamin Kramer2013-02-051-3/+7
| | | | | | This was introduced in r173293. llvm-svn: 174424
* use GEP::accumulateConstantOffset() to replace custom written code to ↵Nuno Lopes2013-02-031-27/+2
| | | | | | compute GEP offset llvm-svn: 174279
* InstSimplify: stripAndComputeConstantOffsets can be called with vectors of ↵Benjamin Kramer2013-02-011-10/+18
| | | | | | | | | | pointers too. Prepare it for vectors of pointers and handle simple cases. We don't handle complicated cases because accumulateConstantOffset bails on pointer vectors. Fixes selfhost on i386. llvm-svn: 174179
* Add a comment explaining an unavailable optimization.Dan Gohman2013-02-011-0/+28
| | | | llvm-svn: 174131
* Rewrite instsimplify's handling if icmp on pointer values to remove theDan Gohman2013-02-011-56/+88
| | | | | | | | | | | | remaining use of AliasAnalysis concepts such as isIdentifiedObject to prove pointer inequality. @external_compare in test/Transforms/InstSimplify/compare.ll shows a simple case where a noalias argument can be equal to a global variable address, and while AliasAnalysis can get away with saying that these pointers don't alias, instsimplify cannot say that they are not equal. llvm-svn: 174122
* An alloca can be equal to an argument. It can't *alias* an alloca, but it couldDan Gohman2013-01-311-12/+0
| | | | | | | be equal, since there's nothing preventing a caller from correctly predicting the stack location of an alloca. llvm-svn: 174119
* Change stripAndComputeConstantOffsets to accept a NULL DataLayout pointerDan Gohman2013-01-311-10/+15
| | | | | | as well. llvm-svn: 174030
* Add a comment.Dan Gohman2013-01-311-0/+4
| | | | llvm-svn: 174028
* Move isKnownNonNull out of AliasAnalysis.h and into ValueTracking.cpp sinceDan Gohman2013-01-313-17/+16
| | | | | | | it isn't really an AliasAnalysis concept, and ValueTracking has similar things that it could plausibly share code with some day. llvm-svn: 174027
* Change GetPointerBaseWithConstantOffset's DataLayout argument from aDan Gohman2013-01-314-50/+49
| | | | | | | reference to a pointer, so that it can handle the case where DataLayout is not available and behave conservatively. llvm-svn: 174024
* Minor code simplification.Dan Gohman2013-01-311-1/+1
| | | | llvm-svn: 174005
* stripAndComputeConstantOffsets is only called on pointers; check thisDan Gohman2013-01-311-10/+1
| | | | | | with an assert instead of failing and requiring callers to check for failure. llvm-svn: 173998
* ConstantFolding: Add a missing folding that leads to a miscompile.Benjamin Kramer2013-01-241-4/+4
| | | | | | | | | | We use constant folding to see if an intrinsic evaluates to the same value as a constant that we know. If we don't take the undefinedness into account we get a value that doesn't match the actual implementation, and miscompiled code. This was uncovered by Chandler's simplifycfg changes. llvm-svn: 173356
* ConstantFolding: Tweak r173289, it should evaluate in the intptr type, not ↵Benjamin Kramer2013-01-231-18/+15
| | | | | | the index type. llvm-svn: 173293
* ConstantFolding: Evaluate GEP indices in the index type.Benjamin Kramer2013-01-231-2/+11
| | | | | | | This fixes some edge cases that we would get wrong with uint64_ts. PR14986. llvm-svn: 173289
* Begin fleshing out an interface in TTI for modelling the costs ofChandler Carruth2013-01-223-63/+159
| | | | | | | | | | | | | | | | | | | | | | | | | | | generic function calls and intrinsics. This is somewhat overlapping with an existing intrinsic cost method, but that one seems targetted at vector intrinsics. I'll merge them or separate their names and use cases in a separate commit. This sinks the test of 'callIsSmall' down into TTI where targets can control it. The whole thing feels very hack-ish to me though. I've left a FIXME comment about the fundamental design problem this presents. It isn't yet clear to me what the users of this function *really* care about. I'll have to do more analysis to figure that out. Putting this here at least provides it access to proper analysis pass tools and other such. It also allows us to more cleanly implement the baseline cost interfaces in TTI. With this commit, it is now theoretically possible to simplify much of the inline cost analysis's handling of calls by calling through to this interface. That conversion will have to happen in subsequent commits as it requires more extensive restructuring of the inline cost analysis. The CodeMetrics class is now really only in the business of running over a block of code and aggregating the metrics on that block of code, with the actual cost evaluation done entirely in terms of TTI. llvm-svn: 173148
OpenPOWER on IntegriCloud