summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis
Commit message (Collapse)AuthorAgeFilesLines
* [PM] Remove support for omitting the AnalysisManager argument to newChandler Carruth2016-06-176-9/+17
| | | | | | | | | | | | | | | | | | | | pass manager passes' `run` methods. This removes a bunch of SFINAE goop from the pass manager and just requires pass authors to accept `AnalysisManager<IRUnitT> &` as a dead argument. This is a small price to pay for the simplicity of the system as a whole, despite the noise that changing it causes at this stage. This will also helpfull allow us to make the signature of the run methods much more flexible for different kinds af passes to support things like intelligently updating the pass's progression over IR units. While this touches many, many, files, the changes are really boring. Mostly made with the help of my trusty perl one liners. Thanks to Sean and Hal for bouncing ideas for this with me in IRC. llvm-svn: 272978
* [LV] Move management of symbolic strides to LAA. NFCIAdam Nemet2016-06-161-13/+33
| | | | | | | | | | | | | | | | | | | This is still NFCI, so the list of clients that allow symbolic stride speculation does not change (yes: LV and LoopVersioningLICM, no: LLE, LDist). However since the symbolic strides are now managed by LAA rather than passed by client a new bool parameter is used to enable symbolic stride speculation. The existing test Transforms/LoopVectorize/version-mem-access.ll checks that stride speculation is performed for LV. The previously added test Transforms/LoopLoadElim/symbolic-stride.ll ensures that no speculation is performed for LLE. The next patch will change the functionality and turn on symbolic stride speculation in all of LAA's clients and remove the bool parameter. llvm-svn: 272970
* TTI: Add hook for memory width to vectorizeMatt Arsenault2016-06-161-0/+4
| | | | llvm-svn: 272964
* Revert r272891 "[JumpThreading] Prevent dangling pointer problems in ↵Igor Laevsky2016-06-161-8/+0
| | | | | | | | BranchProbabilityInfo" It was causing failures in Profile-i386 and Profile-x86_64 tests. llvm-svn: 272912
* [JumpThreading] Prevent dangling pointer problems in BranchProbabilityInfoIgor Laevsky2016-06-161-0/+8
| | | | | | | | | We should update results of the BranchProbabilityInfo after removing block in JumpThreading. Otherwise we will get dangling pointer inside BranchProbabilityInfo cache. Differential Revision: http://reviews.llvm.org/D20957 llvm-svn: 272891
* [LAA] Rename Strides to SymblicStrides in analyzeLoop. NFCAdam Nemet2016-06-161-7/+8
| | | | | | This is to facilitate to move of SymblicStrides from LV to LAA. llvm-svn: 272879
* [LAA] Default getInfo to not speculate symbolic strides. NFCAdam Nemet2016-06-161-3/+1
| | | | | | | Soon we won't be passing Strides to getInfo and then we'll have fewer call sites to update. llvm-svn: 272878
* [InstCombine] Don't widen metadata on store-to-load forwardingEli Friedman2016-06-161-1/+4
| | | | | | | | | | | | | The original check for load CSE or store-to-load forwarding is wrong when the forwarded stored value happened to be a load. Ref https://github.com/JuliaLang/julia/issues/16894 Differential Revision: http://reviews.llvm.org/D21271 Patch by Yichao Yu! llvm-svn: 272868
* [CFLAA] Ignore non-pointers, move Attrs to graph nodes.George Burgess IV2016-06-151-64/+93
| | | | | | | | | | | | | | This patch makes CFLAA ignore non-pointer values, since we can now sanely do that with the escaping/unknown attributes. Additionally, StratifiedAttrs make more sense to sit on nodes than edges (since they're properties of values, and ultimately end up on the nodes of StratifiedSets). So, this patch puts said attributes on nodes. Patch by Jia Chen. Differential Revision: http://reviews.llvm.org/D21387 llvm-svn: 272833
* [TargetLibraryInfo] Teach isValidProtoForLibFunc about tanDavid Majnemer2016-06-151-0/+3
| | | | | | | | | We would fail to validate the type of the tan function which would cause downstream users of isValidProtoForLibFunc to assert. This fixes PR28143. llvm-svn: 272802
* [SCEV] Use dyn_cast<T> instead of dyn_cast<const T>; NFCSanjoy Das2016-06-151-7/+7
| | | | | | The const is unnecessary. llvm-svn: 272759
* [SCEV] Use cast<> instead of dyn_cast; NFCSanjoy Das2016-06-151-4/+2
| | | | llvm-svn: 272758
* [SCEV] clang-format some sectionsSanjoy Das2016-06-151-12/+10
| | | | llvm-svn: 272753
* [SCEV] Change the interface for SolveQuadraticEquation; NFCSanjoy Das2016-06-151-21/+14
| | | | | | | | Use Optional<T> to denote the absence of a solution, not SCEVCouldNotCompute. This makes the usage of SolveQuadraticEquation somewhat simpler. llvm-svn: 272752
* IR: Introduce local_unnamed_addr attribute.Peter Collingbourne2016-06-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a local_unnamed_addr attribute is attached to a global, the address is known to be insignificant within the module. It is distinct from the existing unnamed_addr attribute in that it only describes a local property of the module rather than a global property of the symbol. This attribute is intended to be used by the code generator and LTO to allow the linker to decide whether the global needs to be in the symbol table. It is possible to exclude a global from the symbol table if three things are true: - This attribute is present on every instance of the global (which means that the normal rule that the global must have a unique address can be broken without being observable by the program by performing comparisons against the global's address) - The global has linkonce_odr linkage (which means that each linkage unit must have its own copy of the global if it requires one, and the copy in each linkage unit must be the same) - It is a constant or a function (which means that the program cannot observe that the unique-address rule has been broken by writing to the global) Although this attribute could in principle be computed from the module contents, LTO clients (i.e. linkers) will normally need to be able to compute this property as part of symbol resolution, and it would be inefficient to materialize every module just to compute it. See: http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20160509/356401.html http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20160516/356738.html for earlier discussion. Part of the fix for PR27553. Differential Revision: http://reviews.llvm.org/D20348 llvm-svn: 272709
* [ValueTracking] Calls to @llvm.assume always returnSanjoy Das2016-06-141-1/+2
| | | | | | | | | | | | This change teaches llvm::isGuaranteedToTransferExecutionToSuccessor that calls to @llvm.assume always terminate. Most other relevant intrinsics should be covered by the "CS.onlyReadsMemory() || CS.onlyAccessesArgMemory()" bit but we were missing @llvm.assumes because we state that it clobbers memory. Added an LICM test case, but this change is not specific to LICM. llvm-svn: 272703
* [CFLAA] Tag arguments as escaped instead of unknown.George Burgess IV2016-06-142-306/+217
| | | | | | | | | | | | | | | | | | | This patch also includes some refactoring. Prior to this patch, we tagged all CFLAA attributes as unknown. This is suboptimal, since it meant that any Value used as an argument would be considered to alias any other Value that existed. Now that we have the machinery to tag sets below the set for an arbitrary value with attributes, it's okay to be less conservative with arguments. (Specifically, we still tag the set under an argument with unknown). Patch by Jia Chen. Differential Revision: http://reviews.llvm.org/D21262 llvm-svn: 272690
* [CFLAA] Refactor graph-building code. NFC.George Burgess IV2016-06-141-170/+160
| | | | | | | | | | | This patch refactors CFLAA's graph building code. This makes keeping track of common state (TargetLibraryInfo, ...) easier. Patch by Jia Chen. Differential Revision: http://reviews.llvm.org/D21261 llvm-svn: 272688
* AMDGPU: mark {exp,log}10{,f,l} library functions as unavailableNicolai Haehnle2016-06-141-0/+6
| | | | | | | | | | | | | | | | | | Summary: The SimplifyLibCalls part of InstCombine generates calls to those otherwise. I wonder if at some point we shouldn't just call disableAllFunctions() and then enable functions on a whitelist basis... Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96495 Reviewers: arsenm, tstellarAMD Subscribers: llvm-commits, kzhuravl Differential Revision: http://reviews.llvm.org/D21282 llvm-svn: 272664
* [PM] Port LVI to the new PM.Sean Silva2016-06-132-13/+27
| | | | | | | | | | | | | | | | | | | This is a bit gnarly since LVI is maintaining its own cache. I think this port could be somewhat cleaner, but I'd rather not spend too much time on it while we still have the old pass hanging around and limiting how much we can clean things up. Once the old pass is gone it will be easier (less time spent) to clean it up anyway. This is the last dependency needed for porting JumpThreading which I'll do in a follow-up commit (there's no printer pass for LVI or anything to test it, so porting a pass that depends on it seems best). I've been mostly following: r269370 / D18834 which ported Dependence Analysis r268601 / D19839 which ported BPI llvm-svn: 272593
* Fix AAResults::callCapturesBefore for operand bundlesSanjoy Das2016-06-131-1/+1
| | | | | | | | | | | | | | | | Summary: AAResults::callCapturesBefore would previously ignore operand bundles. It was possible for a later instruction to miss its memory dependency on a call site that would only access the pointer through a bundle. Patch by Oscar Blumberg! Reviewers: sanjoy Differential Revision: http://reviews.llvm.org/D21286 llvm-svn: 272580
* Attempt to make windows buildbots happy.George Burgess IV2016-06-131-4/+0
| | | | | | | Broken by r272578. I didn't realize that the default move ctor complaints would happen for non-template classes. :) llvm-svn: 272579
* [CFLAA] Refactor to remove redundant maps. NFC.George Burgess IV2016-06-131-209/+104
| | | | | | | | Patch by Jia Chen. Differential Revision: http://reviews.llvm.org/D21233 llvm-svn: 272578
* [LICM] Make isGuaranteedToExecute more accurate.Eli Friedman2016-06-111-13/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Make isGuaranteedToExecute use the isGuaranteedToTransferExecutionToSuccessor helper, and make that helper a bit more accurate. There's a potential performance impact here from assuming that arbitrary calls might not return. This probably has little impact on loads and stores to a pointer because most things alias analysis can reason about are dereferenceable anyway. The other impacts, like less aggressive hoisting of sdiv by a variable and less aggressive hoisting around volatile memory operations, are unlikely to matter for real code. This also impacts SCEV, which uses the same helper. It's a minor improvement there because we can tell that, for example, memcpy always returns normally. Strictly speaking, it's also introducing a bug, but it's not any worse than everywhere else we assume readonly functions terminate. Fixes http://llvm.org/PR27857. Reviewers: hfinkel, reames, chandlerc, sanjoy Subscribers: broune, llvm-commits Differential Revision: http://reviews.llvm.org/D21167 llvm-svn: 272489
* Interprocedural Register Allocation (IPRA) AnalysisMehdi Amini2016-06-101-0/+4
| | | | | | | | | | | | | | | | | | | | | | | Add an option to enable the analysis of MachineFunction register usage to extract the list of clobbered registers. When enabled, the CodeGen order is changed to be bottom up on the Call Graph. The analysis is split in two parts, RegUsageInfoCollector is the MachineFunction Pass that runs post-RA and collect the list of clobbered registers to produce a register mask. An immutable pass, RegisterUsageInfo, stores the RegMask produced by RegUsageInfoCollector, and keep them available. A future tranformation pass will use this information to update every call-sites after instruction selection. Patch by Vivek Pandya <vivekvpandya@gmail.com> Differential Revision: http://reviews.llvm.org/D20769 llvm-svn: 272403
* Add null checks before using a pointer.Richard Trieu2016-06-101-0/+4
| | | | llvm-svn: 272359
* [CFLAA] Handle global/arg attrs more sanely.George Burgess IV2016-06-092-20/+40
| | | | | | | | | | | | | | | | Prior to this patch, we used argument/global stratified attributes in order to note that a value could have come from either dereferencing a global/arg, or from the assignment from a global/arg. Now, AttrUnknown is placed on sets when we see a dereference, instead of the global/arg attributes. This allows us to be more aggressive in the future when we see global/arg attributes without AttrUnknown. Patch by Jia Chen. Differential Revision: http://reviews.llvm.org/D21110 llvm-svn: 272335
* Use ProfileSummaryInfo in inline cost analysis.Easwaran Raman2016-06-091-39/+28
| | | | | | | | Instead of directly using MaxFunctionCount and function entry count to determine callee hotness, use the isHotFunction/isColdFunction methods provided by ProfileSummaryInfo. Differential revision: http://reviews.llvm.org/D21045 llvm-svn: 272321
* Revert r272194 No need for it if loop Analysis Manager is usedXinliang David Li2016-06-091-11/+12
| | | | llvm-svn: 272243
* Minor clean up in loopHasNoAbnormalExits; NFCSanjoy Das2016-06-091-8/+7
| | | | llvm-svn: 272238
* Be wary of abnormal exits from loop when exploiting UBSanjoy Das2016-06-091-1/+2
| | | | | | | | | | | | | | We can safely rely on a NoWrap add recurrence causing UB down the road only if we know the loop does not have a exit expressed in a way that is opaque to ScalarEvolution (e.g. by a function call that conditionally calls exit(0)). I believe with this change PR28012 is fixed. Note: I had to change some llvm-lit tests in LoopReroll, since it looks like they were depending on this incorrect behavior. llvm-svn: 272237
* Factor out a loopHasNoAbnormalExits; NFCSanjoy Das2016-06-091-9/+8
| | | | llvm-svn: 272236
* [PM] Refector LoopAccessInfo analysis code Xinliang David Li2016-06-081-12/+11
| | | | | | | | This is the preparation patch to port the analysis to new PM Differential Revision: http://reviews.llvm.org/D20560 llvm-svn: 272194
* Apply most suggestions of clang-tidy's performance-unnecessary-value-paramBenjamin Kramer2016-06-085-14/+9
| | | | | | | Avoids unnecessary copies. All changes audited & pass tests with asan. No functional change intended. llvm-svn: 272190
* Attempt #2 to appease the buildbots.George Burgess IV2016-06-081-3/+3
| | | | | | | MSVC calls the copy ctor on StratifiedSets for some reason. So, undelete it. llvm-svn: 272184
* [SCEV] Break out of loop if there is no more work to doSanjoy Das2016-06-081-1/+1
| | | | | | | This is NFC as far as externally visible behavior is concerned, but will keep us from spinning in the worklist traversal algorithm unnecessarily. llvm-svn: 272182
* [SCEV] Track no-abnormal-exits instead of no-throw callsSanjoy Das2016-06-081-10/+10
| | | | | | | | | | | Absence of may-unwind calls is not enough to guarantee that a UB-generating use of an add-rec poison in the loop latch will actually cause UB. We also need to guard against calls that terminate the thread or infinite loop themselves. This partially addresses PR28012. llvm-svn: 272181
* Teach isGuarantdToTransferExecToSuccessor about debug info intrinsicsSanjoy Das2016-06-081-3/+6
| | | | | | Calls to `@llvm.dbg.*` can be assumed to terminate. llvm-svn: 272180
* Fix a bug in SCEV's poison value propagationSanjoy Das2016-06-081-12/+13
| | | | | | | | | | | | | The worklist algorithm introduced in rL271151 didn't check to see if the direct users of the post-inc add recurrence propagates poison. This change fixes the problem and makes the code structure more obvious. Note for release managers: correctness wise, this bug wasn't a regression introduced by rL271151 -- the behavior of SCEV around post-inc add recurrences was strictly improved (in terms of correctness) in rL271151. llvm-svn: 272179
* Try to appease buildbots.George Burgess IV2016-06-081-3/+8
| | | | | | | r272064 apparently made them angry. This undoes some changes made in r272064 (defaulting move ctors) to make them happy again. llvm-svn: 272173
* Avoid copies of std::strings and APInt/APFloats where we only read from itBenjamin Kramer2016-06-083-5/+5
| | | | | | | | As suggested by clang-tidy's performance-unnecessary-copy-initialization. This can easily hit lifetime issues, so I audited every change and ran the tests under asan, which came back clean. llvm-svn: 272126
* [CFLAA] Kill dead code/fix comments in StratifiedSets.George Burgess IV2016-06-071-87/+23
| | | | | | | | Also use default/delete instead of hand-written ctors. Thanks to Jia Chen for bringing this stuff up. llvm-svn: 272064
* [CFLAA] Add AttrEscaped, remove bit twiddling functions.George Burgess IV2016-06-072-63/+58
| | | | | | | | | | | | | | | | | | | | | This patch does a few things: - Unifies AttrAll and AttrUnknown (since they were used for more or less the same purpose anyway). - Introduces AttrEscaped, an attribute that notes that a value escapes our analysis for a given set, but not that an unknown value flows into said set. - Removes functions that take bit indices, since we also had functions that took bitsets, and the use of both (with similar names) was unclear and bug-prone. Patch by Jia Chen. Differential Revision: http://reviews.llvm.org/D21000 llvm-svn: 272040
* [LAA] Improve non-wrapping pointer detection by handling loop-invariant case.Andrey Turetskiy2016-06-071-4/+14
| | | | | | | | | | | | | This fixes PR26314. This patch adds new helper “isNoWrap” with detection of loop-invariant pointer case. Patch by Roman Shirokiy. Ref: https://llvm.org/bugs/show_bug.cgi?id=26314 Differential Revision: http://reviews.llvm.org/D17268 llvm-svn: 272014
* [LoopUnrollAnalyzer] Fix a crash in analyzeLoopUnrollCost.Michael Zolotukhin2016-06-061-3/+5
| | | | | | | | | | | In some cases, when simplifying with SCEV, we might consider pointer values as just usual integer values. Thus, we might get a different type from what we had originally in the map of simplified values, and hence we need to check types before operating on the values. This fixes PR28015. llvm-svn: 271931
* [LAA] Use load and store vectors (NFC)Matthew Simpson2016-06-061-11/+7
| | | | | | | Contributed-by: Aditya Kumar <hiraditya@msn.com> Differential Revision: http://reviews.llvm.org/D20953 llvm-svn: 271895
* [Analysis] Enabled BITREVERSE as a vectorizable intrinsicSimon Pilgrim2016-06-041-0/+1
| | | | | | Allows XOP to vectorize BITREVERSE - other targets will follow as their costmodels improve. llvm-svn: 271803
* Reapply r271728 after adding move cobstructor for ProfileSummaryInfoEaswaran Raman2016-06-032-0/+162
| | | | llvm-svn: 271745
* Revert r271728 as it breaks Windows buildEaswaran Raman2016-06-032-162/+0
| | | | llvm-svn: 271738
* Analysis pass to access profile summary infoEaswaran Raman2016-06-032-0/+162
| | | | | | Differential Revision: http://reviews.llvm.org/D20648 llvm-svn: 271728
OpenPOWER on IntegriCloud