llvm-6502/lib/Analysis
Andrew Trick b2ab2fa524 Inlining and unrolling heuristics should be aware of free truncs.
We want heuristics to be based on accurate data, but more importantly
we don't want llvm to behave randomly. A benign trunc inserted by an
upstream pass should not cause a wild swings in optimization
level. See PR11034. It's a general problem with threshold-based
heuristics, but we can make it less bad.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140919 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-01 01:39:05 +00:00
..
IPA Reapply r138695. Fix PassManager stack depths. 2011-08-29 17:07:00 +00:00
AliasAnalysis.cpp Enhance alias analysis for atomic instructions a bit. Upgrade a couple alias-analysis tests to the new atomic instructions. 2011-09-26 20:15:28 +00:00
AliasAnalysisCounter.cpp
AliasAnalysisEvaluator.cpp land David Blaikie's patch to de-constify Type, with a few tweaks. 2011-07-18 04:54:35 +00:00
AliasDebugger.cpp
AliasSetTracker.cpp Atomic load/store support in LICM. 2011-08-15 20:52:09 +00:00
Analysis.cpp C API functions must be able to see their extern "C" definitions, or it will be impossible to call them from C. 2011-08-19 01:36:54 +00:00
BasicAliasAnalysis.cpp PR10628: Fix getModRefInfo so it queries the underlying alias() implementation correctly while checking nocapture calls. 2011-09-28 00:34:27 +00:00
BlockFrequencyInfo.cpp Add more constantness in BlockFrequencyInfo. 2011-08-03 21:30:57 +00:00
BranchProbabilityInfo.cpp Use canonical forms for the branch probability zero heutistic. 2011-09-04 23:53:04 +00:00
CaptureTracking.cpp Don't include Operator.h from InstrTypes.h. 2011-04-11 09:35:34 +00:00
CFGPrinter.cpp
CMakeLists.txt Rewrite the CMake build to use explicit dependencies between libraries, 2011-07-29 00:14:25 +00:00
ConstantFolding.cpp Fixes following the CR by Chris and Duncan: 2011-08-29 19:58:36 +00:00
DbgInfoPrinter.cpp Fix for DbgInfoPrinter.cpp:174:12: warning: ‘LineNo’ may be used uninitialized in this function. 2011-09-21 23:34:23 +00:00
DebugInfo.cpp Add support to emit debug info for C++0x nullptr type. 2011-09-14 23:13:28 +00:00
DIBuilder.cpp Add support to emit debug info for C++0x nullptr type. 2011-09-14 23:13:28 +00:00
DominanceFrontier.cpp
DomPrinter.cpp
InlineCost.cpp Inlining and unrolling heuristics should be aware of free truncs. 2011-10-01 01:39:05 +00:00
InstCount.cpp
InstructionSimplify.cpp InstSimplify: Don't try to replace an extractvalue/insertvalue pair with the original value if types don't match. 2011-09-05 18:16:19 +00:00
Interval.cpp
IntervalPartition.cpp
IVUsers.cpp Teach IVUsers to stop at non-affine expressions unless they are both 2011-07-01 22:05:19 +00:00
LazyValueInfo.cpp land David Blaikie's patch to de-constify Type, with a few tweaks. 2011-07-18 04:54:35 +00:00
LibCallAliasAnalysis.cpp
LibCallSemantics.cpp
Lint.cpp land David Blaikie's patch to de-constify Type, with a few tweaks. 2011-07-18 04:54:35 +00:00
Loads.cpp Add some comments here because the lack of a check for volatile/atomic here is a bit unusual. 2011-08-15 21:56:39 +00:00
LoopDependenceAnalysis.cpp Misc analysis passes that need to be aware of atomic load/store. 2011-08-15 20:54:19 +00:00
LoopInfo.cpp LoopInfo::updateUnloop fix, and verify Block->Loop maps. 2011-08-26 03:06:34 +00:00
LoopPass.cpp Reapply r138695. Fix PassManager stack depths. 2011-08-29 17:07:00 +00:00
Makefile
MemDepPrinter.cpp Misc analysis passes that need to be aware of atomic load/store. 2011-08-15 20:54:19 +00:00
MemoryBuiltins.cpp land David Blaikie's patch to de-constify Type, with a few tweaks. 2011-07-18 04:54:35 +00:00
MemoryDependenceAnalysis.cpp Misc analysis passes that need to be aware of atomic load/store. 2011-08-15 20:54:19 +00:00
ModuleDebugInfoPrinter.cpp
NoAliasAnalysis.cpp
PathNumbering.cpp Add this back in for now. There are still a few passes which create unwind instructions at the moment. 2011-08-03 01:07:57 +00:00
PathProfileInfo.cpp
PathProfileVerifier.cpp Fix a ton of comment typos found by codespell. Patch by 2011-04-15 05:18:47 +00:00
PHITransAddr.cpp Shorten some expressions by using ArrayRef::slice(). 2011-07-25 15:13:01 +00:00
PostDominators.cpp remove postdom frontiers, because it is dead. Forward dom frontiers are 2011-04-05 21:57:17 +00:00
ProfileEstimatorPass.cpp Fix a ton of comment typos found by codespell. Patch by 2011-04-15 05:18:47 +00:00
ProfileInfo.cpp Fix a ton of comment typos found by codespell. Patch by 2011-04-15 05:18:47 +00:00
ProfileInfoLoader.cpp Remove unused STL header includes. 2011-04-23 19:53:52 +00:00
ProfileInfoLoaderPass.cpp
ProfileVerifierPass.cpp
README.txt
RegionInfo.cpp
RegionPass.cpp Reapply r138695. Fix PassManager stack depths. 2011-08-29 17:07:00 +00:00
RegionPrinter.cpp
ScalarEvolution.cpp indvars: generalize SCEV getPreStartForSignExtend. 2011-09-28 17:02:54 +00:00
ScalarEvolutionAliasAnalysis.cpp
ScalarEvolutionExpander.cpp Stop emitting instructions with the name "tmp" they eat up memory and have to be uniqued, without any benefit. 2011-09-27 20:39:19 +00:00
ScalarEvolutionNormalization.cpp
SparsePropagation.cpp
Trace.cpp
TypeBasedAliasAnalysis.cpp Fix a ton of comment typos found by codespell. Patch by 2011-04-15 05:18:47 +00:00
ValueTracking.cpp Migrate LLVM and Clang to use the new makeArrayRef(...) functions where previously explicit non-default constructors were used. 2011-07-18 12:00:32 +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))

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