You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Xiaoming Gu (JIRA)" <ji...@apache.org> on 2008/10/08 04:53:44 UTC

[jira] Updated: (HARMONY-5992) [drlvm][jit] Redundant register load & store in loop nest on IA32

     [ https://issues.apache.org/jira/browse/HARMONY-5992?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Xiaoming Gu updated HARMONY-5992:
---------------------------------

    Description: 
There are two choices for Register Allocation (RA) in Harmony - Bin Packing (BP) and Coloring Graph (CG). The first is light-weight and the unique choice in client execution modes. The latter is heavy-weight and only selected for a function without too many operands in server execution modes.

Even with CG, the following source code generates low-quality binary code.

------source code------
for(int i=0;i<times;i++)
    result = result*(-8);

-------binary code for "result = result*(-8);"------
MOV s54(EBP):I_32,v527[v513(ESP)+t526(-28)]:I_32
MOV t197(EBX):I_32,t53(-8):I_32 
(ID:s16(EFLGS):U_32) =IMUL s54(EBP):I_32,t197(EBX):I_32 
MOV v527[v513(ESP)+t526(-28)]:I_32,s54(EBP):I_32
MOV s56(EBP):I_32,v529[v513(ESP)+t528(-32)]:I_32
(ID:s16(EFLGS):U_32) =ADD s56(EBP):I_32,t55(1):I_32 
MOV v529[v513(ESP)+t528(-32)]:I_32,s56(EBP):I_32

It's better to move all the MOV operations out of loop by improving RA.

  was:
There are two choices for Register Allocation (RA) in Harmony - Bin Packing (BP) and Coloring Graph (CG). The first is light-weight and the unique choice in client execution modes. The latter is heavy-weight and only selected for a function without too many operands in server execution modes.

Even with CG, the following source code generates low-quality binary code.

------source code------
for(int i=0;i<times;i++)
    result = result*(-8);

-------binary code for "result = result*(-8);"------
MOV s54(EBP):I_32,v527[v513(ESP)+t526(-28)]:I_32    =>redundant load
MOV t197(EBX):I_32,t53(-8):I_32 
(ID:s16(EFLGS):U_32) =IMUL s54(EBP):I_32,t197(EBX):I_32 
MOV v527[v513(ESP)+t526(-28)]:I_32,s54(EBP):I_32    =>redundant store
MOV s56(EBP):I_32,v529[v513(ESP)+t528(-32)]:I_32    =>redundant load
(ID:s16(EFLGS):U_32) =ADD s56(EBP):I_32,t55(1):I_32 
MOV v529[v513(ESP)+t528(-32)]:I_32,s56(EBP):I_32    =>redundant store

It's better to move the load and store operations out of loop by improving RA.


> [drlvm][jit] Redundant register load & store in loop nest on IA32
> -----------------------------------------------------------------
>
>                 Key: HARMONY-5992
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5992
>             Project: Harmony
>          Issue Type: Improvement
>          Components: DRLVM
>            Reporter: Xiaoming Gu
>
> There are two choices for Register Allocation (RA) in Harmony - Bin Packing (BP) and Coloring Graph (CG). The first is light-weight and the unique choice in client execution modes. The latter is heavy-weight and only selected for a function without too many operands in server execution modes.
> Even with CG, the following source code generates low-quality binary code.
> ------source code------
> for(int i=0;i<times;i++)
>     result = result*(-8);
> -------binary code for "result = result*(-8);"------
> MOV s54(EBP):I_32,v527[v513(ESP)+t526(-28)]:I_32
> MOV t197(EBX):I_32,t53(-8):I_32 
> (ID:s16(EFLGS):U_32) =IMUL s54(EBP):I_32,t197(EBX):I_32 
> MOV v527[v513(ESP)+t526(-28)]:I_32,s54(EBP):I_32
> MOV s56(EBP):I_32,v529[v513(ESP)+t528(-32)]:I_32
> (ID:s16(EFLGS):U_32) =ADD s56(EBP):I_32,t55(1):I_32 
> MOV v529[v513(ESP)+t528(-32)]:I_32,s56(EBP):I_32
> It's better to move all the MOV operations out of loop by improving RA.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.