[llvm-commits] CVS: llvm/lib/Target/X86/X86ISelPattern.cpp

Alkis Evlogimenos alkis at cs.uiuc.edu
Mon Jan 17 05:16:56 PST 2005


On Monday 17 January 2005 00:48, Chris Lattner wrote:
> Changes in directory llvm/lib/Target/X86:
>
> X86ISelPattern.cpp updated: 1.61 -> 1.62
> ---
> Log message:
>
> Codegen this:
>
> int %foo(int %X) {
>         %T = add int %X, 13
>         %S = mul int %T, 3
>         ret int %S
> }
>
> as this:
>
>         mov %ECX, DWORD PTR [%ESP + 4]
>         lea %EAX, DWORD PTR [%ECX + 2*%ECX + 39]
>         ret
>
> instead of this:
>
>         mov %ECX, DWORD PTR [%ESP + 4]
>         mov %EAX, %ECX
>         add %EAX, 13
>         imul %EAX, %EAX, 3
>         ret

This doesn't look good: we should have coalesced the load with the move and 
everything should use %EAX. Any idea what is going on?

-- 

Alkis




More information about the llvm-commits mailing list