[LLVMdev] equivalent IR, different asm
Chris Lattner
clattner at apple.com
Wed Sep 1 12:26:45 PDT 2010
On Sep 1, 2010, at 11:14 AM, Dale Johannesen wrote:
>
> On Sep 1, 2010, at 6:25 AMPDT, Argyrios Kyrtzidis wrote:
>
>> 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 ?
>
> Yes, the code here is wrong:
>
>> movl (%rbx), %ecx
>> imull %ecx, %eax
>
> This computes h*((int32)%1) in %eax.
>
>> shrq $32, %rax
>> movl %eax, %ecx
>
> This is trying to compute (int32)(%1>>32) into %ecx, but is using the
> wrong input value since %rax has been clobbered by the above code, and
> further is clobbering the value in %eax computed above, which is
> implicit input to the divide. This is some kind of back end error,
> probably register allocator.
Jakob, can you take a look when you get a chance?
-Chris
More information about the llvm-dev
mailing list