llvm-6502/lib/Analysis
Dan Gohman 52fddd3e36 Fix the the ceiling-division used in computing the MaxBECount so that it doesn't
have trouble with an intermediate add overflowing. Also, be more conservative
about the case where the induction variable in an SLT loop exit can step past
the RHS of the SLT and overflow in a single step.

Make getSignedRange more aggressive, to recover for some common cases which
the above fixes pessimized.

This addresses rdar://7561161.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94512 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-26 04:40:18 +00:00
..
IPA make -fno-rtti the default unless a directory builds with REQUIRES_RTTI. 2010-01-24 20:43:08 +00:00
AliasAnalysis.cpp Partially address a README by having functionattrs consider calls to 2010-01-06 08:45:52 +00:00
AliasAnalysisCounter.cpp drop the pass name from the output. 2010-01-22 05:52:51 +00:00
AliasAnalysisEvaluator.cpp
AliasDebugger.cpp adopt getAdjustedAnalysisPointer in a few more passes. 2010-01-20 20:09:02 +00:00
AliasSetTracker.cpp
Analysis.cpp "In order to ease automatic bindings generation, it would be helpful if boolean values were distinguishable from integers. The attached patch introduces "typedef int LLVMBool;", and uses LLVMBool instead of int throughout the C API, wherever a boolean value is called for." 2010-01-09 22:27:07 +00:00
BasicAliasAnalysis.cpp add some new methods to adjust this pointers. Not used yet. 2010-01-20 19:26:14 +00:00
CaptureTracking.cpp
CFGPrinter.cpp
CMakeLists.txt
ConstantFolding.cpp fix PR5978 by peeling the loop so that we avoid shifting the 2010-01-08 19:02:23 +00:00
DbgInfoPrinter.cpp Remove dead debug info intrinsics. 2010-01-05 01:10:40 +00:00
DebugInfo.cpp Assert when debug intrinsic insert functions are passed empty arguments 2010-01-26 02:07:38 +00:00
DomPrinter.cpp Create Generic DOTGraphTraits Printer/Viewer 2010-01-16 10:56:41 +00:00
InlineCost.cpp Pad my commit stats by reducing indentation in this now separate 2010-01-14 23:00:10 +00:00
InstCount.cpp
InstructionSimplify.cpp
Interval.cpp
IntervalPartition.cpp
IVUsers.cpp Re-implement the main strength-reduction portion of LoopStrengthReduction. 2010-01-21 02:09:26 +00:00
LazyValueInfo.cpp
LibCallAliasAnalysis.cpp
LibCallSemantics.cpp
LiveValues.cpp
LoopDependenceAnalysis.cpp
LoopInfo.cpp Restore dump() methods to Loop and MachineLoop. 2010-01-05 21:08:02 +00:00
LoopPass.cpp eliminate a bunch more unneeded dynamic_cast's. 2010-01-22 05:37:10 +00:00
Makefile make -fno-rtti the default unless a directory builds with REQUIRES_RTTI. 2010-01-24 20:43:08 +00:00
MemoryBuiltins.cpp
MemoryDependenceAnalysis.cpp
PHITransAddr.cpp
PointerTracking.cpp
PostDominators.cpp
ProfileEstimatorPass.cpp adopt getAdjustedAnalysisPointer in a few more passes. 2010-01-20 20:09:02 +00:00
ProfileInfo.cpp adopt getAdjustedAnalysisPointer in a few more passes. 2010-01-20 20:09:02 +00:00
ProfileInfoLoader.cpp
ProfileInfoLoaderPass.cpp adopt getAdjustedAnalysisPointer in a few more passes. 2010-01-20 20:09:02 +00:00
ProfileVerifierPass.cpp
README.txt
ScalarEvolution.cpp Fix the the ceiling-division used in computing the MaxBECount so that it doesn't 2010-01-26 04:40:18 +00:00
ScalarEvolutionAliasAnalysis.cpp adopt getAdjustedAnalysisPointer in a few more passes. 2010-01-20 20:09:02 +00:00
ScalarEvolutionExpander.cpp When re-using an existing cast for a user, it's still necessary to call 2010-01-21 10:08:42 +00:00
SparsePropagation.cpp
Trace.cpp
ValueTracking.cpp teach ComputeNumSignBits to look through PHI nodes. 2010-01-07 23:44:37 +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.

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