2008-09-22 09:08:49 +08:00
|
|
|
add_llvm_library(LLVMAnalysis
|
|
|
|
AliasAnalysis.cpp
|
|
|
|
AliasAnalysisEvaluator.cpp
|
|
|
|
AliasSetTracker.cpp
|
|
|
|
Analysis.cpp
|
2015-01-04 20:03:27 +08:00
|
|
|
AssumptionCache.cpp
|
2008-09-22 09:08:49 +08:00
|
|
|
BasicAliasAnalysis.cpp
|
2016-05-11 02:07:21 +08:00
|
|
|
BitSetUtils.cpp
|
2011-07-26 03:25:40 +08:00
|
|
|
BlockFrequencyInfo.cpp
|
2014-04-22 01:57:07 +08:00
|
|
|
BlockFrequencyInfoImpl.cpp
|
2011-06-04 09:16:30 +08:00
|
|
|
BranchProbabilityInfo.cpp
|
2013-07-27 09:25:51 +08:00
|
|
|
CFG.cpp
|
2008-09-22 09:08:49 +08:00
|
|
|
CFGPrinter.cpp
|
2014-09-03 05:43:13 +08:00
|
|
|
CFLAliasAnalysis.cpp
|
2014-04-21 19:12:00 +08:00
|
|
|
CGSCCPassManager.cpp
|
2015-08-19 01:51:53 +08:00
|
|
|
CallGraph.cpp
|
|
|
|
CallGraphSCCPass.cpp
|
|
|
|
CallPrinter.cpp
|
2009-07-16 05:08:16 +08:00
|
|
|
CaptureTracking.cpp
|
2012-11-03 05:48:17 +08:00
|
|
|
CostModel.cpp
|
2012-03-16 13:51:52 +08:00
|
|
|
CodeMetrics.cpp
|
2008-09-22 09:08:49 +08:00
|
|
|
ConstantFolding.cpp
|
2013-11-13 06:47:20 +08:00
|
|
|
Delinearization.cpp
|
2015-08-14 19:09:09 +08:00
|
|
|
DemandedBits.cpp
|
dependence analysis
Patch from Preston Briggs <preston.briggs@gmail.com>.
This is an updated version of the dependence-analysis patch, including an MIV
test based on Banerjee's inequalities.
It's a fairly complete implementation of the paper
Practical Dependence Testing
Gina Goff, Ken Kennedy, and Chau-Wen Tseng
PLDI 1991
It cannot yet propagate constraints between coupled RDIV subscripts (discussed
in Section 5.3.2 of the paper).
It's organized as a FunctionPass with a single entry point that supports testing
for dependence between two instructions in a function. If there's no dependence,
it returns null. If there's a dependence, it returns a pointer to a Dependence
which can be queried about details (what kind of dependence, is it loop
independent, direction and distance vector entries, etc). I haven't included
every imaginable feature, but there's a good selection that should be adequate
for supporting many loop transformations. Of course, it can be extended as
necessary.
Included in the patch file are many test cases, commented with C code showing
the loops and array references.
llvm-svn: 165708
2012-10-11 15:32:34 +08:00
|
|
|
DependenceAnalysis.cpp
|
Divergence analysis for GPU programs
Summary:
Some optimizations such as jump threading and loop unswitching can negatively
affect performance when applied to divergent branches. The divergence analysis
added in this patch conservatively estimates which branches in a GPU program
can diverge. This information can then help LLVM to run certain optimizations
selectively.
Test Plan: test/Analysis/DivergenceAnalysis/NVPTX/diverge.ll
Reviewers: resistor, hfinkel, eliben, meheff, jholewinski
Subscribers: broune, bjarke.roune, madhur13490, tstellarAMD, dberlin, echristo, jholewinski, llvm-commits
Differential Revision: http://reviews.llvm.org/D8576
llvm-svn: 234567
2015-04-10 13:03:50 +08:00
|
|
|
DivergenceAnalysis.cpp
|
2009-10-18 12:10:40 +08:00
|
|
|
DomPrinter.cpp
|
2011-03-01 08:02:51 +08:00
|
|
|
DominanceFrontier.cpp
|
2015-12-03 07:06:39 +08:00
|
|
|
EHPersonalities.cpp
|
2015-08-19 01:51:53 +08:00
|
|
|
GlobalsModRef.cpp
|
2009-07-16 05:08:16 +08:00
|
|
|
IVUsers.cpp
|
2015-08-19 01:51:53 +08:00
|
|
|
InlineCost.cpp
|
2008-09-22 09:08:49 +08:00
|
|
|
InstCount.cpp
|
2009-11-10 06:57:59 +08:00
|
|
|
InstructionSimplify.cpp
|
2008-09-22 09:08:49 +08:00
|
|
|
Interval.cpp
|
|
|
|
IntervalPartition.cpp
|
2015-04-22 03:13:02 +08:00
|
|
|
IteratedDominanceFrontier.cpp
|
2014-02-06 12:37:03 +08:00
|
|
|
LazyCallGraph.cpp
|
2009-11-11 08:22:30 +08:00
|
|
|
LazyValueInfo.cpp
|
2010-04-09 02:52:18 +08:00
|
|
|
Lint.cpp
|
2010-05-29 00:19:17 +08:00
|
|
|
Loads.cpp
|
2015-02-02 00:56:15 +08:00
|
|
|
LoopAccessAnalysis.cpp
|
2016-02-09 07:03:59 +08:00
|
|
|
LoopUnrollAnalyzer.cpp
|
2008-09-22 09:08:49 +08:00
|
|
|
LoopInfo.cpp
|
|
|
|
LoopPass.cpp
|
2016-02-25 15:23:08 +08:00
|
|
|
LoopPassManager.cpp
|
2010-09-17 07:06:18 +08:00
|
|
|
MemDepPrinter.cpp
|
2015-02-06 09:46:42 +08:00
|
|
|
MemDerefPrinter.cpp
|
2009-10-28 04:05:49 +08:00
|
|
|
MemoryBuiltins.cpp
|
2008-09-22 09:08:49 +08:00
|
|
|
MemoryDependenceAnalysis.cpp
|
2015-06-04 10:03:15 +08:00
|
|
|
MemoryLocation.cpp
|
2010-05-08 00:22:32 +08:00
|
|
|
ModuleDebugInfoPrinter.cpp
|
2016-04-11 21:58:45 +08:00
|
|
|
ModuleSummaryAnalysis.cpp
|
2015-08-20 16:06:03 +08:00
|
|
|
ObjCARCAliasAnalysis.cpp
|
|
|
|
ObjCARCAnalysisUtils.cpp
|
|
|
|
ObjCARCInstKind.cpp
|
2015-07-31 22:31:35 +08:00
|
|
|
OrderedBasicBlock.cpp
|
2011-03-01 08:02:51 +08:00
|
|
|
PHITransAddr.cpp
|
2008-09-22 09:08:49 +08:00
|
|
|
PostDominators.cpp
|
2016-06-04 06:54:26 +08:00
|
|
|
ProfileSummaryInfo.cpp
|
Add a new visitor for walking the uses of a pointer value.
This visitor provides infrastructure for recursively traversing the
use-graph of a pointer-producing instruction like an alloca or a malloc.
It maintains a worklist of uses to visit, so it can handle very deep
recursions. It automatically looks through instructions which simply
translate one pointer to another (bitcasts and GEPs). It tracks the
offset relative to the original pointer as long as that offset remains
constant and exposes it during the visit as an APInt offset. Finally, it
performs conservative escape analysis.
However, currently it has some limitations that should be addressed
going forward:
1) It doesn't handle vectors of pointers.
2) It doesn't provide a cheaper visitor when the constant offset
tracking isn't needed.
3) It doesn't support non-instruction pointer values.
The current functionality is exactly what is required to implement the
SROA pointer-use visitors in terms of this one, rather than in terms of
their own ad-hoc base visitor, which was always very poorly specified.
SROA has been converted to use this, and the code there deleted which
this utility now provides.
Technically speaking, using this new visitor allows SROA to handle a few
more cases than it previously did. It is now more aggressive in ignoring
chains of instructions which look like they would defeat SROA, but in
fact do not because they never result in a read or write of memory.
While this is "neat", it shouldn't be interesting for real programs as
any such chains should have been removed by others passes long before we
get to SROA. As a consequence, I've not added any tests for these
features -- it shouldn't be part of SROA's contract to perform such
heroics.
The goal is to extend the functionality of this visitor going forward,
and re-use it from passes like ASan that can benefit from doing
a detailed walk of the uses of a pointer.
Thanks to Ben Kramer for the code review rounds and lots of help
reviewing and debugging this patch.
llvm-svn: 169728
2012-12-10 16:28:39 +08:00
|
|
|
PtrUseVisitor.cpp
|
2010-07-22 15:46:31 +08:00
|
|
|
RegionInfo.cpp
|
2010-10-20 09:54:44 +08:00
|
|
|
RegionPass.cpp
|
2010-07-22 15:46:31 +08:00
|
|
|
RegionPrinter.cpp
|
2008-09-22 09:08:49 +08:00
|
|
|
ScalarEvolution.cpp
|
2009-08-27 00:33:57 +08:00
|
|
|
ScalarEvolutionAliasAnalysis.cpp
|
2008-09-22 09:08:49 +08:00
|
|
|
ScalarEvolutionExpander.cpp
|
2010-04-08 07:01:37 +08:00
|
|
|
ScalarEvolutionNormalization.cpp
|
2008-09-22 09:08:49 +08:00
|
|
|
SparsePropagation.cpp
|
2015-01-15 10:16:27 +08:00
|
|
|
TargetLibraryInfo.cpp
|
2013-01-07 11:08:10 +08:00
|
|
|
TargetTransformInfo.cpp
|
2008-09-22 09:08:49 +08:00
|
|
|
Trace.cpp
|
2010-08-03 10:38:20 +08:00
|
|
|
TypeBasedAliasAnalysis.cpp
|
Add scoped-noalias metadata
This commit adds scoped noalias metadata. The primary motivations for this
feature are:
1. To preserve noalias function attribute information when inlining
2. To provide the ability to model block-scope C99 restrict pointers
Neither of these two abilities are added here, only the necessary
infrastructure. In fact, there should be no change to existing functionality,
only the addition of new features. The logic that converts noalias function
parameters into this metadata during inlining will come in a follow-up commit.
What is added here is the ability to generally specify noalias memory-access
sets. Regarding the metadata, alias-analysis scopes are defined similar to TBAA
nodes:
!scope0 = metadata !{ metadata !"scope of foo()" }
!scope1 = metadata !{ metadata !"scope 1", metadata !scope0 }
!scope2 = metadata !{ metadata !"scope 2", metadata !scope0 }
!scope3 = metadata !{ metadata !"scope 2.1", metadata !scope2 }
!scope4 = metadata !{ metadata !"scope 2.2", metadata !scope2 }
Loads and stores can be tagged with an alias-analysis scope, and also, with a
noalias tag for a specific scope:
... = load %ptr1, !alias.scope !{ !scope1 }
... = load %ptr2, !alias.scope !{ !scope1, !scope2 }, !noalias !{ !scope1 }
When evaluating an aliasing query, if one of the instructions is associated
with an alias.scope id that is identical to the noalias scope associated with
the other instruction, or is a descendant (in the scope hierarchy) of the
noalias scope associated with the other instruction, then the two memory
accesses are assumed not to alias.
Note that is the first element of the scope metadata is a string, then it can
be combined accross functions and translation units. The string can be replaced
by a self-reference to create globally unqiue scope identifiers.
[Note: This overview is slightly stylized, since the metadata nodes really need
to just be numbers (!0 instead of !scope0), and the scope lists are also global
unnamed metadata.]
Existing noalias metadata in a callee is "cloned" for use by the inlined code.
This is necessary because the aliasing scopes are unique to each call site
(because of possible control dependencies on the aliasing properties). For
example, consider a function: foo(noalias a, noalias b) { *a = *b; } that gets
inlined into bar() { ... if (...) foo(a1, b1); ... if (...) foo(a2, b2); } --
now just because we know that a1 does not alias with b1 at the first call site,
and a2 does not alias with b2 at the second call site, we cannot let inlining
these functons have the metadata imply that a1 does not alias with b2.
llvm-svn: 213864
2014-07-24 22:25:39 +08:00
|
|
|
ScopedNoAliasAA.cpp
|
2008-09-22 09:08:49 +08:00
|
|
|
ValueTracking.cpp
|
2015-06-27 02:02:52 +08:00
|
|
|
VectorUtils.cpp
|
2015-02-11 11:28:02 +08:00
|
|
|
|
|
|
|
ADDITIONAL_HEADER_DIRS
|
|
|
|
${LLVM_MAIN_INCLUDE_DIR}/llvm/Analysis
|
2008-09-22 09:08:49 +08:00
|
|
|
)
|
2011-02-19 06:06:14 +08:00
|
|
|
|
2012-06-24 21:32:01 +08:00
|
|
|
add_dependencies(LLVMAnalysis intrinsics_gen)
|