llvm-6502/lib/Analysis
David Majnemer 8058ffeb18 InstSimplify: Fold gep X, (sub 0, ptrtoint(X)) to null
Save InstCombine some work if we can perform this fold during
InstSimplify.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216441 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-26 07:08:03 +00:00
..
IPA Remove Support/IncludeFile.h and its only user. This is actively harmful, since 2014-08-07 20:41:17 +00:00
AliasAnalysis.cpp AA metadata refactoring (introduce AAMDNodes) 2014-07-24 12:16:19 +00:00
AliasAnalysisCounter.cpp
AliasAnalysisEvaluator.cpp AA metadata refactoring (introduce AAMDNodes) 2014-07-24 12:16:19 +00:00
AliasDebugger.cpp
AliasSetTracker.cpp AA metadata refactoring (introduce AAMDNodes) 2014-07-24 12:16:19 +00:00
Analysis.cpp Add scoped-noalias metadata 2014-07-24 14:25:39 +00:00
BasicAliasAnalysis.cpp Use range based for loops to avoid needing to re-mention SmallPtrSet size. 2014-08-24 23:23:06 +00:00
BlockFrequencyInfo.cpp
BlockFrequencyInfoImpl.cpp BFI: Add constructor for Weight 2014-07-12 00:26:00 +00:00
BranchProbabilityInfo.cpp Revert "[C++11] Add predecessors(BasicBlock *) / successors(BasicBlock *) iterator ranges." 2014-07-21 17:06:51 +00:00
CaptureTracking.cpp Match semantics of PointerMayBeCapturedBefore to its name by default 2014-07-21 21:30:22 +00:00
CFG.cpp
CFGPrinter.cpp Modernize raw_fd_ostream's constructor a bit. 2014-08-25 18:16:47 +00:00
CGSCCPassManager.cpp
CMakeLists.txt Add scoped-noalias metadata 2014-07-24 14:25:39 +00:00
CodeMetrics.cpp
ConstantFolding.cpp Repace SmallPtrSet with SmallPtrSetImpl in function arguments to avoid needing to mention the size. 2014-08-21 05:55:13 +00:00
CostModel.cpp
Delinearization.cpp
DependenceAnalysis.cpp Analysis: cleanup 2014-08-26 02:03:40 +00:00
DominanceFrontier.cpp Templatify DominanceFrontier. 2014-07-12 21:59:52 +00:00
DomPrinter.cpp
InstCount.cpp
InstructionSimplify.cpp InstSimplify: Fold gep X, (sub 0, ptrtoint(X)) to null 2014-08-26 07:08:03 +00:00
Interval.cpp Revert "[C++11] Add predecessors(BasicBlock *) / successors(BasicBlock *) iterator ranges." 2014-07-21 17:06:51 +00:00
IntervalPartition.cpp
IVUsers.cpp Repace SmallPtrSet with SmallPtrSetImpl in function arguments to avoid needing to mention the size. 2014-08-21 05:55:13 +00:00
JumpInstrTableInfo.cpp
LazyCallGraph.cpp
LazyValueInfo.cpp In LVI(Lazy Value Info), originally value on a BB can only be caculated once, 2014-08-11 05:02:04 +00:00
LibCallAliasAnalysis.cpp
LibCallSemantics.cpp
Lint.cpp Repace SmallPtrSet with SmallPtrSetImpl in function arguments to avoid needing to mention the size. 2014-08-21 05:55:13 +00:00
LLVMBuild.txt
Loads.cpp AA metadata refactoring (introduce AAMDNodes) 2014-07-24 12:16:19 +00:00
LoopInfo.cpp Revert "[C++11] Add predecessors(BasicBlock *) / successors(BasicBlock *) iterator ranges." 2014-07-21 17:06:51 +00:00
LoopPass.cpp
Makefile
MemDepPrinter.cpp
MemoryBuiltins.cpp
MemoryDependenceAnalysis.cpp Use range based for loops to avoid needing to re-mention SmallPtrSet size. 2014-08-24 23:23:06 +00:00
ModuleDebugInfoPrinter.cpp
NoAliasAnalysis.cpp Improve BasicAA CS-CS queries (redux) 2014-07-17 01:28:25 +00:00
PHITransAddr.cpp
PostDominators.cpp
PtrUseVisitor.cpp
README.txt
RegionInfo.cpp Fix msc17 build. RegionInfo::RegionInfo::recalculate() doesn't make sense. 2014-07-20 03:57:51 +00:00
RegionPass.cpp Templatify RegionInfo so it works on MachineBasicBlocks 2014-07-19 18:29:29 +00:00
RegionPrinter.cpp Templatify RegionInfo so it works on MachineBasicBlocks 2014-07-19 18:29:29 +00:00
ScalarEvolution.cpp Revert "[C++11] Add predecessors(BasicBlock *) / successors(BasicBlock *) iterator ranges." 2014-07-21 17:06:51 +00:00
ScalarEvolutionAliasAnalysis.cpp AA metadata refactoring (introduce AAMDNodes) 2014-07-24 12:16:19 +00:00
ScalarEvolutionExpander.cpp Fix ScalarEvolutionExpander when creating a PHI in a block with duplicate predecessors 2014-07-31 19:13:38 +00:00
ScalarEvolutionNormalization.cpp
ScopedNoAliasAA.cpp Simplify and improve scoped-noalias metadata semantics 2014-07-25 15:50:02 +00:00
SparsePropagation.cpp
TargetTransformInfo.cpp Allow vectorization of division by uniform power of 2. 2014-08-25 04:56:54 +00:00
Trace.cpp
TypeBasedAliasAnalysis.cpp Add scoped-noalias metadata 2014-07-24 14:25:39 +00:00
ValueTracking.cpp ValueTracking: Figure out more bits when looking at add/sub 2014-08-22 00:40:43 +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))

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