[LLVMdev] equivalent IR, different asm

Argyrios Kyrtzidis kyrtzidis at apple.com
Wed Sep 1 06:25:29 PDT 2010


The attached .ll files seem equivalent, but the resulting asm from 'opt-fail.ll' causes a crash to webkit.
I suspect the usage of registers is wrong, can someone take a look ?

$ llc opt-pass.ll -o -

	.section	__TEXT,__text,regular,pure_instructions
	.globl	__ZN7WebCore6kolos1ERiS0_PKNS_20RenderBoxModelObjectEPNS_10StyleImageE
	.align	4, 0x90
__ZN7WebCore6kolos1ERiS0_PKNS_20RenderBoxModelObjectEPNS_10StyleImageE: ## @_ZN7WebCore6kolos1ERiS0_PKNS_20RenderBoxModelObjectEPNS_10StyleImageE
## BB#0:
	pushq	%r14
	pushq	%rbx
	subq	$8, %rsp
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	%rdx, %rdi
	movq	%rcx, %rsi
	callq	__ZN7WebCore4viziEPKNS_20RenderBoxModelObjectEPNS_10StyleImageE
	movq	%rax, %rcx
	shrq	$32, %rcx
	testl	%ecx, %ecx
	je	LBB0_2
## BB#1:
	imull	(%rbx), %eax
	cltd
	idivl	%ecx
	movl	%eax, (%r14)
LBB0_2:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	ret


$ llc opt-fail.ll -o -

	.section	__TEXT,__text,regular,pure_instructions
	.globl	__ZN7WebCore6kolos1ERiS0_PKNS_20RenderBoxModelObjectEPNS_10StyleImageE
	.align	4, 0x90
__ZN7WebCore6kolos1ERiS0_PKNS_20RenderBoxModelObjectEPNS_10StyleImageE: ## @_ZN7WebCore6kolos1ERiS0_PKNS_20RenderBoxModelObjectEPNS_10StyleImageE
## BB#0:
	pushq	%r14
	pushq	%rbx
	subq	$8, %rsp
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	%rdx, %rdi
	movq	%rcx, %rsi
	callq	__ZN7WebCore4viziEPKNS_20RenderBoxModelObjectEPNS_10StyleImageE
	movq	%rax, %rcx
	shrq	$32, %rcx
	testl	%ecx, %ecx
	je	LBB0_2
## BB#1:
	movl	(%rbx), %ecx
	imull	%ecx, %eax
	shrq	$32, %rax
	movl	%eax, %ecx
	cltd
	idivl	%ecx
	movl	%eax, (%r14)
LBB0_2:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	ret


-Argiris


-------------- next part --------------
A non-text attachment was scrubbed...
Name: opt-fail.ll
Type: application/octet-stream
Size: 1816 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100901/f06be303/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: opt-pass.ll
Type: application/octet-stream
Size: 1838 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100901/f06be303/attachment-0001.obj>


More information about the llvm-dev mailing list