llvm-6502/lib/Analysis
Chandler Carruth dc967a97df [PM/AA] Start refactoring AliasAnalysis to remove the analysis group and
port it to the new pass manager.

All this does is extract the inner "location" class used by AA into its
own full fledged type. This seems *much* cleaner as MemoryDependence and
soon MemorySSA also use this heavily, and it doesn't make much sense
being inside the AA infrastructure.

This will also make it much easier to break apart the AA infrastructure
into something that stands on its own rather than using the analysis
group design.

There are a few places where this makes APIs not make sense -- they were
taking an AliasAnalysis pointer just to build locations. I'll try to
clean those up in follow-up commits.

Differential Revision: http://reviews.llvm.org/D10228

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239003 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-04 02:03:15 +00:00
..
IPA [inliner] Fix the early-exit of the inline cost analysis to correctly 2015-05-27 02:49:05 +00:00
AliasAnalysis.cpp [PM/AA] Start refactoring AliasAnalysis to remove the analysis group and 2015-06-04 02:03:15 +00:00
AliasAnalysisCounter.cpp
AliasAnalysisEvaluator.cpp [PM/AA] Start refactoring AliasAnalysis to remove the analysis group and 2015-06-04 02:03:15 +00:00
AliasDebugger.cpp
AliasSetTracker.cpp Replace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial types 2015-05-29 19:43:39 +00:00
Analysis.cpp
AssumptionCache.cpp
BasicAliasAnalysis.cpp Revert r236894 "[BasicAA] Fix zext & sext handling" 2015-05-22 01:27:37 +00:00
BlockFrequencyInfo.cpp
BlockFrequencyInfoImpl.cpp
BranchProbabilityInfo.cpp Add BranchProbabilityInfo::releaseMemory to clear the Weights field. 2015-05-28 19:43:06 +00:00
CaptureTracking.cpp
CFG.cpp
CFGPrinter.cpp
CFLAliasAnalysis.cpp
CGSCCPassManager.cpp
CMakeLists.txt [PM/AA] Start refactoring AliasAnalysis to remove the analysis group and 2015-06-04 02:03:15 +00:00
CodeMetrics.cpp
ConstantFolding.cpp
CostModel.cpp
Delinearization.cpp
DependenceAnalysis.cpp [DependenceAnalysis] Extend unifySubscriptType for handling coupled subscript groups. 2015-05-29 16:58:08 +00:00
DivergenceAnalysis.cpp
DominanceFrontier.cpp
DomPrinter.cpp
InstCount.cpp
InstructionSimplify.cpp [InstSimplify] Handle some overflow intrinsics in InstSimplify 2015-05-22 03:56:46 +00:00
Interval.cpp
IntervalPartition.cpp
IteratedDominanceFrontier.cpp
IVUsers.cpp
LazyCallGraph.cpp
LazyValueInfo.cpp
LibCallAliasAnalysis.cpp
LibCallSemantics.cpp
Lint.cpp
LLVMBuild.txt
Loads.cpp
LoopAccessAnalysis.cpp [PM/AA] Start refactoring AliasAnalysis to remove the analysis group and 2015-06-04 02:03:15 +00:00
LoopInfo.cpp
LoopPass.cpp
Makefile
MemDepPrinter.cpp
MemDerefPrinter.cpp Test commit. Fix typo in MemDerefPrinter.cpp comment. 2015-05-21 11:57:38 +00:00
MemoryBuiltins.cpp
MemoryDependenceAnalysis.cpp [PM/AA] Start refactoring AliasAnalysis to remove the analysis group and 2015-06-04 02:03:15 +00:00
MemoryLocation.cpp [PM/AA] Start refactoring AliasAnalysis to remove the analysis group and 2015-06-04 02:03:15 +00:00
ModuleDebugInfoPrinter.cpp
NoAliasAnalysis.cpp
PHITransAddr.cpp [PHITransAddr] Don't translate unreachable values 2015-06-01 00:15:08 +00:00
PostDominators.cpp
PtrUseVisitor.cpp
README.txt
RegionInfo.cpp
RegionPass.cpp
RegionPrinter.cpp
ScalarEvolution.cpp [ScalarEvolution] refactor: extract interface getGEPExpr 2015-05-18 17:03:25 +00:00
ScalarEvolutionAliasAnalysis.cpp
ScalarEvolutionExpander.cpp Replace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial types 2015-05-29 19:43:39 +00:00
ScalarEvolutionNormalization.cpp
ScopedNoAliasAA.cpp
SparsePropagation.cpp
StratifiedSets.h
TargetLibraryInfo.cpp
TargetTransformInfo.cpp
Trace.cpp
TypeBasedAliasAnalysis.cpp
ValueTracking.cpp Reapply r237539 with a fix for the Chromium build. 2015-05-20 18:41:25 +00:00

Analysis Opportunities:

//===---------------------------------------------------------------------===//

In test/Transforms/LoopStrengthReduce/quadradic-exit-value.ll, the
ScalarEvolution expression for %r is this:

  {1,+,3,+,2}<loop>

Outside the loop, this could be evaluated simply as (%n * %n), however
ScalarEvolution currently evaluates it as

  (-2 + (2 * (trunc i65 (((zext i64 (-2 + %n) to i65) * (zext i64 (-1 + %n) to i65)) /u 2) to i64)) + (3 * %n))

In addition to being much more complicated, it involves i65 arithmetic,
which is very inefficient when expanded into code.

//===---------------------------------------------------------------------===//

In formatValue in test/CodeGen/X86/lsr-delayed-fold.ll,

ScalarEvolution is forming this expression:

((trunc i64 (-1 * %arg5) to i32) + (trunc i64 %arg5 to i32) + (-1 * (trunc i64 undef to i32)))

This could be folded to

(-1 * (trunc i64 undef to i32))

//===---------------------------------------------------------------------===//