[llvm-commits] [llvm] r59960 - in /llvm/trunk: include/llvm/CodeGen/SelectionDAG.h include/llvm/Target/TargetLowering.h lib/CodeGen/SelectionDAG/DAGCombiner.cpp lib/CodeGen/SelectionDAG/LegalizeTypes.cpp lib/CodeGen/SelectionDAG/LegalizeTypes.h lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp lib/Target/PowerPC/PPCISelLowering.cpp

Duncan Sands baldrick at free.fr
Wed Nov 26 01:51:45 PST 2008


Hi Chris,

> Nifty, does this improve anything?  Can you add a testcase?

it does occasionally improve things.  Here's what it does to
test/CodeGen/PowerPC/int-fp-conv-0.ll for example (RHS is
with the new combine pass).  It reduces the number of lines
of code by 21 (about 1/4), at the expense of creating some
new constants.  I will add a testcase.

Ciao,

Duncan.

	.machine ppc64							.machine ppc64
	.section __TEXT,__textcoal_nt,coalesced,pure_instruct		.section __TEXT,__textcoal_nt,coalesced,pure_instruct
	.section __TEXT,__symbol_stub1,symbol_stubs,pure_inst		.section __TEXT,__symbol_stub1,symbol_stubs,pure_inst
	.text								.text


							      >		.literal4
							      >
							      >		.align	3
							      >	LCPI1_0:					
							      >		.space	4
							      >		.literal8
							      >
							      >		.align	3
							      >	LCPI1_1:					
							      >		.quad	5183643171103440896	; double value: 3.402
							      >		.text
	.globl	_foo							.globl	_foo
	.align	4							.align	4
_foo:								_foo:
	mflr r0								mflr r0
	std r0, 16(r1)							std r0, 16(r1)
	stdu r1, -224(r1)				      |		stdu r1, -160(r1)
	std r30, 216(r1)				      |		std r30, 152(r1)
	stfd f14, 208(r1)				      |		stfd f14, 144(r1)
	stfd f15, 200(r1)				      |		stfd f15, 136(r1)
							      >		stfd f16, 128(r1)
							      >		stfd f17, 120(r1)
	mfcr r0								mfcr r0
	rlwinm r0, r0, 8, 0, 31						rlwinm r0, r0, 8, 0, 31
	stw r0, 196(r1)					      |		stw r0, 116(r1)
	mr r30, r3							mr r30, r3
							      >		lis r2, ha16(LCPI1_0)
							      >		lfs f14, lo16(LCPI1_0)(r2)
							      >		lis r2, ha16(LCPI1_1)
							      >		lfd f15, lo16(LCPI1_1)(r2)
	mr r3, r30							mr r3, r30
	bl L___floattitf$stub						bl L___floattitf$stub
	fmr f14, f1					      |		fmr f16, f1
	fmr f15, f2					      |		fmr f17, f2
	stfd f15, 160(r1)				      |		fmr f4, f14
	stfd f14, 168(r1)				      <
	li r2, 0					      <
	li r3, 1151					      <
	sldi r3, r3, 52					      <
	ld r4, 160(r1)					      <
	std r4, 144(r1)					      <
	ld r4, 168(r1)					      <
	std r4, 152(r1)					      <
	std r3, 176(r1)					      <
	std r2, 184(r1)					      <
	lfd f2, 144(r1)					      <
	lfd f1, 152(r1)					      <
	lfd f3, 176(r1)					      <
	lfd f4, 184(r1)					      <
	cmpdi cr2, r30, 0						cmpdi cr2, r30, 0
							      >		fmr f3, f15
	bl L___gcc_qadd$stub						bl L___gcc_qadd$stub
	blt cr2, LBB1_2	; entry						blt cr2, LBB1_2	; entry
LBB1_1:	; entry							LBB1_1:	; entry
	fmr f2, f15					      |		fmr f2, f17
LBB1_2:	; entry							LBB1_2:	; entry
	stfd f2, 128(r1)				      <
	blt cr2, LBB1_4	; entry						blt cr2, LBB1_4	; entry
LBB1_3:	; entry							LBB1_3:	; entry
	fmr f1, f14					      |		fmr f1, f16
LBB1_4:	; entry							LBB1_4:	; entry
	stfd f1, 136(r1)				      |		lwz r0, 116(r1)
	ld r2, 128(r1)					      <
	std r2, 112(r1)					      <
	ld r2, 136(r1)					      <
	std r2, 120(r1)					      <
	lfd f2, 112(r1)					      <
	lfd f1, 120(r1)					      <
	lwz r0, 196(r1)					      <
	rlwinm r0, r0, 24, 0, 31					rlwinm r0, r0, 24, 0, 31
	mtcrf 32, r0							mtcrf 32, r0
	lfd f15, 200(r1)				      |		lfd f17, 120(r1)
	lfd f14, 208(r1)				      |		lfd f16, 128(r1)
	ld r30, 216(r1)					      |		lfd f15, 136(r1)
	addi r1, r1, 224				      |		lfd f14, 144(r1)
							      >		ld r30, 152(r1)
							      >		addi r1, r1, 160
	ld r0, 16(r1)							ld r0, 16(r1)
	mtlr r0								mtlr r0
	blr 								blr 


	.globl	_boo							.globl	_boo
	.align	4							.align	4
_boo:								_boo:
	mflr r0								mflr r0
	std r0, 16(r1)							std r0, 16(r1)
	stdu r1, -144(r1)				      |		stdu r1, -112(r1)
	stfd f2, 128(r1)				      <
	stfd f1, 136(r1)				      <
	ld r2, 128(r1)					      <
	std r2, 112(r1)					      <
	ld r2, 136(r1)					      <
	std r2, 120(r1)					      <
	lfd f2, 112(r1)					      <
	lfd f1, 120(r1)					      <
	bl L___fixunstfti$stub						bl L___fixunstfti$stub
	addi r1, r1, 144				      |		addi r1, r1, 112
	ld r0, 16(r1)							ld r0, 16(r1)
	mtlr r0								mtlr r0
	blr 								blr 
	.section __TEXT,__symbol_stub1,symbol_stubs,pure_inst		.section __TEXT,__symbol_stub1,symbol_stubs,pure_inst
	.align	4							.align	4
L___fixunstfti$stub:						L___fixunstfti$stub:
	.indirect_symbol ___fixunstfti					.indirect_symbol ___fixunstfti
	lis r11,ha16(L___fixunstfti$lazy_ptr)				lis r11,ha16(L___fixunstfti$lazy_ptr)
	ldu r12,lo16(L___fixunstfti$lazy_ptr)(r11)			ldu r12,lo16(L___fixunstfti$lazy_ptr)(r11)
	mtctr r12							mtctr r12
	bctr								bctr
.lazy_symbol_pointer						.lazy_symbol_pointer
L___fixunstfti$lazy_ptr:					L___fixunstfti$lazy_ptr:
	.indirect_symbol ___fixunstfti					.indirect_symbol ___fixunstfti
	.quad dyld_stub_binding_helper					.quad dyld_stub_binding_helper
	.section __TEXT,__symbol_stub1,symbol_stubs,pure_inst		.section __TEXT,__symbol_stub1,symbol_stubs,pure_inst
	.align	4							.align	4
L___floattitf$stub:						L___floattitf$stub:
	.indirect_symbol ___floattitf					.indirect_symbol ___floattitf
	lis r11,ha16(L___floattitf$lazy_ptr)				lis r11,ha16(L___floattitf$lazy_ptr)
	ldu r12,lo16(L___floattitf$lazy_ptr)(r11)			ldu r12,lo16(L___floattitf$lazy_ptr)(r11)
	mtctr r12							mtctr r12
	bctr								bctr
.lazy_symbol_pointer						.lazy_symbol_pointer
L___floattitf$lazy_ptr:						L___floattitf$lazy_ptr:
	.indirect_symbol ___floattitf					.indirect_symbol ___floattitf
	.quad dyld_stub_binding_helper					.quad dyld_stub_binding_helper
	.section __TEXT,__symbol_stub1,symbol_stubs,pure_inst		.section __TEXT,__symbol_stub1,symbol_stubs,pure_inst
	.align	4							.align	4
L___gcc_qadd$stub:						L___gcc_qadd$stub:
	.indirect_symbol ___gcc_qadd					.indirect_symbol ___gcc_qadd
	lis r11,ha16(L___gcc_qadd$lazy_ptr)				lis r11,ha16(L___gcc_qadd$lazy_ptr)
	ldu r12,lo16(L___gcc_qadd$lazy_ptr)(r11)			ldu r12,lo16(L___gcc_qadd$lazy_ptr)(r11)
	mtctr r12							mtctr r12
	bctr								bctr
.lazy_symbol_pointer						.lazy_symbol_pointer
L___gcc_qadd$lazy_ptr:						L___gcc_qadd$lazy_ptr:
	.indirect_symbol ___gcc_qadd					.indirect_symbol ___gcc_qadd
	.quad dyld_stub_binding_helper					.quad dyld_stub_binding_helper

	.subsections_via_symbols					.subsections_via_symbols






More information about the llvm-commits mailing list