llvm-6502/lib/Analysis
Eli Friedman 7c6a5a2c39 When marking a block as being unanalyzable, use "Clobber" on the terminator instead of the first instruction in the block. This is a bit of a hack; "Clobber" isn't really the right marking in the first place. memdep doesn't really have any way of properly expressing "unanalyzable" at the moment. Using it on the terminator is much less ambiguous than using it on an arbitrary instruction, though.
In the given testcase, the "Clobber" was pointing to a load, and GVN was incorrectly assuming that meant that the "Clobber" load overlapped the load being analyzed (when they are actually unrelated).

The included testcase tests both this commit and r132434.

Part two of rdar://9429882.  (r132434 was mislabeled.)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132442 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-02 00:08:52 +00:00
..
IPA Fix a source of non determinism in FindUsedTypes, use a SetVector instead of a 2011-05-13 05:20:42 +00:00
AliasAnalysis.cpp When analyzing functions known to only access argument pointees, 2011-04-27 18:39:03 +00:00
AliasAnalysisCounter.cpp
AliasAnalysisEvaluator.cpp
AliasDebugger.cpp
AliasSetTracker.cpp PR9604; try to deal with RAUW updates correctly in the AST. I'm not convinced 2011-04-09 06:55:46 +00:00
Analysis.cpp remove postdom frontiers, because it is dead. Forward dom frontiers are 2011-04-05 21:57:17 +00:00
BasicAliasAnalysis.cpp Make DecomposeGEPExpression check SimplifyInstruction only 2011-05-24 18:24:08 +00:00
CaptureTracking.cpp Don't include Operator.h from InstrTypes.h. 2011-04-11 09:35:34 +00:00
CFGPrinter.cpp
CMakeLists.txt
ConstantFolding.cpp implement PR9315, constant folding exp2 in terms of pow (since hosts without 2011-05-22 22:22:35 +00:00
DbgInfoPrinter.cpp
DebugInfo.cpp
DIBuilder.cpp Use llvm.dbg.cu named metadata to collect compile units. 2011-05-03 16:18:28 +00:00
DominanceFrontier.cpp
DomPrinter.cpp
InlineCost.cpp Change condition for determining whether a function is small for inlining metrics so that very long functions 2011-05-24 20:22:24 +00:00
InstCount.cpp
InstructionSimplify.cpp The comparision "max(x,y)==x" is equivalent to "x>=y". Since the max is 2011-05-07 16:56:49 +00:00
Interval.cpp
IntervalPartition.cpp
IVUsers.cpp Update this comment. 2011-05-27 18:42:33 +00:00
LazyValueInfo.cpp llvm.memcpy.* has two distinct associated address spaces; the source address space, and the destination address space. Fix up the interface on MemIntrinsic and MemTransferInst to make this clear, and fix InstructionDereferencesPointer in LazyValueInfo.cpp to use the interface properly. 2011-05-31 20:40:16 +00:00
LibCallAliasAnalysis.cpp
LibCallSemantics.cpp
Lint.cpp PR9214: Convert ConstantExpr::getIndices() to return an ArrayRef, plus 2011-04-13 15:22:40 +00:00
Loads.cpp Don't include Operator.h from InstrTypes.h. 2011-04-11 09:35:34 +00:00
LoopDependenceAnalysis.cpp
LoopInfo.cpp
LoopPass.cpp
Makefile
MemDepPrinter.cpp
MemoryBuiltins.cpp
MemoryDependenceAnalysis.cpp When marking a block as being unanalyzable, use "Clobber" on the terminator instead of the first instruction in the block. This is a bit of a hack; "Clobber" isn't really the right marking in the first place. memdep doesn't really have any way of properly expressing "unanalyzable" at the moment. Using it on the terminator is much less ambiguous than using it on an arbitrary instruction, though. 2011-06-02 00:08:52 +00:00
ModuleDebugInfoPrinter.cpp
NoAliasAnalysis.cpp
PathNumbering.cpp Remove unused STL header includes. 2011-04-23 19:53:52 +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 Don't include Operator.h from InstrTypes.h. 2011-04-11 09:35:34 +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 Minor change: Fix the typo in RegionPass.h and RegionPass.cpp. 2011-05-05 13:59:38 +00:00
RegionPrinter.cpp
ScalarEvolution.cpp SCEV: missing null check fix for r132360, dragonegg crash. 2011-06-01 19:14:56 +00:00
ScalarEvolutionAliasAnalysis.cpp
ScalarEvolutionExpander.cpp
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 Renamed llvm.x86.sse42.crc32 intrinsics; crc64 doesn't exist. 2011-05-26 23:13:19 +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))

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