llvm-6502/lib
Chris Lattner eed919b1ba Improve GVN to be able to forward substitute a small load
from a piece of a large store when both are in the same block.

This allows clang to compile the testcase in PR4216 to this code:

_test_bitfield:
	movl	4(%esp), %eax
	movl	%eax, %ecx
	andl	$-65536, %ecx
	orl	$32962, %eax
	andl	$40186, %eax
	orl	%ecx, %eax
	ret

This is not ideal, but is a whole lot better than the code produced
by llvm-gcc:

_test_bitfield:
	movw	$-32574, %ax
	orw	4(%esp), %ax
	andw	$-25350, %ax
	movw	%ax, 4(%esp)
	movw	7(%esp), %cx
	shlw	$8, %cx
	movzbl	6(%esp), %edx
	orw	%cx, %dx
	movzwl	%dx, %ecx
	shll	$16, %ecx
	movzwl	%ax, %eax
	orl	%ecx, %eax
	ret

and dramatically better than that produced by gcc 4.2:

_test_bitfield:
	pushl	%ebx
	call	L3
"L00000000001$pb":
L3:
	popl	%ebx
	movl	8(%esp), %eax
	leal	0(,%eax,4), %edx
	sarb	$7, %dl
	movl	%eax, %ecx
	andl	$7168, %ecx
	andl	$-7201, %ebx
	movzbl	%dl, %edx
	andl	$1, %edx
	sall	$5, %edx
	orl	%ecx, %ebx
	orl	%edx, %ebx
	andl	$24, %eax
	andl	$-58336, %ebx
	orl	%eax, %ebx
	orl	$32962, %ebx
	movl	%ebx, %eax
	popl	%ebx
	ret



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82439 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-21 05:57:11 +00:00
..
Analysis Revert r82404, it is causing a bootstrap miscompile. This is very very 2009-09-20 22:44:26 +00:00
Archive Prune #includes from llvm/Linker.h and llvm/System/Path.h, 2009-08-23 22:45:37 +00:00
AsmParser Tabs -> spaces, and remove trailing whitespace. 2009-09-20 02:20:51 +00:00
Bitcode Tabs -> spaces, and remove trailing whitespace. 2009-09-20 02:20:51 +00:00
CodeGen Fix PR4986. "r1024 = insert_subreg r1024, undef, 2" cannot be turned in an implicit_def. Instead, it's an identity copy so it should be eliminated. Also make sure to update livevariable kill information. 2009-09-21 04:32:32 +00:00
CompilerDriver convert LoopInfo.h and GraphWriter.h to use raw_ostream 2009-08-23 07:19:13 +00:00
Debugger Prune #includes from llvm/Linker.h and llvm/System/Path.h, 2009-08-23 22:45:37 +00:00
ExecutionEngine Implement the JIT side of the GDB JIT debugging interface. To enable this 2009-09-20 23:52:43 +00:00
Linker Remove unnecessary #include. 2009-09-12 22:24:25 +00:00
MC eliminate a use of strtoul. 2009-09-20 06:58:54 +00:00
Support simplify as daniel suggests 2009-09-20 22:56:43 +00:00
System Get rid of GetProcessId in Win32/Program.inc. 2009-09-15 03:39:45 +00:00
Target one case handled, expanded another testcase inline. 2009-09-21 02:53:57 +00:00
Transforms Improve GVN to be able to forward substitute a small load 2009-09-21 05:57:11 +00:00
VMCore Peer through zext and sext to eliminate them when it is safe to do so. 2009-09-20 07:31:25 +00:00
Makefile LLVMC doesn't need ENABLE_PIC to build now. 2009-07-04 03:54:54 +00:00