llvm/test
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 Teach ScalarEvolution how to reason about no-wrap flags on loops 2009-09-17 18:05:20 +00:00
Archive
Assembler Clean up the usage of evaluateICmpRelation's return value. 2009-09-20 04:27:06 +00:00
Bindings/Ocaml Switch Ocaml to use llvm_supports_binding. 2009-09-13 01:41:47 +00:00
Bitcode
BugPoint
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
DebugInfo Eliminate more redundant llvm-as calls. 2009-09-11 18:17:12 +00:00
ExecutionEngine
Feature Write and read metadata attachments. 2009-09-18 19:26:43 +00:00
FrontendAda
FrontendC
FrontendC++
FrontendFortran
FrontendObjC
FrontendObjC++
Integer
lib tests: Add llvm_supports_binding predicate. 2009-09-13 01:41:18 +00:00
Linker When a constant's type is refined, update the constant in place 2009-09-15 15:58:07 +00:00
LLVMC Fix a small issue with recent changes to this code. 2009-09-13 20:14:57 +00:00
MC Move ARM and X86 specific AsmParser tests into separate subdirectories, and only 2009-09-21 00:05:30 +00:00
Other Forbid arrays of function-type and structures with function-typed fields. 2009-09-15 06:28:26 +00:00
Scripts
TableGen
Transforms Improve GVN to be able to forward substitute a small load 2009-09-21 05:57:11 +00:00
Unit Teach 'make check-lit' to run unittests. 2009-09-14 02:39:01 +00:00
Verifier
lit.cfg tests: Add llvm_supports_binding predicate. 2009-09-13 01:41:18 +00:00
Makefile Teach 'make check-all' to build the site configuration for clang, if it is in tree. 2009-09-20 19:04:28 +00:00
Makefile.tests
TestRunner.sh