llvm-6502/include/llvm
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
..
ADT Use IntEqClasses to compute connected components of live intervals. 2010-12-21 00:48:17 +00:00
Analysis implement enough of the memset inference algorithm to recognize and insert 2010-12-26 23:42:51 +00:00
Assembly
Bitcode Merge System into Support. 2010-11-29 18:16:10 +00:00
CodeGen Header warning patrol. 2010-12-25 02:38:01 +00:00
CompilerDriver Merge System into Support. 2010-11-29 18:16:10 +00:00
Config Support/FileSystem: Fix MinGW build. It doesn't have _chsize_s. 2010-12-03 18:48:56 +00:00
ExecutionEngine Merge System into Support. 2010-11-29 18:16:10 +00:00
MC Add basic support for .cfi_personality. 2010-12-26 20:20:31 +00:00
Object MC/Mach-O: Shuffle enums a bit to make it harder to inadvertently use the wrong 2010-12-21 15:26:45 +00:00
Support add methods to IRBuilder to create memcpy/memset/memmove. 2010-12-26 22:49:25 +00:00
Target Various bits of framework needed for precise machine-level selection 2010-12-24 05:03:26 +00:00
Transforms Start of a pass for recognizing memset and memcpy idioms. 2010-12-26 19:32:44 +00:00
AbstractTypeUser.h
Argument.h
Attributes.h Add a new 'hotpatch' attribute. This attribute will insert a two-byte no-op 2010-10-25 15:37:09 +00:00
AutoUpgrade.h Auto-upgrade the magic ".llvm.eh.catch.all.value" global to 2010-09-10 18:51:56 +00:00
BasicBlock.h Merge System into Support. 2010-11-29 18:16:10 +00:00
CallGraphSCCPass.h
CallingConv.h Adding target specific calling conventions to support the MBlaze GCC function 2010-12-15 20:14:09 +00:00
CMakeLists.txt
Constant.h Remove apparently unnecessary forward declaration. 2010-09-14 01:18:15 +00:00
Constants.h clarify comment 2010-12-03 01:11:13 +00:00
DerivedTypes.h Merge System into Support. 2010-11-29 18:16:10 +00:00
Function.h Switch attribute macros to use 'LLVM_' as a prefix. We retain the old names 2010-10-23 08:10:43 +00:00
GlobalAlias.h
GlobalValue.h Discourage people from using isWeakForLinker when they should be using 2010-12-20 10:57:01 +00:00
GlobalVariable.h GlobalOpt: EvaluateFunction() must not evaluate stores to weak_odr globals. 2010-10-19 16:47:23 +00:00
GVMaterializer.h
InitializePasses.h Start of a pass for recognizing memset and memcpy idioms. 2010-12-26 19:32:44 +00:00
InlineAsm.h Mult-alt constraint incremental development step 3. 2010-10-29 23:37:38 +00:00
InstrTypes.h
Instruction.def
Instruction.h There is no need for isAssociative to take the type as an argument anymore. 2010-12-20 13:10:23 +00:00
Instructions.h Fix paste-o in ExtractValueInst::getIndexedType() comments. 2010-12-03 14:54:33 +00:00
IntrinsicInst.h remove the pointless check of MemoryUseIntrinsic from 2010-11-30 02:03:47 +00:00
Intrinsics.h
Intrinsics.td Make @llvm.invariant.start not be readonly, so that it has side-effects. This 2010-11-30 04:13:41 +00:00
IntrinsicsAlpha.td
IntrinsicsARM.td Add Neon VCVT instructions for f32 <-> f16 conversions. 2010-12-15 22:14:12 +00:00
IntrinsicsCellSPU.td
IntrinsicsPowerPC.td
IntrinsicsX86.td The pshufw instruction came about in MMX2 when SSE was introduced. Don't place 2010-10-04 20:24:01 +00:00
IntrinsicsXCore.td
LinkAllPasses.h Start of a pass for recognizing memset and memcpy idioms. 2010-12-26 19:32:44 +00:00
LinkAllVMCore.h Missed a spot removing Alarm. 2010-12-07 18:50:33 +00:00
Linker.h
LLVMContext.h now that AsmPrinter::EmitInlineAsm is factored right, we can eliminate the 2010-11-17 08:13:01 +00:00
Metadata.h After Dan's recent commit this is no longer true. 2010-09-14 20:32:58 +00:00
Module.h Merge System into Support. 2010-11-29 18:16:10 +00:00
OperandTraits.h
Operator.h Avoid warnings about implicit conversions to `bool' in MSVC. This time 2010-09-25 20:27:36 +00:00
Pass.h Add RegionPass support. 2010-10-20 01:54:44 +00:00
PassAnalysisSupport.h
PassManager.h
PassManagers.h Add RegionPass support. 2010-10-20 01:54:44 +00:00
PassRegistry.h Attempt to fix valgrind complaining about (benign) leaks in pass registration by having PassRegistry 2010-10-20 22:22:30 +00:00
PassSupport.h Merge System into Support. 2010-11-29 18:16:10 +00:00
SymbolTableListTraits.h
Type.h Add x86MMX a few more places. 2010-09-15 00:52:23 +00:00
TypeSymbolTable.h Merge System into Support. 2010-11-29 18:16:10 +00:00
Use.h
User.h
Value.h Revert r122114 (CallbackVH observing use-list changes) because it caused severe slowdowns on the Linux self-host configuration. 2010-12-20 22:28:03 +00:00
ValueSymbolTable.h Merge System into Support. 2010-11-29 18:16:10 +00:00