llvm-6502/lib/Analysis
Andrew Trick 04317cc618 Implementation of path profiling.
Modified patch by Adam Preuss.

This builds on the existing framework for block tracing, edge profiling and optimal edge profiling.
See -help-hidden for new flags.
For documentation, see the technical report "Implementation of Path Profiling..." in llvm.org/pubs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124515 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-29 01:09:53 +00:00
..
IPA Use the new addEscapingValue callback to update GlobalsModRef when GVN adds PHIs of GEPs. For the moment, 2011-01-03 23:51:43 +00:00
AliasAnalysis.cpp Stub out a new updating interface to AliasAnalysis, allowing stateful analyses to be informed when 2011-01-03 21:38:41 +00:00
AliasAnalysisCounter.cpp Teach AliasAnalysisCounter about PartialAlias. 2010-12-10 19:53:05 +00:00
AliasAnalysisEvaluator.cpp Teach AliasAnalysisEvaluator about PartialAlias. 2010-12-10 19:52:40 +00:00
AliasDebugger.cpp
AliasSetTracker.cpp Update this code to handle PartialAlias as MayAlias. 2010-12-10 19:40:47 +00:00
Analysis.cpp Implementation of path profiling. 2011-01-29 01:09:53 +00:00
BasicAliasAnalysis.cpp Give GetUnderlyingObject a TargetData, to keep it in sync 2011-01-24 18:53:32 +00:00
CaptureTracking.cpp
CFGPrinter.cpp
CMakeLists.txt Implementation of path profiling. 2011-01-29 01:09:53 +00:00
ConstantFolding.cpp Give GetUnderlyingObject a TargetData, to keep it in sync 2011-01-24 18:53:32 +00:00
DbgInfoPrinter.cpp
DebugInfo.cpp Add support to create class type. 2010-12-08 20:18:20 +00:00
DIBuilder.cpp Use type's file info while describing inheritance relationship. 2010-12-08 21:46:37 +00:00
DominanceFrontier.cpp Move DominanceFrontier from VMCore to Analysis. 2011-01-18 06:06:27 +00:00
DomPrinter.cpp split dom frontier handling stuff out to its own DominanceFrontier header, 2011-01-02 22:09:33 +00:00
InlineCost.cpp Temporarily revert 124275 to see if it brings the dragonegg buildbot back. 2011-01-26 19:40:31 +00:00
InstCount.cpp
InstructionSimplify.cpp This dyn_cast should be a cast. Pointed out by Frits van Bommel. 2011-01-28 18:53:08 +00:00
Interval.cpp
IntervalPartition.cpp
IVUsers.cpp split dom frontier handling stuff out to its own DominanceFrontier header, 2011-01-02 22:09:33 +00:00
LazyValueInfo.cpp Teach LazyValueInfo that allocas aren't NULL. Over all of llvm-test, this saves 2011-01-15 09:16:12 +00:00
LibCallAliasAnalysis.cpp
LibCallSemantics.cpp
Lint.cpp Give GetUnderlyingObject a TargetData, to keep it in sync 2011-01-24 18:53:32 +00:00
LiveValues.cpp split dom frontier handling stuff out to its own DominanceFrontier header, 2011-01-02 22:09:33 +00:00
Loads.cpp Move Value::getUnderlyingObject to be a standalone 2010-12-15 20:02:24 +00:00
LoopDependenceAnalysis.cpp split dom frontier handling stuff out to its own DominanceFrontier header, 2011-01-02 22:09:33 +00:00
LoopInfo.cpp
LoopPass.cpp
Makefile
MemDepPrinter.cpp
MemoryBuiltins.cpp
MemoryDependenceAnalysis.cpp Give GetUnderlyingObject a TargetData, to keep it in sync 2011-01-24 18:53:32 +00:00
ModuleDebugInfoPrinter.cpp
NoAliasAnalysis.cpp Use the new addEscapingValue callback to update GlobalsModRef when GVN adds PHIs of GEPs. For the moment, 2011-01-03 23:51:43 +00:00
PathNumbering.cpp Implementation of path profiling. 2011-01-29 01:09:53 +00:00
PathProfileInfo.cpp Implementation of path profiling. 2011-01-29 01:09:53 +00:00
PathProfileVerifier.cpp Implementation of path profiling. 2011-01-29 01:09:53 +00:00
PHITransAddr.cpp split dom frontier handling stuff out to its own DominanceFrontier header, 2011-01-02 22:09:33 +00:00
PostDominators.cpp split dom frontier handling stuff out to its own DominanceFrontier header, 2011-01-02 22:09:33 +00:00
ProfileEstimatorPass.cpp fix PR8928 by clearing a stale map, patch by Jakub Staszak! 2011-01-24 18:36:51 +00:00
ProfileInfo.cpp Null initialize a few variables flagged by 2011-01-23 17:05:06 +00:00
ProfileInfoLoader.cpp
ProfileInfoLoaderPass.cpp
ProfileVerifierPass.cpp
README.txt
RegionInfo.cpp Add single entry / single exit accessors. 2011-01-13 23:18:04 +00:00
RegionPass.cpp Remove useless dynamic_cast<>(). 2010-12-12 21:58:28 +00:00
RegionPrinter.cpp
ScalarEvolution.cpp Fix memory corruption. If one of the SCEV creation functions calls another but 2011-01-26 08:40:22 +00:00
ScalarEvolutionAliasAnalysis.cpp
ScalarEvolutionExpander.cpp
ScalarEvolutionNormalization.cpp
SparsePropagation.cpp
Trace.cpp
TypeBasedAliasAnalysis.cpp Update a comment. 2010-12-16 02:55:10 +00:00
ValueTracking.cpp APInt has a method for determining whether a number is a power of 2 2011-01-26 08:44:16 +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))

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