llvm-6502/lib/Analysis
Hans Wennborg ec4e924836 Revert "Teach the load analysis to allow finding available values which require" (r220277)
This seems to have caused PR21330.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220349 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-21 23:49:52 +00:00
..
IPA
AliasAnalysis.cpp Make AAMDNodes ctor and operator bool (!!!) explicit, mop up bugs and weirdness exposed by it. 2014-10-04 22:44:29 +00:00
AliasAnalysisCounter.cpp
AliasAnalysisEvaluator.cpp
AliasDebugger.cpp
AliasSetTracker.cpp
Analysis.cpp
AssumptionTracker.cpp AssumptionTracker: Don't create temporary CallbackVHs. 2014-10-11 19:13:01 +00:00
BasicAliasAnalysis.cpp Revert "[BasicAA] Revert "Revert r218714 - Make better use of zext and sign information."" 2014-10-09 19:48:12 +00:00
BlockFrequencyInfo.cpp
BlockFrequencyInfoImpl.cpp [modules] Stop excluding Support/Debug.h from the Support module. This header 2014-10-13 00:41:03 +00:00
BranchProbabilityInfo.cpp
CaptureTracking.cpp
CFG.cpp
CFGPrinter.cpp
CFLAliasAnalysis.cpp [CFL-AA] CFL-AA should not assert on an va_arg instruction 2014-10-14 20:51:26 +00:00
CGSCCPassManager.cpp
CMakeLists.txt
CodeMetrics.cpp Treat the WorkSet used to find ephemeral values as double-ended 2014-10-15 17:34:48 +00:00
ConstantFolding.cpp Add minnum / maxnum intrinsics 2014-10-21 23:00:20 +00:00
CostModel.cpp
Delinearization.cpp
DependenceAnalysis.cpp
DominanceFrontier.cpp
DomPrinter.cpp
FunctionTargetTransformInfo.cpp
InstCount.cpp
InstructionSimplify.cpp InstCombine, InstSimplify: (%X /s C1) /s C2 isn't always 0 when C1 * C2 overflow 2014-10-11 10:20:01 +00:00
Interval.cpp
IntervalPartition.cpp
IVUsers.cpp
JumpInstrTableInfo.cpp
LazyCallGraph.cpp
LazyValueInfo.cpp [LVI] Add some additional comments about caching and context instructions 2014-10-16 00:40:05 +00:00
LibCallAliasAnalysis.cpp
LibCallSemantics.cpp remove function names from comments; NFC 2014-10-21 18:26:57 +00:00
Lint.cpp
LLVMBuild.txt
Loads.cpp Revert "Teach the load analysis to allow finding available values which require" (r220277) 2014-10-21 23:49:52 +00:00
LoopInfo.cpp Introduce enum values for previously defined metadata types. (NFC) 2014-10-21 00:13:20 +00:00
LoopPass.cpp
Makefile
MemDepPrinter.cpp
MemoryBuiltins.cpp PR21145: Teach LLVM about C++14 sized deallocation functions. 2014-10-03 20:17:06 +00:00
MemoryDependenceAnalysis.cpp
ModuleDebugInfoPrinter.cpp
NoAliasAnalysis.cpp Simplify code. No functionality change. 2014-10-05 12:21:57 +00:00
PHITransAddr.cpp
PostDominators.cpp
PtrUseVisitor.cpp
README.txt
RegionInfo.cpp
RegionPass.cpp
RegionPrinter.cpp
ScalarEvolution.cpp Revert "r219834 - Teach ScalarEvolution to sharpen range information" 2014-10-15 23:46:04 +00:00
ScalarEvolutionAliasAnalysis.cpp
ScalarEvolutionExpander.cpp
ScalarEvolutionNormalization.cpp
ScopedNoAliasAA.cpp
SparsePropagation.cpp
StratifiedSets.h
TargetTransformInfo.cpp Add minnum / maxnum intrinsics 2014-10-21 23:00:20 +00:00
Trace.cpp
TypeBasedAliasAnalysis.cpp
ValueTracking.cpp Add minnum / maxnum intrinsics 2014-10-21 23:00:20 +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))

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