llvm-6502/lib/Analysis
Pete Cooper f23c6af13d Convert PHI getIncomingValue() to foreach over incoming_values(). NFC.
We already had a method to iterate over all the incoming values of a PHI.  This just changes all eligible code to use it.

Ineligible code included anything which cared about the index, or was also trying to get the i'th incoming BB.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237169 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-12 20:05:31 +00:00
..
IPA [Inliner] Don't inline functions with frameescape calls 2015-04-14 20:38:14 +00:00
AliasAnalysis.cpp Make getModRefInfo(Instruction *) not crash on certain types of instructions 2015-04-28 19:19:14 +00:00
AliasAnalysisCounter.cpp Use 'override/final' instead of 'virtual' for overridden methods 2015-04-11 02:11:45 +00:00
AliasAnalysisEvaluator.cpp [CallSite] Make construction from Value* (or Instruction*) explicit. 2015-04-10 14:50:08 +00:00
AliasDebugger.cpp
AliasSetTracker.cpp [CallSite] Make construction from Value* (or Instruction*) explicit. 2015-04-10 14:50:08 +00:00
Analysis.cpp Divergence analysis for GPU programs 2015-04-10 05:03:50 +00:00
AssumptionCache.cpp
BasicAliasAnalysis.cpp Convert PHI getIncomingValue() to foreach over incoming_values(). NFC. 2015-05-12 20:05:31 +00:00
BlockFrequencyInfo.cpp Remove superfluous .str() and replace std::string concatenation with Twine. 2015-03-27 17:51:30 +00:00
BlockFrequencyInfoImpl.cpp Remove 4,096 loop scale limitation. 2015-04-01 17:42:27 +00:00
BranchProbabilityInfo.cpp Fix information loss in branch probability computation. 2015-05-07 17:22:06 +00:00
CaptureTracking.cpp
CFG.cpp
CFGPrinter.cpp Remove superfluous .str() and replace std::string concatenation with Twine. 2015-03-27 17:51:30 +00:00
CFLAliasAnalysis.cpp Convert PHI getIncomingValue() to foreach over incoming_values(). NFC. 2015-05-12 20:05:31 +00:00
CGSCCPassManager.cpp
CMakeLists.txt Move IDF Calculation to a separate file, expose an interface to it. 2015-04-21 19:13:02 +00:00
CodeMetrics.cpp Re-sort includes with sort-includes.py and insert raw_ostream.h where it's used. 2015-03-23 19:32:43 +00:00
ConstantFolding.cpp Convert PHI getIncomingValue() to foreach over incoming_values(). NFC. 2015-05-12 20:05:31 +00:00
CostModel.cpp
Delinearization.cpp
DependenceAnalysis.cpp
DivergenceAnalysis.cpp Divergence analysis for GPU programs 2015-04-10 05:03:50 +00:00
DominanceFrontier.cpp
DomPrinter.cpp
InstCount.cpp
InstructionSimplify.cpp Convert PHI getIncomingValue() to foreach over incoming_values(). NFC. 2015-05-12 20:05:31 +00:00
Interval.cpp
IntervalPartition.cpp
IteratedDominanceFrontier.cpp Move IDF Calculation to a separate file, expose an interface to it. 2015-04-21 19:13:02 +00:00
IVUsers.cpp
LazyCallGraph.cpp
LazyValueInfo.cpp
LibCallAliasAnalysis.cpp
LibCallSemantics.cpp [WinEH] Start EH preparation for 32-bit x86, it uses no arguments 2015-04-29 22:49:54 +00:00
Lint.cpp
LLVMBuild.txt
Loads.cpp
LoopAccessAnalysis.cpp [getUnderlyingOjbects] Analyze loop PHIs further to remove false positives 2015-04-23 20:09:20 +00:00
LoopInfo.cpp Fix -Wpessimizing-move warnings by removing std::move calls. 2015-04-30 23:07:00 +00:00
LoopPass.cpp Purge unused includes throughout libSupport. 2015-03-23 18:07:13 +00:00
Makefile
MemDepPrinter.cpp [CallSite] Make construction from Value* (or Instruction*) explicit. 2015-04-10 14:50:08 +00:00
MemDerefPrinter.cpp Move Value.isDereferenceablePointer to ValueTracking [NFC] 2015-04-23 17:36:48 +00:00
MemoryBuiltins.cpp
MemoryDependenceAnalysis.cpp Revamp PredIteratorCache interface to be cleaner. 2015-04-21 21:11:50 +00:00
ModuleDebugInfoPrinter.cpp IR: Give 'DI' prefix to debug info metadata 2015-04-29 16:38:44 +00:00
NoAliasAnalysis.cpp
PHITransAddr.cpp
PostDominators.cpp
PtrUseVisitor.cpp
README.txt
RegionInfo.cpp
RegionPass.cpp Change range-based for-loops to be -Wrange-loop-analysis clean. 2015-04-15 01:21:15 +00:00
RegionPrinter.cpp One more -Wrange-loop-analysis cleanup. 2015-04-15 21:40:50 +00:00
ScalarEvolution.cpp Fix a type mismatch assert in SCEV division 2015-04-22 15:06:40 +00:00
ScalarEvolutionAliasAnalysis.cpp
ScalarEvolutionExpander.cpp [SCEV] Strengthen SCEVExpander::isHighCostExpansion. 2015-04-14 03:20:32 +00:00
ScalarEvolutionNormalization.cpp
ScopedNoAliasAA.cpp
SparsePropagation.cpp
StratifiedSets.h
TargetLibraryInfo.cpp Populate list of vectorizable functions for Accelerate library. 2015-05-07 17:11:51 +00:00
TargetTransformInfo.cpp [X86] Disable loop unrolling in loop vectorization pass when VF is 1. 2015-05-06 17:12:25 +00:00
Trace.cpp
TypeBasedAliasAnalysis.cpp
ValueTracking.cpp Convert PHI getIncomingValue() to foreach over incoming_values(). NFC. 2015-05-12 20:05:31 +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))

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