[llvm-commits] [llvm] r44687 - in /llvm/trunk: include/llvm/CodeGen/Passes.h lib/CodeGen/LLVMTargetMachine.cpp lib/CodeGen/MachineLICM.cpp lib/Target/PowerPC/PPCInstrInfo.td

Chris Lattner clattner at apple.com
Fri Dec 7 14:24:37 PST 2007


On Dec 7, 2007, at 1:42 PM, Bill Wendling wrote:

> Author: void
> Date: Fri Dec  7 15:42:31 2007
> New Revision: 44687
>
> URL: http://llvm.org/viewvc/llvm-project?rev=44687&view=rev
> Log:
> Initial commit of the machine code LICM pass. It successfully  
> hoists this:
>
> _foo:
>         li r2, 0
> LBB1_1: ; bb
>         li r5, 0
>         stw r5, 0(r3)
>         addi r2, r2, 1
>         addi r3, r3, 4
>         cmplw cr0, r2, r4
>         bne cr0, LBB1_1 ; bb
> LBB1_2: ; return
>         blr
>
> to:
>
> _foo:
>         li r2, 0
>         li r5, 0
> LBB1_1: ; bb
>         stw r5, 0(r3)
>         addi r2, r2, 1
>         addi r3, r3, 4
>         cmplw cr0, r2, r4
>         bne cr0, LBB1_1 ; bb
> LBB1_2: ; return
>         blr
>
> ZOMG!! :-)

I know you're kidding, but have you benchmarked this on the G5?  In  
this specific case, "foo" is probably MUCH faster because the loop is  
one dispatch group instead of two (I think).  :)

-Chris



More information about the llvm-commits mailing list