llvm/test/Transforms/GVN
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
..
2007-07-25-DominatedLoop.ll Change tests from "opt %s" to "opt < %s" so that opt doesn't see the 2009-09-11 18:01:28 +00:00
2007-07-25-InfiniteLoop.ll Change tests from "opt %s" to "opt < %s" so that opt doesn't see the 2009-09-11 18:01:28 +00:00
2007-07-25-Loop.ll Change tests from "opt %s" to "opt < %s" so that opt doesn't see the 2009-09-11 18:01:28 +00:00
2007-07-25-NestedLoop.ll Change tests from "opt %s" to "opt < %s" so that opt doesn't see the 2009-09-11 18:01:28 +00:00
2007-07-25-SinglePredecessor.ll Change tests from "opt %s" to "opt < %s" so that opt doesn't see the 2009-09-11 18:01:28 +00:00
2007-07-26-InterlockingLoops.ll Change tests from "opt %s" to "opt < %s" so that opt doesn't see the 2009-09-11 18:01:28 +00:00
2007-07-26-NonRedundant.ll Change tests from "opt %s" to "opt < %s" so that opt doesn't see the 2009-09-11 18:01:28 +00:00
2007-07-26-PhiErasure.ll Change tests from "opt %s" to "opt < %s" so that opt doesn't see the 2009-09-11 18:01:28 +00:00
2007-07-30-PredIDom.ll Change tests from "opt %s" to "opt < %s" so that opt doesn't see the 2009-09-11 18:01:28 +00:00
2007-07-31-NoDomInherit.ll Change tests from "opt %s" to "opt < %s" so that opt doesn't see the 2009-09-11 18:01:28 +00:00
2007-07-31-RedundantPhi.ll Change tests from "opt %s" to "opt < %s" so that opt doesn't see the 2009-09-11 18:01:28 +00:00
2008-02-12-UndefLoad.ll Change tests from "opt %s" to "opt < %s" so that opt doesn't see the 2009-09-11 18:01:28 +00:00
2008-02-13-NewPHI.ll Change tests from "opt %s" to "opt < %s" so that opt doesn't see the 2009-09-11 18:01:28 +00:00
2008-02-24-NonDominatedMemcpy.ll Change tests from "opt %s" to "opt < %s" so that opt doesn't see the 2009-09-11 18:01:28 +00:00
2008-02-26-MemCpySize.ll Change tests from "opt %s" to "opt < %s" so that opt doesn't see the 2009-09-11 18:01:28 +00:00
2008-07-02-Unreachable.ll Change tests from "opt %s" to "opt < %s" so that opt doesn't see the 2009-09-11 18:01:28 +00:00
2008-12-09-SelfRemove.ll Change tests from "opt %s" to "opt < %s" so that opt doesn't see the 2009-09-11 18:01:28 +00:00
2008-12-12-RLE-Crash.ll Change tests from "opt %s" to "opt < %s" so that opt doesn't see the 2009-09-11 18:01:28 +00:00
2008-12-14-rle-reanalyze.ll Change tests from "opt %s" to "opt < %s" so that opt doesn't see the 2009-09-11 18:01:28 +00:00
2008-12-15-CacheVisited.ll Change tests from "opt %s" to "opt < %s" so that opt doesn't see the 2009-09-11 18:01:28 +00:00
2009-01-21-SortInvalidation.ll Change tests from "opt %s" to "opt < %s" so that opt doesn't see the 2009-09-11 18:01:28 +00:00
2009-01-22-SortInvalidation.ll Change tests from "opt %s" to "opt < %s" so that opt doesn't see the 2009-09-11 18:01:28 +00:00
2009-02-17-LoadPRECrash.ll Change tests from "opt %s" to "opt < %s" so that opt doesn't see the 2009-09-11 18:01:28 +00:00
2009-03-05-dbg.ll Change tests from "opt %s" to "opt < %s" so that opt doesn't see the 2009-09-11 18:01:28 +00:00
2009-03-10-PREOnVoid.ll Change tests from "opt %s" to "opt < %s" so that opt doesn't see the 2009-09-11 18:01:28 +00:00
2009-06-17-InvalidPRE.ll Change tests from "opt %s" to "opt < %s" so that opt doesn't see the 2009-09-11 18:01:28 +00:00
2009-07-13-MemDepSortFail.ll Change tests from "opt %s" to "opt < %s" so that opt doesn't see the 2009-09-11 18:01:28 +00:00
basic.ll Change tests from "opt %s" to "opt < %s" so that opt doesn't see the 2009-09-11 18:01:28 +00:00
bitcast-of-call.ll Change tests from "opt %s" to "opt < %s" so that opt doesn't see the 2009-09-11 18:01:28 +00:00
calls-nonlocal.ll Change tests from "opt %s" to "opt < %s" so that opt doesn't see the 2009-09-11 18:01:28 +00:00
calls-readonly.ll Change tests from "opt %s" to "opt < %s" so that opt doesn't see the 2009-09-11 18:01:28 +00:00
condprop.ll Change tests from "opt %s" to "opt < %s" so that opt doesn't see the 2009-09-11 18:01:28 +00:00
dg.exp sabre brings to my attention that the 'tr' suffix is also obsolete 2008-05-20 21:00:03 +00:00
load-constant-mem.ll Change tests from "opt %s" to "opt < %s" so that opt doesn't see the 2009-09-11 18:01:28 +00:00
local-pre.ll Change tests from "opt %s" to "opt < %s" so that opt doesn't see the 2009-09-11 18:01:28 +00:00
lpre-basic.ll Change tests from "opt %s" to "opt < %s" so that opt doesn't see the 2009-09-11 18:01:28 +00:00
lpre-call-wrap-2.ll Eliminate uses of %prcontext. 2009-09-05 11:35:16 +00:00
lpre-call-wrap.ll Eliminate uses of %prcontext. 2009-09-05 11:35:16 +00:00
mixed.ll Change tests from "opt %s" to "opt < %s" so that opt doesn't see the 2009-09-11 18:01:28 +00:00
pre-basic-add.ll Change tests from "opt %s" to "opt < %s" so that opt doesn't see the 2009-09-11 18:01:28 +00:00
pre-single-pred.ll Change tests from "opt %s" to "opt < %s" so that opt doesn't see the 2009-09-11 18:01:28 +00:00
rle-dominated.ll Change tests from "opt %s" to "opt < %s" so that opt doesn't see the 2009-09-11 18:01:28 +00:00
rle-must-alias.ll Change tests from "opt %s" to "opt < %s" so that opt doesn't see the 2009-09-11 18:01:28 +00:00
rle-no-phi-translate.ll Change tests from "opt %s" to "opt < %s" so that opt doesn't see the 2009-09-11 18:01:28 +00:00
rle-nonlocal.ll Change tests from "opt %s" to "opt < %s" so that opt doesn't see the 2009-09-11 18:01:28 +00:00
rle-phi-translate.ll Change tests from "opt %s" to "opt < %s" so that opt doesn't see the 2009-09-11 18:01:28 +00:00
rle-semidominated.ll Change tests from "opt %s" to "opt < %s" so that opt doesn't see the 2009-09-11 18:01:28 +00:00
rle.ll Improve GVN to be able to forward substitute a small load 2009-09-21 05:57:11 +00:00