llvm-6502/lib/Analysis
Adam Nemet b3189eac3f [LV] Move addRuntimeCheck to LoopAccessAnalysis
This will allow it to be shared with the new Loop Distribution pass.

getFirstInst is currently duplicated across LoopVectorize.cpp and
LoopAccessAnalysis.cpp.  This is a short-term work-around until we figure out
a better solution.

NFC.  (The code moved is adjusted a bit for the name of the Loop member and
that PtrRtCheck is now a reference rather than a pointer.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228418 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-06 18:31:04 +00:00
..
IPA Value soft float calls as more expensive in the inliner. 2015-02-05 02:09:33 +00:00
AliasAnalysis.cpp
AliasAnalysisCounter.cpp
AliasAnalysisEvaluator.cpp
AliasDebugger.cpp
AliasSetTracker.cpp
Analysis.cpp Introduce print-memderefs to test isDereferenceablePointer 2015-02-06 01:46:42 +00:00
AssumptionCache.cpp [PM] Actually add the new pass manager support for the assumption cache. 2015-01-22 21:53:09 +00:00
BasicAliasAnalysis.cpp
BlockFrequencyInfo.cpp
BlockFrequencyInfoImpl.cpp
BranchProbabilityInfo.cpp
CaptureTracking.cpp
CFG.cpp
CFGPrinter.cpp
CFLAliasAnalysis.cpp Fix incorrect partial aliasing 2015-01-26 17:31:17 +00:00
CGSCCPassManager.cpp
CMakeLists.txt Introduce print-memderefs to test isDereferenceablePointer 2015-02-06 01:46:42 +00:00
CodeMetrics.cpp
ConstantFolding.cpp
CostModel.cpp [multiversion] Thread a function argument through all the callers of the 2015-02-01 12:01:35 +00:00
Delinearization.cpp
DependenceAnalysis.cpp
DominanceFrontier.cpp
DomPrinter.cpp
InstCount.cpp
InstructionSimplify.cpp Fold fcmp in cases where value is provably non-negative. By Arch Robison. 2015-01-28 08:03:58 +00:00
Interval.cpp
IntervalPartition.cpp
IVUsers.cpp
JumpInstrTableInfo.cpp
LazyCallGraph.cpp
LazyValueInfo.cpp
LibCallAliasAnalysis.cpp
LibCallSemantics.cpp Move EH personality type classification to Analysis/LibCallSemantics.h 2015-01-28 01:17:38 +00:00
Lint.cpp
LLVMBuild.txt
Loads.cpp
LoopAccessAnalysis.cpp [LV] Move addRuntimeCheck to LoopAccessAnalysis 2015-02-06 18:31:04 +00:00
LoopInfo.cpp [PM] Port LoopInfo to the new pass manager, adding both a LoopAnalysis 2015-01-20 10:58:50 +00:00
LoopPass.cpp
Makefile
MemDepPrinter.cpp
MemDerefPrinter.cpp Introduce print-memderefs to test isDereferenceablePointer 2015-02-06 01:46:42 +00:00
MemoryBuiltins.cpp
MemoryDependenceAnalysis.cpp Whitespace. 2015-02-06 14:14:41 +00:00
ModuleDebugInfoPrinter.cpp
NoAliasAnalysis.cpp
PHITransAddr.cpp
PostDominators.cpp
PtrUseVisitor.cpp
README.txt
RegionInfo.cpp
RegionPass.cpp
RegionPrinter.cpp
ScalarEvolution.cpp Make ScalarEvolution less aggressive with respect to no-wrap flags. 2015-01-22 00:48:47 +00:00
ScalarEvolutionAliasAnalysis.cpp
ScalarEvolutionExpander.cpp
ScalarEvolutionNormalization.cpp
ScopedNoAliasAA.cpp
SparsePropagation.cpp
StratifiedSets.h
TargetLibraryInfo.cpp [PM] Rework how the TargetLibraryInfo pass integrates with the new pass 2015-01-24 02:06:09 +00:00
TargetTransformInfo.cpp Value soft float calls as more expensive in the inliner. 2015-02-05 02:09:33 +00:00
Trace.cpp
TypeBasedAliasAnalysis.cpp
ValueTracking.cpp ValueTracking: Make isSafeToSpeculativelyExecute a little cleaner 2015-02-01 19:10:19 +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))

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