llvm-6502/lib/Analysis
Karthik Bhat 5f9683f54f Fix a crash in Dependency Analysis.
This crash in Dependency analysis is because we assume here that in case of UsefulGEP
both source and destination have the same number of operands which may not be true.
This incorrect assumption results in crash while populating Pairs. Fix the same.

This crash was observed during lnt regression for code such as-
  struct s{
    int A[10][10];
    int C[10][10][10]; 
  } S;
  void dep_constraint_crash_test(int k,int N)  {
     for( int i=0;i<N;i++)
       for( int j=0;j<N;j++)
         S.A[0][0] = S.C[0][0][k];
  }
Review: http://reviews.llvm.org/D8162



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231784 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 13:31:03 +00:00
..
IPA removed function names from comments; NFC 2015-03-10 03:48:14 +00:00
AliasAnalysis.cpp DataLayout is mandatory, update the API to reflect it with references. 2015-03-10 02:37:25 +00:00
AliasAnalysisCounter.cpp Make DataLayout Non-Optional in the Module 2015-03-04 18:43:29 +00:00
AliasAnalysisEvaluator.cpp AA metadata refactoring (introduce AAMDNodes) 2014-07-24 12:16:19 +00:00
AliasDebugger.cpp Make DataLayout Non-Optional in the Module 2015-03-04 18:43:29 +00:00
AliasSetTracker.cpp AliasSet: Simplify mergeSetIn 2014-11-19 19:36:18 +00:00
Analysis.cpp Remove the Forward Control Flow Integrity pass and its dependencies. 2015-02-27 19:03:38 +00:00
AssumptionCache.cpp [PM] Actually add the new pass manager support for the assumption cache. 2015-01-22 21:53:09 +00:00
BasicAliasAnalysis.cpp DataLayout is mandatory, update the API to reflect it with references. 2015-03-10 02:37:25 +00:00
BlockFrequencyInfo.cpp [PM] Split the LoopInfo object apart from the legacy pass, creating 2015-01-17 14:16:18 +00:00
BlockFrequencyInfoImpl.cpp BFI: Saturate when combining edges to a successor 2014-12-05 19:13:42 +00:00
BranchProbabilityInfo.cpp [PM] Split the LoopInfo object apart from the legacy pass, creating 2015-01-17 14:16:18 +00:00
CaptureTracking.cpp [cleanup] Re-sort all the #include lines in LLVM using 2015-01-14 11:23:27 +00:00
CFG.cpp Standardize {pred,succ,use,user}_empty() 2015-01-13 03:46:47 +00:00
CFGPrinter.cpp Modernize raw_fd_ostream's constructor a bit. 2014-08-25 18:16:47 +00:00
CFLAliasAnalysis.cpp Added ConstantExpr support to CFLAA. 2015-03-10 02:58:15 +00:00
CGSCCPassManager.cpp [PM] Remove the defunt CGSCC-specific debug flag. 2015-01-13 22:45:13 +00:00
CMakeLists.txt Remove the Forward Control Flow Integrity pass and its dependencies. 2015-02-27 19:03:38 +00:00
CodeMetrics.cpp [PM] Split the AssumptionTracker immutable pass into two separate APIs: 2015-01-04 12:03:27 +00:00
ConstantFolding.cpp DataLayout is mandatory, update the API to reflect it with references. 2015-03-10 02:37:25 +00:00
CostModel.cpp [multiversion] Thread a function argument through all the callers of the 2015-02-01 12:01:35 +00:00
Delinearization.cpp [PM] Split the LoopInfo object apart from the legacy pass, creating 2015-01-17 14:16:18 +00:00
DependenceAnalysis.cpp Fix a crash in Dependency Analysis. 2015-03-10 13:31:03 +00:00
DominanceFrontier.cpp Templatify DominanceFrontier. 2014-07-12 21:59:52 +00:00
DomPrinter.cpp [PM] Split DominatorTree into a concrete analysis result object which 2014-01-13 13:07:17 +00:00
InstCount.cpp [Modules] Fix potential ODR violations by sinking the DEBUG_TYPE 2014-04-22 02:48:03 +00:00
InstructionSimplify.cpp DataLayout is mandatory, update the API to reflect it with references. 2015-03-10 02:37:25 +00:00
Interval.cpp Revert "[C++11] Add predecessors(BasicBlock *) / successors(BasicBlock *) iterator ranges." 2014-07-21 17:06:51 +00:00
IntervalPartition.cpp [C++11] More 'nullptr' conversion. In some cases just using a boolean check instead of comparing to nullptr. 2014-04-15 04:59:12 +00:00
IVUsers.cpp DataLayout is mandatory, update the API to reflect it with references. 2015-03-10 02:37:25 +00:00
LazyCallGraph.cpp Revert r225854: [PM] Move the LazyCallGraph printing functionality to 2015-01-14 00:27:45 +00:00
LazyValueInfo.cpp DataLayout is mandatory, update the API to reflect it with references. 2015-03-10 02:37:25 +00:00
LibCallAliasAnalysis.cpp Make DataLayout Non-Optional in the Module 2015-03-04 18:43:29 +00:00
LibCallSemantics.cpp Unify the two EH personality classification routines I wrote 2015-02-14 00:21:02 +00:00
Lint.cpp DataLayout is mandatory, update the API to reflect it with references. 2015-03-10 02:37:25 +00:00
LLVMBuild.txt Update libdeps since TLI was moved from Target to Analysis in r226078. 2015-01-15 05:21:00 +00:00
Loads.cpp DataLayout is mandatory, update the API to reflect it with references. 2015-03-10 02:37:25 +00:00
LoopAccessAnalysis.cpp DataLayout is mandatory, update the API to reflect it with references. 2015-03-10 02:37:25 +00:00
LoopInfo.cpp [PM] Port LoopInfo to the new pass manager, adding both a LoopAnalysis 2015-01-20 10:58:50 +00:00
LoopPass.cpp [PM] Split the LoopInfo object apart from the legacy pass, creating 2015-01-17 14:16:18 +00:00
Makefile
MemDepPrinter.cpp MemDepPrinter: Fix some nits introduced in r228596 2015-02-25 23:55:00 +00:00
MemDerefPrinter.cpp DataLayout is mandatory, update the API to reflect it with references. 2015-03-10 02:37:25 +00:00
MemoryBuiltins.cpp DataLayout is mandatory, update the API to reflect it with references. 2015-03-10 02:37:25 +00:00
MemoryDependenceAnalysis.cpp DataLayout is mandatory, update the API to reflect it with references. 2015-03-10 02:37:25 +00:00
ModuleDebugInfoPrinter.cpp DebugInfo: Move new hierarchy into place 2015-03-03 17:24:31 +00:00
NoAliasAnalysis.cpp Make DataLayout Non-Optional in the Module 2015-03-04 18:43:29 +00:00
PHITransAddr.cpp [PM] Split the AssumptionTracker immutable pass into two separate APIs: 2015-01-04 12:03:27 +00:00
PostDominators.cpp [Modules] Fix potential ODR violations by sinking the DEBUG_TYPE 2014-04-22 02:48:03 +00:00
PtrUseVisitor.cpp Update SetVector to rely on the underlying set's insert to return a pair<iterator, bool> 2014-11-19 07:49:26 +00:00
README.txt
RegionInfo.cpp [cleanup] Re-sort all the #include lines in LLVM using 2015-01-14 11:23:27 +00:00
RegionPass.cpp Avoid calls to dumpPassInfo and RegionBase<Tr>::getNameStr() in RGPassManager if 2015-03-06 16:15:04 +00:00
RegionPrinter.cpp Templatify RegionInfo so it works on MachineBasicBlocks 2014-07-19 18:29:29 +00:00
ScalarEvolution.cpp DataLayout is mandatory, update the API to reflect it with references. 2015-03-10 02:37:25 +00:00
ScalarEvolutionAliasAnalysis.cpp Make DataLayout Non-Optional in the Module 2015-03-04 18:43:29 +00:00
ScalarEvolutionExpander.cpp DataLayout is mandatory, update the API to reflect it with references. 2015-03-10 02:37:25 +00:00
ScalarEvolutionNormalization.cpp Fix typos in comments, NFC 2014-08-29 21:53:01 +00:00
ScopedNoAliasAA.cpp Make DataLayout Non-Optional in the Module 2015-03-04 18:43:29 +00:00
SparsePropagation.cpp [Modules] Fix potential ODR violations by sinking the DEBUG_TYPE 2014-04-22 02:48:03 +00:00
StratifiedSets.h Update SetVector to rely on the underlying set's insert to return a pair<iterator, bool> 2014-11-19 07:49:26 +00:00
TargetLibraryInfo.cpp Make static variables const if possible. Makes them go into a read-only section. 2015-03-08 16:07:39 +00:00
TargetTransformInfo.cpp Do not restrict interleaved unrolling to small loops, depending on the target. 2015-03-06 23:12:04 +00:00
Trace.cpp Put the functionality for printing a value to a raw_ostream as an 2014-01-09 02:29:41 +00:00
TypeBasedAliasAnalysis.cpp Make DataLayout Non-Optional in the Module 2015-03-04 18:43:29 +00:00
ValueTracking.cpp DataLayout is mandatory, update the API to reflect it with references. 2015-03-10 02:37:25 +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))

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