llvm-6502/lib/Analysis
Chris Lattner c10ecd8f23 fix a really nasty basicaa mod/ref calculation bug that was causing miscompilation of
UnitTests/ObjC/messages-2.m with the recent optimizer improvements.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131897 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-23 05:15:43 +00:00
..
IPA Fix a source of non determinism in FindUsedTypes, use a SetVector instead of a 2011-05-13 05:20:42 +00:00
AliasAnalysis.cpp
AliasAnalysisCounter.cpp
AliasAnalysisEvaluator.cpp
AliasDebugger.cpp
AliasSetTracker.cpp
Analysis.cpp
BasicAliasAnalysis.cpp fix a really nasty basicaa mod/ref calculation bug that was causing miscompilation of 2011-05-23 05:15:43 +00:00
CaptureTracking.cpp
CFGPrinter.cpp
CMakeLists.txt
ConstantFolding.cpp implement PR9315, constant folding exp2 in terms of pow (since hosts without 2011-05-22 22:22:35 +00:00
DbgInfoPrinter.cpp
DebugInfo.cpp
DIBuilder.cpp
DominanceFrontier.cpp
DomPrinter.cpp
InlineCost.cpp Extra refactoring noticed by Eli Friedman. 2011-05-16 15:48:45 +00:00
InstCount.cpp
InstructionSimplify.cpp The comparision "max(x,y)==x" is equivalent to "x>=y". Since the max is 2011-05-07 16:56:49 +00:00
Interval.cpp
IntervalPartition.cpp
IVUsers.cpp indvars: Prototyping Sign/ZeroExtend elimination without canonical IVs. 2011-05-20 18:25:42 +00:00
LazyValueInfo.cpp
LibCallAliasAnalysis.cpp
LibCallSemantics.cpp
Lint.cpp
Loads.cpp
LoopDependenceAnalysis.cpp
LoopInfo.cpp
LoopPass.cpp
Makefile
MemDepPrinter.cpp
MemoryBuiltins.cpp
MemoryDependenceAnalysis.cpp @llvm.lifetime.begin acts as a load, not @llvm.lifetime.end. 2011-05-17 00:05:49 +00:00
ModuleDebugInfoPrinter.cpp
NoAliasAnalysis.cpp
PathNumbering.cpp
PathProfileInfo.cpp
PathProfileVerifier.cpp
PHITransAddr.cpp
PostDominators.cpp
ProfileEstimatorPass.cpp
ProfileInfo.cpp
ProfileInfoLoader.cpp
ProfileInfoLoaderPass.cpp
ProfileVerifierPass.cpp
README.txt
RegionInfo.cpp
RegionPass.cpp Minor change: Fix the typo in RegionPass.h and RegionPass.cpp. 2011-05-05 13:59:38 +00:00
RegionPrinter.cpp
ScalarEvolution.cpp Change a few std::maps to DenseMaps. 2011-05-09 18:44:09 +00:00
ScalarEvolutionAliasAnalysis.cpp
ScalarEvolutionExpander.cpp
ScalarEvolutionNormalization.cpp
SparsePropagation.cpp
Trace.cpp
TypeBasedAliasAnalysis.cpp
ValueTracking.cpp Teach valuetracking that byval arguments with a specified alignment are 2011-05-23 00:03:39 +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))

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