llvm-6502/lib/Analysis
David Majnemer 9e8b7214ed ValueTracking: Make isSafeToSpeculativelyExecute a little cleaner
No functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227760 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 19:10:19 +00:00
..
IPA [multiversion] Thread a function argument through all the callers of the 2015-02-01 12:01:35 +00:00
AliasAnalysis.cpp
AliasAnalysisCounter.cpp
AliasAnalysisEvaluator.cpp
AliasDebugger.cpp
AliasSetTracker.cpp
Analysis.cpp [PM] Change the core design of the TTI analysis to use a polymorphic 2015-01-31 03:43:40 +00:00
AssumptionCache.cpp
BasicAliasAnalysis.cpp
BlockFrequencyInfo.cpp
BlockFrequencyInfoImpl.cpp
BranchProbabilityInfo.cpp
CaptureTracking.cpp
CFG.cpp
CFGPrinter.cpp
CFLAliasAnalysis.cpp Fix incorrect partial aliasing 2015-01-26 17:31:17 +00:00
CGSCCPassManager.cpp
CMakeLists.txt [LoopVectorize] Move LoopAccessAnalysis to its own module 2015-02-01 16:56:15 +00:00
CodeMetrics.cpp
ConstantFolding.cpp
CostModel.cpp [multiversion] Thread a function argument through all the callers of the 2015-02-01 12:01:35 +00:00
Delinearization.cpp
DependenceAnalysis.cpp
DominanceFrontier.cpp
DomPrinter.cpp
InstCount.cpp
InstructionSimplify.cpp Fold fcmp in cases where value is provably non-negative. By Arch Robison. 2015-01-28 08:03:58 +00:00
Interval.cpp
IntervalPartition.cpp
IVUsers.cpp
JumpInstrTableInfo.cpp
LazyCallGraph.cpp
LazyValueInfo.cpp
LibCallAliasAnalysis.cpp
LibCallSemantics.cpp Move EH personality type classification to Analysis/LibCallSemantics.h 2015-01-28 01:17:38 +00:00
Lint.cpp
LLVMBuild.txt
Loads.cpp
LoopAccessAnalysis.cpp [LoopVectorize] Move LoopAccessAnalysis to its own module 2015-02-01 16:56:15 +00:00
LoopInfo.cpp
LoopPass.cpp
Makefile
MemDepPrinter.cpp
MemoryBuiltins.cpp
MemoryDependenceAnalysis.cpp Refine memory dependence's notion of volatile semantics 2015-01-26 18:54:27 +00:00
ModuleDebugInfoPrinter.cpp
NoAliasAnalysis.cpp
PHITransAddr.cpp
PostDominators.cpp
PtrUseVisitor.cpp
README.txt
RegionInfo.cpp
RegionPass.cpp
RegionPrinter.cpp
ScalarEvolution.cpp
ScalarEvolutionAliasAnalysis.cpp
ScalarEvolutionExpander.cpp
ScalarEvolutionNormalization.cpp
ScopedNoAliasAA.cpp
SparsePropagation.cpp
StratifiedSets.h
TargetLibraryInfo.cpp
TargetTransformInfo.cpp [multiversion] Remove the function parameter from the unrolling 2015-02-01 14:31:23 +00:00
Trace.cpp
TypeBasedAliasAnalysis.cpp
ValueTracking.cpp ValueTracking: Make isSafeToSpeculativelyExecute a little cleaner 2015-02-01 19:10:19 +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))

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