llvm-6502/include/llvm/CodeGen
Chris Lattner c4ce73f666 Add a really quick hack at a machine code sinking pass, enabled with --enable-sinking.
It is missing validity checks, so it is known broken.  However, it is powerful enough
to compile this contrived code:

void test1(int C, double A, double B, double *P) {
  double Tmp = A*A+B*B;
  *P = C ? Tmp : A;
}

into:

_test1:
	movsd	8(%esp), %xmm0
	cmpl	$0, 4(%esp)
	je	LBB1_2	# entry
LBB1_1:	# entry
	movsd	16(%esp), %xmm1
	mulsd	%xmm1, %xmm1
	mulsd	%xmm0, %xmm0
	addsd	%xmm1, %xmm0
LBB1_2:	# entry
	movl	24(%esp), %eax
	movsd	%xmm0, (%eax)
	ret

instead of:

_test1:
	movsd	16(%esp), %xmm0
	mulsd	%xmm0, %xmm0
	movsd	8(%esp), %xmm1
	movapd	%xmm1, %xmm2
	mulsd	%xmm2, %xmm2
	addsd	%xmm0, %xmm2
	cmpl	$0, 4(%esp)
	je	LBB1_2	# entry
LBB1_1:	# entry
	movapd	%xmm2, %xmm1
LBB1_2:	# entry
	movl	24(%esp), %eax
	movsd	%xmm1, (%eax)
	ret

woo.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45570 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-04 07:36:53 +00:00
..
AsmPrinter.h Rename SSARegMap -> MachineRegisterInfo in keeping with the idea 2007-12-31 04:13:23 +00:00
BreakCriticalMachineEdge.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
CallingConvLower.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
Collector.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
CollectorMetadata.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
Collectors.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
DwarfWriter.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
ELFRelocation.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
FileWriters.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
IntrinsicLowering.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
LinkAllCodegenComponents.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
LiveInterval.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
LiveIntervalAnalysis.h Rename SSARegMap -> MachineRegisterInfo in keeping with the idea 2007-12-31 04:13:23 +00:00
LiveVariables.h More cleanups for MachineOperand: 2007-12-30 21:56:09 +00:00
MachineBasicBlock.h properly encapsulate the parent field of MBB and MI with get/set accessors. 2007-12-31 04:56:33 +00:00
MachineCodeEmitter.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
MachineConstantPool.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
MachineDominators.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
MachineFrameInfo.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
MachineFunction.h Rename SSARegMap -> MachineRegisterInfo in keeping with the idea 2007-12-31 04:13:23 +00:00
MachineFunctionPass.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
MachineInstr.h Implement automatically updated def/use lists for all MachineInstr register 2008-01-01 01:12:31 +00:00
MachineInstrBuilder.h Shrinkify the machine operand creation method names. 2007-12-30 00:45:46 +00:00
MachineJumpTableInfo.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
MachineLocation.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
MachineLoopInfo.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
MachineModuleInfo.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
MachineOperand.h add efficient iteration support for register use/def's 2008-01-01 02:55:32 +00:00
MachinePassRegistry.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
MachineRegisterInfo.h don't access element zero of an array of size zero. 2008-01-03 01:25:31 +00:00
MachineRelocation.h Change MachineRelocation::DoesntNeedFnStub to NeedStub. This fields will be used 2008-01-03 02:56:28 +00:00
MachORelocation.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
Passes.h Add a really quick hack at a machine code sinking pass, enabled with --enable-sinking. 2008-01-04 07:36:53 +00:00
RegAllocRegistry.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
RegisterCoalescer.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
RegisterScavenging.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
RuntimeLibcalls.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
SchedGraphCommon.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
ScheduleDAG.h Rename SSARegMap -> MachineRegisterInfo in keeping with the idea 2007-12-31 04:13:23 +00:00
SchedulerRegistry.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
SelectionDAG.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
SelectionDAGISel.h Rename SSARegMap -> MachineRegisterInfo in keeping with the idea 2007-12-31 04:13:23 +00:00
SelectionDAGNodes.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
ValueTypes.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
ValueTypes.td remove attribution from a variety of miscellaneous files. 2007-12-29 22:59:10 +00:00