llvm-6502/lib/Analysis
Dan Gohman fc3678a346 Fix SCEV denormalization of expressions where the exit value from
one loop is involved in the increment of an addrec for another
loop. This fixes rdar://8168938.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108863 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20 17:06:20 +00:00
..
IPA Speculatively revert r108813, in an attempt to get the self-host buildbots working again. I don't see why this patch 2010-07-20 08:26:15 +00:00
AliasAnalysis.cpp
AliasAnalysisCounter.cpp Speculatively revert r108813, in an attempt to get the self-host buildbots working again. I don't see why this patch 2010-07-20 08:26:15 +00:00
AliasAnalysisEvaluator.cpp
AliasDebugger.cpp Speculatively revert r108813, in an attempt to get the self-host buildbots working again. I don't see why this patch 2010-07-20 08:26:15 +00:00
AliasSetTracker.cpp
Analysis.cpp
BasicAliasAnalysis.cpp Speculatively revert r108813, in an attempt to get the self-host buildbots working again. I don't see why this patch 2010-07-20 08:26:15 +00:00
CaptureTracking.cpp
CFGPrinter.cpp
CMakeLists.txt
ConstantFolding.cpp
DbgInfoPrinter.cpp
DebugInfo.cpp Correct line info for declarations/definitions. Radar 8063111. 2010-07-19 23:56:30 +00:00
DomPrinter.cpp
InlineCost.cpp
InstCount.cpp
InstructionSimplify.cpp
Interval.cpp
IntervalPartition.cpp
IVUsers.cpp
LazyValueInfo.cpp
LibCallAliasAnalysis.cpp
LibCallSemantics.cpp
Lint.cpp
LiveValues.cpp
Loads.cpp
LoopDependenceAnalysis.cpp
LoopInfo.cpp
LoopPass.cpp
Makefile
MemoryBuiltins.cpp
MemoryDependenceAnalysis.cpp
ModuleDebugInfoPrinter.cpp
PHITransAddr.cpp
PointerTracking.cpp
PostDominators.cpp
ProfileEstimatorPass.cpp Speculatively revert r108813, in an attempt to get the self-host buildbots working again. I don't see why this patch 2010-07-20 08:26:15 +00:00
ProfileInfo.cpp Speculatively revert r108813, in an attempt to get the self-host buildbots working again. I don't see why this patch 2010-07-20 08:26:15 +00:00
ProfileInfoLoader.cpp
ProfileInfoLoaderPass.cpp Speculatively revert r108813, in an attempt to get the self-host buildbots working again. I don't see why this patch 2010-07-20 08:26:15 +00:00
ProfileVerifierPass.cpp
README.txt
ScalarEvolution.cpp Add a fast path for x - x. 2010-07-20 16:53:00 +00:00
ScalarEvolutionAliasAnalysis.cpp Speculatively revert r108813, in an attempt to get the self-host buildbots working again. I don't see why this patch 2010-07-20 08:26:15 +00:00
ScalarEvolutionExpander.cpp Simplify this code; LoopInfo::getCanonicalInductionVariable will only 2010-07-20 16:46:58 +00:00
ScalarEvolutionNormalization.cpp Fix SCEV denormalization of expressions where the exit value from 2010-07-20 17:06:20 +00:00
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))

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