llvm-6502/lib/Analysis
Chris Lattner aeaf3d484b Rework InstrTypes.h so to reduce the repetition around the NSW/NUW/Exact
versions of creation functions.  Eventually, the "insertion point" versions
of these should just be removed, we do have IRBuilder afterall.

Do a massive rewrite of much of pattern match.  It is now shorter and less
redundant and has several other widgets I will be using in other patches.
Among other changes, m_Div is renamed to m_IDiv (since it only matches 
integer divides) and m_Shift is gone (it used to match all binops!!) and
we now have m_LogicalShift for the one client to use.

Enhance IRBuilder to have "isExact" arguments to things like CreateUDiv
and reduce redundancy within IRbuilder by having these methods chain to
each other more instead of duplicating code.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125194 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-09 17:00:45 +00:00
..
IPA Use the new addEscapingValue callback to update GlobalsModRef when GVN adds PHIs of GEPs. For the moment, 2011-01-03 23:51:43 +00:00
AliasAnalysis.cpp Stub out a new updating interface to AliasAnalysis, allowing stateful analyses to be informed when 2011-01-03 21:38:41 +00:00
AliasAnalysisCounter.cpp
AliasAnalysisEvaluator.cpp
AliasDebugger.cpp
AliasSetTracker.cpp
Analysis.cpp Implementation of path profiling. 2011-01-29 01:09:53 +00:00
BasicAliasAnalysis.cpp Give GetUnderlyingObject a TargetData, to keep it in sync 2011-01-24 18:53:32 +00:00
CaptureTracking.cpp
CFGPrinter.cpp
CMakeLists.txt Implementation of path profiling. 2011-01-29 01:09:53 +00:00
ConstantFolding.cpp Simplify test, as suggested by Chris. 2011-02-06 20:22:49 +00:00
DbgInfoPrinter.cpp
DebugInfo.cpp Fix typo in comment. 2011-02-03 00:13:47 +00:00
DIBuilder.cpp Add support to describe template value parameter in debug info. 2011-02-02 22:35:53 +00:00
DominanceFrontier.cpp Move DominanceFrontier from VMCore to Analysis. 2011-01-18 06:06:27 +00:00
DomPrinter.cpp split dom frontier handling stuff out to its own DominanceFrontier header, 2011-01-02 22:09:33 +00:00
InlineCost.cpp Remove premature optimization that avoided calculating argument weights 2011-02-06 21:27:46 +00:00
InstCount.cpp
InstructionSimplify.cpp Rework InstrTypes.h so to reduce the repetition around the NSW/NUW/Exact 2011-02-09 17:00:45 +00:00
Interval.cpp
IntervalPartition.cpp
IVUsers.cpp split dom frontier handling stuff out to its own DominanceFrontier header, 2011-01-02 22:09:33 +00:00
LazyValueInfo.cpp Teach LazyValueInfo that allocas aren't NULL. Over all of llvm-test, this saves 2011-01-15 09:16:12 +00:00
LibCallAliasAnalysis.cpp
LibCallSemantics.cpp
Lint.cpp Give GetUnderlyingObject a TargetData, to keep it in sync 2011-01-24 18:53:32 +00:00
LiveValues.cpp split dom frontier handling stuff out to its own DominanceFrontier header, 2011-01-02 22:09:33 +00:00
Loads.cpp
LoopDependenceAnalysis.cpp split dom frontier handling stuff out to its own DominanceFrontier header, 2011-01-02 22:09:33 +00:00
LoopInfo.cpp
LoopPass.cpp
Makefile
MemDepPrinter.cpp
MemoryBuiltins.cpp
MemoryDependenceAnalysis.cpp Give GetUnderlyingObject a TargetData, to keep it in sync 2011-01-24 18:53:32 +00:00
ModuleDebugInfoPrinter.cpp
NoAliasAnalysis.cpp Use the new addEscapingValue callback to update GlobalsModRef when GVN adds PHIs of GEPs. For the moment, 2011-01-03 23:51:43 +00:00
PathNumbering.cpp Implementation of path profiling. 2011-01-29 01:09:53 +00:00
PathProfileInfo.cpp Implementation of path profiling. 2011-01-29 01:09:53 +00:00
PathProfileVerifier.cpp Implementation of path profiling. 2011-01-29 01:09:53 +00:00
PHITransAddr.cpp split dom frontier handling stuff out to its own DominanceFrontier header, 2011-01-02 22:09:33 +00:00
PostDominators.cpp split dom frontier handling stuff out to its own DominanceFrontier header, 2011-01-02 22:09:33 +00:00
ProfileEstimatorPass.cpp fix PR8928 by clearing a stale map, patch by Jakub Staszak! 2011-01-24 18:36:51 +00:00
ProfileInfo.cpp Null initialize a few variables flagged by 2011-01-23 17:05:06 +00:00
ProfileInfoLoader.cpp
ProfileInfoLoaderPass.cpp
ProfileVerifierPass.cpp
README.txt
RegionInfo.cpp Add single entry / single exit accessors. 2011-01-13 23:18:04 +00:00
RegionPass.cpp
RegionPrinter.cpp
ScalarEvolution.cpp Fix memory corruption. If one of the SCEV creation functions calls another but 2011-01-26 08:40:22 +00:00
ScalarEvolutionAliasAnalysis.cpp
ScalarEvolutionExpander.cpp
ScalarEvolutionNormalization.cpp
SparsePropagation.cpp
Trace.cpp
TypeBasedAliasAnalysis.cpp Update a comment. 2010-12-16 02:55:10 +00:00
ValueTracking.cpp Add a m_SignBit pattern for convenience. 2011-02-01 08:50:33 +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))

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