llvm-6502/include/llvm/Analysis
Chris Lattner a92ff91a96 implement enough of the memset inference algorithm to recognize and insert
memsets.  This is still missing one important validity check, but this is enough
to compile stuff like this:

void test0(std::vector<char> &X) {
  for (std::vector<char>::iterator I = X.begin(), E = X.end(); I != E; ++I)
    *I = 0;
}

void test1(std::vector<int> &X) {
  for (long i = 0, e = X.size(); i != e; ++i)
    X[i] = 0x01010101;
}

With:
 $ clang t.cpp -S -o - -O2 -emit-llvm | opt -loop-idiom | opt -O3 | llc 

to:

__Z5test0RSt6vectorIcSaIcEE:            ## @_Z5test0RSt6vectorIcSaIcEE
## BB#0:                                ## %entry
	subq	$8, %rsp
	movq	(%rdi), %rax
	movq	8(%rdi), %rsi
	cmpq	%rsi, %rax
	je	LBB0_2
## BB#1:                                ## %bb.nph
	subq	%rax, %rsi
	movq	%rax, %rdi
	callq	___bzero
LBB0_2:                                 ## %for.end
	addq	$8, %rsp
	ret
...
__Z5test1RSt6vectorIiSaIiEE:            ## @_Z5test1RSt6vectorIiSaIiEE
## BB#0:                                ## %entry
	subq	$8, %rsp
	movq	(%rdi), %rax
	movq	8(%rdi), %rdx
	subq	%rax, %rdx
	cmpq	$4, %rdx
	jb	LBB1_2
## BB#1:                                ## %for.body.preheader
	andq	$-4, %rdx
	movl	$1, %esi
	movq	%rax, %rdi
	callq	_memset
LBB1_2:                                 ## %for.end
	addq	$8, %rsp
	ret



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122573 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-26 23:42:51 +00:00
..
AliasAnalysis.h Introduce a new PartialAlias response for AliasAnalysis. For most 2010-12-10 19:38:58 +00:00
AliasSetTracker.h Reapply r116831 and r116839, converting AliasAnalysis to use 2010-10-19 22:54:46 +00:00
CallGraph.h Merge System into Support. 2010-11-29 18:16:10 +00:00
CaptureTracking.h 80-columns 2010-07-13 05:50:08 +00:00
CFGPrinter.h Remove tab characters and 80-col. 2010-07-12 05:26:37 +00:00
CodeMetrics.h Start separating out code metrics into code size metrics and code performance metrics. Partial Specialization will apply the former to function specializations, and the latter to all callsites that can use a specialization, in order to decide whether to create a specialization 2010-10-08 13:57:31 +00:00
ConstantFolding.h Clarify that constant folding of instructions applies when all operands 2010-11-23 10:16:18 +00:00
ConstantsScanner.h eliminate all 80-col violations that I have introduced in my recent checkins (and some others more) 2009-08-27 23:44:33 +00:00
DebugInfo.h Add support to create class type. 2010-12-08 20:18:20 +00:00
DIBuilder.h Add support to create debug info for functions and methods. 2010-12-08 20:42:44 +00:00
DominatorInternals.h Optimize a common case in the Lengauer-Tarjan dominators algorithm. This gives a 2010-11-23 06:32:37 +00:00
Dominators.h Constify. 2010-12-22 22:10:08 +00:00
DomPrinter.h
DOTGraphTraitsPass.h Remove WriteGraph's Name argument, which it didn't use, and 2010-09-27 15:34:19 +00:00
FindUsedTypes.h Get rid of static constructors for pass registration. Instead, every pass exposes an initializeMyPassFunction(), which 2010-10-19 17:21:58 +00:00
InlineCost.h Now using a variant of the existing inlining heuristics to decide whether to create a given specialization of a function in PartialSpecialization. If the total performance bonus across all callsites passing the same constant exceeds the specialization cost, we create the specialization. 2010-10-09 22:06:36 +00:00
InstructionSimplify.h Pull a few more simplifications out of instcombine (there are still 2010-12-21 14:00:22 +00:00
Interval.h Change Pass::print to take a raw ostream instead of std::ostream, 2009-08-23 06:03:38 +00:00
IntervalIterator.h Use std::vector rather than SmallVector here because SmallVector 2010-07-08 13:06:08 +00:00
IntervalPartition.h Get rid of static constructors for pass registration. Instead, every pass exposes an initializeMyPassFunction(), which 2010-10-19 17:21:58 +00:00
IVUsers.h Revert 112442 and 112440 until the compile time problems introduced 2010-09-01 01:45:53 +00:00
LazyValueInfo.h Get rid of static constructors for pass registration. Instead, every pass exposes an initializeMyPassFunction(), which 2010-10-19 17:21:58 +00:00
LibCallAliasAnalysis.h Get rid of static constructors for pass registration. Instead, every pass exposes an initializeMyPassFunction(), which 2010-10-19 17:21:58 +00:00
LibCallSemantics.h Remove the experimental AliasAnalysis::getDependency interface, which 2010-09-14 21:25:10 +00:00
Lint.h Fix Lint printing warnings multiple times. Remove the ErrorStr 2010-05-26 22:28:53 +00:00
LiveValues.h remove redundant foward declaration. This function is already in 2009-11-11 00:21:21 +00:00
Loads.h Move FindAvailableLoadedValue isSafeToLoadUnconditionally out of 2010-05-28 16:19:17 +00:00
LoopDependenceAnalysis.h Get rid of static constructors for pass registration. Instead, every pass exposes an initializeMyPassFunction(), which 2010-10-19 17:21:58 +00:00
LoopInfo.h Change the basic block map in LoopInfo from a std::map to a DenseMap. This is a 16% speedup running loops on test-suite + SPEC2000. 2010-11-30 18:51:19 +00:00
LoopPass.h Make LoopPass::getContainedPass return a LoopPass* instead of a Pass* 2010-08-11 20:34:43 +00:00
MemoryBuiltins.h clean up handling of 'free', detangling it from everything else. 2010-11-30 01:28:33 +00:00
MemoryDependenceAnalysis.h Rewrite the main DSE loop to be written in terms of reasoning 2010-11-30 07:23:21 +00:00
Passes.h Move NoAA out of BasicAliasAnalysis.cpp into its own file, now that 2010-10-19 23:09:08 +00:00
PHITransAddr.h Reapply r97010, the speculative revert failed. 2010-02-24 08:48:04 +00:00
PostDominators.h Get rid of static constructors for pass registration. Instead, every pass exposes an initializeMyPassFunction(), which 2010-10-19 17:21:58 +00:00
ProfileInfo.h Convert debug messages to use dbgs(). Generally this means 2009-12-23 17:55:11 +00:00
ProfileInfoLoader.h Reapplied r81355 with the problems fixed. 2009-09-16 11:35:50 +00:00
ProfileInfoTypes.h OptimalEdgeProfiling: Creation of profiles. 2009-09-01 19:03:44 +00:00
RegionInfo.h Remove noisy semicolon. 2010-10-13 15:55:12 +00:00
RegionIterator.h Add new RegionInfo pass. 2010-07-22 07:46:31 +00:00
RegionPass.h Add RegionPass support. 2010-10-20 01:54:44 +00:00
RegionPrinter.h Add new RegionInfo pass. 2010-07-22 07:46:31 +00:00
ScalarEvolution.h implement enough of the memset inference algorithm to recognize and insert 2010-12-26 23:42:51 +00:00
ScalarEvolutionExpander.h Introduce memoization for ScalarEvolution dominates and properlyDominates 2010-11-18 00:34:22 +00:00
ScalarEvolutionExpressions.h Make SCEV::getType() and SCEV::print non-virtual. Move SCEV::hasOperand 2010-11-17 22:27:42 +00:00
ScalarEvolutionNormalization.h Generalize IVUsers to track arbitrary expressions rather than expressions 2010-04-07 22:27:08 +00:00
SparsePropagation.h Eliminate unnecessary LLVMContexts. 2009-12-18 23:42:08 +00:00
Trace.h eliminate the "Value" printing methods that print to a std::ostream. 2009-08-23 04:37:46 +00:00
ValueTracking.h move isBytewiseValue out to ValueTracking.h/cpp 2010-12-26 20:15:01 +00:00
Verifier.h Fix a comment. 2010-04-08 17:41:04 +00:00