llvm-6502/lib/Analysis
Dan Gohman c6743207e2 Factor out some of the code for updating old SCEVUnknown values, and
extend it to handle the case where multiple RAUWs affect a single
SCEVUnknown.

Add a ScalarEvolution unittest to test for this situation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109705 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-29 00:17:55 +00:00
..
IPA use Value* constructor of CallSite to create potentially improper site, and test that 2010-07-28 12:35:54 +00:00
AliasAnalysis.cpp
AliasAnalysisCounter.cpp
AliasAnalysisEvaluator.cpp simplify 2010-07-28 15:31:37 +00:00
AliasDebugger.cpp
AliasSetTracker.cpp simplify 2010-07-28 10:46:09 +00:00
Analysis.cpp
BasicAliasAnalysis.cpp
CaptureTracking.cpp simplify 2010-07-28 10:57:28 +00:00
CFGPrinter.cpp
CMakeLists.txt Add new RegionInfo pass. 2010-07-22 07:46:31 +00:00
ConstantFolding.cpp
DbgInfoPrinter.cpp
DebugInfo.cpp
DomPrinter.cpp
InlineCost.cpp use ImmutableCallSite for const-corrgoodness 2010-07-27 14:15:29 +00:00
InstCount.cpp
InstructionSimplify.cpp
Interval.cpp
IntervalPartition.cpp
IVUsers.cpp
LazyValueInfo.cpp Pass the queried value by argument rather than in a member, in preparation for supporting PHI translation. 2010-07-28 23:50:08 +00:00
LibCallAliasAnalysis.cpp
LibCallSemantics.cpp
Lint.cpp
LiveValues.cpp
Loads.cpp
LoopDependenceAnalysis.cpp
LoopInfo.cpp Eliminate getCanonicalInductionVariableIncrement's last user and 2010-07-23 21:34:51 +00:00
LoopPass.cpp
Makefile
MemoryBuiltins.cpp
MemoryDependenceAnalysis.cpp reintroduce original (asserting) semantics of CallSite(Instruction *II) 2010-07-27 22:53:28 +00:00
ModuleDebugInfoPrinter.cpp
PHITransAddr.cpp
PointerTracking.cpp
PostDominators.cpp
ProfileEstimatorPass.cpp
ProfileInfo.cpp
ProfileInfoLoader.cpp
ProfileInfoLoaderPass.cpp
ProfileVerifierPass.cpp
README.txt
RegionInfo.cpp RegionInfo: Make sure to free cached nodes; Tobias, please check! 2010-07-28 20:28:50 +00:00
RegionPrinter.cpp Add new RegionInfo pass. 2010-07-22 07:46:31 +00:00
ScalarEvolution.cpp Factor out some of the code for updating old SCEVUnknown values, and 2010-07-29 00:17:55 +00:00
ScalarEvolutionAliasAnalysis.cpp
ScalarEvolutionExpander.cpp Fix SCEVExpander::visitAddRecExpr so that it remembers the induction variable 2010-07-26 18:28:14 +00:00
ScalarEvolutionNormalization.cpp
SparsePropagation.cpp
Trace.cpp
ValueTracking.cpp

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))

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