llvm-6502/lib/Analysis
Chandler Carruth 7c52c97a22 Rename the Region::block_iterator to Region::block_node_iterator, and
add a new Region::block_iterator which actually iterates over the basic
blocks of the region.

The old iterator, now call 'block_node_iterator' iterates over
RegionNodes which contain a single basic block. This works well with the
GraphTraits-based iterator design, however most users actually want an
iterator over the BasicBlocks inside these RegionNodes. Now the
'block_iterator' is a wrapper which exposes exactly this interface.
Internally it uses the block_node_iterator to walk all nodes which are
single basic blocks, but transparently unwraps the basic block to make
user code simpler.

While this patch is a bit of a wash, most of the updates are to internal
users, not external users of the RegionInfo. I have an accompanying
patch to Polly that is a strict simplification of every user of this
interface, and I'm working on a pass that also wants the same simplified
interface.

This patch alone should have no functional impact.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156202 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-04 20:55:23 +00:00
..
IPA Handle intrinsics in GlobalsModRef. Fixes pr12351. 2012-03-28 21:31:24 +00:00
AliasAnalysis.cpp Move isKnownNonNull from private implementation detail of BasicAA to a public 2012-02-25 10:56:28 +00:00
AliasAnalysisCounter.cpp
AliasAnalysisEvaluator.cpp
AliasDebugger.cpp
AliasSetTracker.cpp Have AliasSet::aliasesUnknownInst use pointer TBAA info when available 2012-02-10 15:52:39 +00:00
Analysis.cpp
BasicAliasAnalysis.cpp Duncan pointed out that if the alignment isn't explicitly specified, it defaults to the ABI alignment. Given that, make this code a bit more aggressive in such cases. 2012-02-27 23:16:46 +00:00
BlockFrequencyInfo.cpp
BranchProbabilityInfo.cpp
CaptureTracking.cpp
CFGPrinter.cpp
CMakeLists.txt Pull the implementation of the code metrics out of the inline cost 2012-03-16 05:51:52 +00:00
CodeMetrics.cpp A pile of long over-due refactorings here. There are some very, *very* 2012-05-04 00:58:03 +00:00
ConstantFolding.cpp Reapply r155682, making constant folding more consistent, with a fix to work 2012-04-27 17:50:22 +00:00
DbgInfoPrinter.cpp
DebugInfo.cpp Add a line number for the scope of the function (starting at the first 2012-04-03 00:43:49 +00:00
DIBuilder.cpp Allow forward declarations to take a context. This helps the debugger 2012-04-23 19:00:11 +00:00
DominanceFrontier.cpp
DomPrinter.cpp
InlineCost.cpp A pile of long over-due refactorings here. There are some very, *very* 2012-05-04 00:58:03 +00:00
InstCount.cpp
InstructionSimplify.cpp Revert r153521 as it's causing large regressions on the nightly testers. 2012-03-28 18:42:50 +00:00
Interval.cpp
IntervalPartition.cpp
IVUsers.cpp Cleanup IVUsers::addUsersIfInteresting. 2012-03-22 17:47:33 +00:00
LazyValueInfo.cpp llvm::SwitchInst 2012-03-11 06:09:17 +00:00
LibCallAliasAnalysis.cpp
LibCallSemantics.cpp
Lint.cpp Always compute all the bits in ComputeMaskedBits. 2012-04-04 12:51:34 +00:00
LLVMBuild.txt
Loads.cpp enhance jump threading to preserve TBAA information when PRE'ing loads, 2012-03-13 18:07:41 +00:00
LoopDependenceAnalysis.cpp
LoopInfo.cpp Fix 12513: Loop unrolling breaks with indirect branches. 2012-04-10 05:14:42 +00:00
LoopPass.cpp Take out the debug info probe stuff. It's making some changes to 2012-03-23 03:54:05 +00:00
Makefile
MemDepPrinter.cpp
MemoryBuiltins.cpp remove calls to calloc if the allocated memory is not used (it was already being done for malloc) 2012-05-03 22:08:19 +00:00
MemoryDependenceAnalysis.cpp Don't call dominates on unreachable instructions. Should fix the dragonegg 2012-02-26 05:30:08 +00:00
ModuleDebugInfoPrinter.cpp
NoAliasAnalysis.cpp
PathNumbering.cpp
PathProfileInfo.cpp
PathProfileVerifier.cpp
PHITransAddr.cpp Uniformize the InstructionSimplify interface by ensuring that all routines 2012-03-13 11:42:19 +00:00
PostDominators.cpp
ProfileEstimatorPass.cpp
ProfileInfo.cpp
ProfileInfoLoader.cpp
ProfileInfoLoaderPass.cpp
ProfileVerifierPass.cpp
README.txt
RegionInfo.cpp Rename the Region::block_iterator to Region::block_node_iterator, and 2012-05-04 20:55:23 +00:00
RegionPass.cpp Rename the Region::block_iterator to Region::block_node_iterator, and 2012-05-04 20:55:23 +00:00
RegionPrinter.cpp Rename the Region::block_iterator to Region::block_node_iterator, and 2012-05-04 20:55:23 +00:00
ScalarEvolution.cpp Revert "SCEV: When expanding a GEP the final addition to the base pointer has NUW but not NSW." 2012-04-17 06:33:57 +00:00
ScalarEvolutionAliasAnalysis.cpp
ScalarEvolutionExpander.cpp Fix this assert. IP can point to an instruction with strange dominance 2012-02-27 02:13:03 +00:00
ScalarEvolutionNormalization.cpp
SparsePropagation.cpp Taken into account Duncan's comments for r149481 dated by 2nd Feb 2012: 2012-03-08 07:06:20 +00:00
Trace.cpp
TypeBasedAliasAnalysis.cpp
ValueTracking.cpp Just mark the sign bit as known zero, rather than any other irrelevant bits 2012-04-30 11:56:58 +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))

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