llvm-6502/lib/Analysis
Duncan Sands 464a4f349c APInt has a method for determining whether a number is a power of 2
which is more efficient than countPopulation - use it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124283 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-26 08:44:16 +00:00
..
IPA
AliasAnalysis.cpp
AliasAnalysisCounter.cpp
AliasAnalysisEvaluator.cpp
AliasDebugger.cpp
AliasSetTracker.cpp
Analysis.cpp Move DominanceFrontier from VMCore to Analysis. 2011-01-18 06:06:27 +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 Move DominanceFrontier from VMCore to Analysis. 2011-01-18 06:06:27 +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
DIBuilder.cpp
DominanceFrontier.cpp Move DominanceFrontier from VMCore to Analysis. 2011-01-18 06:06:27 +00:00
DomPrinter.cpp
InlineCost.cpp Separate out the constant bonus from the size reduction metrics. Rework 2011-01-26 02:58:39 +00:00
InstCount.cpp
InstructionSimplify.cpp According to my auto-simplifier the most common missed simplifications in 2011-01-25 09:38:29 +00:00
Interval.cpp
IntervalPartition.cpp
IVUsers.cpp
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
Loads.cpp
LoopDependenceAnalysis.cpp
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
PHITransAddr.cpp
PostDominators.cpp
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
RegionPass.cpp
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
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))

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