You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "George Timoshenko (JIRA)" <ji...@apache.org> on 2008/03/12 11:04:46 UTC

[jira] Created: (HARMONY-5597) [drlvm][jit][opt] Branch Translator zero comparison improvement

[drlvm][jit][opt] Branch Translator zero comparison improvement
---------------------------------------------------------------

                 Key: HARMONY-5597
                 URL: https://issues.apache.org/jira/browse/HARMONY-5597
             Project: Harmony
          Issue Type: Improvement
            Reporter: George Timoshenko
            Priority: Minor


In the implementation of branch translator enhancement (HARMONY-5580)

prevInst - can be lookuped more carefully than just:

Inst * prevInst = inst->getPrevInst();
+
+                    if (prevInst && falseInst)

There can be some insts that do not affect FALGS between CMP and BRANCH.

And it is also correct when CMP belongs to another BB that is prior to the BRANCH's one. (the only restriction is: FLAGS are safe from CMP to BRANCH)

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


[jira] Commented: (HARMONY-5597) [drlvm][jit][opt] Branch Translator zero comparison improvement

Posted by "Dmitry Pronichkin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-5597?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12580716#action_12580716 ] 

Dmitry Pronichkin commented on HARMONY-5597:
--------------------------------------------

I want to suggest generalization of this branch elimination technique.
We can work on the following pattern:
if ( x < x1 ) { // or if (x1 > x)
  a = a0;
}
else {
  a = a1;
}

transforming it into code like this:
tmp = (x - x1) >> 31;
a = (a0 & tmp) | (a1 & !tmp);

This will fully cover the idea of sign check elimination.

> [drlvm][jit][opt] Branch Translator zero comparison improvement
> ---------------------------------------------------------------
>
>                 Key: HARMONY-5597
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5597
>             Project: Harmony
>          Issue Type: Improvement
>            Reporter: George Timoshenko
>            Assignee: Mikhail Fursov
>            Priority: Minor
>
> In the implementation of branch translator enhancement (HARMONY-5580)
> prevInst - can be lookuped more carefully than just:
> Inst * prevInst = inst->getPrevInst();
> +
> +                    if (prevInst && falseInst)
> There can be some insts that do not affect FALGS between CMP and BRANCH.
> And it is also correct when CMP belongs to another BB that is prior to the BRANCH's one. (the only restriction is: FLAGS are safe from CMP to BRANCH)

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


[jira] Assigned: (HARMONY-5597) [drlvm][jit][opt] Branch Translator zero comparison improvement

Posted by "Mikhail Fursov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-5597?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mikhail Fursov reassigned HARMONY-5597:
---------------------------------------

    Assignee: Mikhail Fursov

> [drlvm][jit][opt] Branch Translator zero comparison improvement
> ---------------------------------------------------------------
>
>                 Key: HARMONY-5597
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5597
>             Project: Harmony
>          Issue Type: Improvement
>            Reporter: George Timoshenko
>            Assignee: Mikhail Fursov
>            Priority: Minor
>
> In the implementation of branch translator enhancement (HARMONY-5580)
> prevInst - can be lookuped more carefully than just:
> Inst * prevInst = inst->getPrevInst();
> +
> +                    if (prevInst && falseInst)
> There can be some insts that do not affect FALGS between CMP and BRANCH.
> And it is also correct when CMP belongs to another BB that is prior to the BRANCH's one. (the only restriction is: FLAGS are safe from CMP to BRANCH)

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


[jira] Commented: (HARMONY-5597) [drlvm][jit][opt] Branch Translator zero comparison improvement

Posted by "Egor Pasko (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-5597?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12580774#action_12580774 ] 

Egor Pasko commented on HARMONY-5597:
-------------------------------------

Dmitry,

I did not quite catch this:

> a = (a0 & tmp) | (a1 & !tmp); 

do you mean '&' is 'bitwise and'? then looks wrong since tmp has only one bit set at most.

and if it's 'logical and', then what is the difference? JIT would generate almost the same code.

> [drlvm][jit][opt] Branch Translator zero comparison improvement
> ---------------------------------------------------------------
>
>                 Key: HARMONY-5597
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5597
>             Project: Harmony
>          Issue Type: Improvement
>            Reporter: George Timoshenko
>            Assignee: Mikhail Fursov
>            Priority: Minor
>
> In the implementation of branch translator enhancement (HARMONY-5580)
> prevInst - can be lookuped more carefully than just:
> Inst * prevInst = inst->getPrevInst();
> +
> +                    if (prevInst && falseInst)
> There can be some insts that do not affect FALGS between CMP and BRANCH.
> And it is also correct when CMP belongs to another BB that is prior to the BRANCH's one. (the only restriction is: FLAGS are safe from CMP to BRANCH)

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


[jira] Commented: (HARMONY-5597) [drlvm][jit][opt] Branch Translator zero comparison improvement

Posted by "Egor Pasko (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-5597?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12581396#action_12581396 ] 

Egor Pasko commented on HARMONY-5597:
-------------------------------------

Oh, signed shift! of course! sorry :)

> [drlvm][jit][opt] Branch Translator zero comparison improvement
> ---------------------------------------------------------------
>
>                 Key: HARMONY-5597
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5597
>             Project: Harmony
>          Issue Type: Improvement
>            Reporter: George Timoshenko
>            Assignee: Mikhail Fursov
>            Priority: Minor
>
> In the implementation of branch translator enhancement (HARMONY-5580)
> prevInst - can be lookuped more carefully than just:
> Inst * prevInst = inst->getPrevInst();
> +
> +                    if (prevInst && falseInst)
> There can be some insts that do not affect FALGS between CMP and BRANCH.
> And it is also correct when CMP belongs to another BB that is prior to the BRANCH's one. (the only restriction is: FLAGS are safe from CMP to BRANCH)

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


[jira] Commented: (HARMONY-5597) [drlvm][jit][opt] Branch Translator zero comparison improvement

Posted by "Dmitry Pronichkin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-5597?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12581070#action_12581070 ] 

Dmitry Pronichkin commented on HARMONY-5597:
--------------------------------------------

Egor, these operations are bitwise. Maybe you didn't catch _signed_ shift here? It spreads sign bit for the whole value creating a mask for consequent operations.
That is absolutely similar idea to recently committed HARMONY-5580, just generalization.

Thanks,
Dmitry

> [drlvm][jit][opt] Branch Translator zero comparison improvement
> ---------------------------------------------------------------
>
>                 Key: HARMONY-5597
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5597
>             Project: Harmony
>          Issue Type: Improvement
>            Reporter: George Timoshenko
>            Assignee: Mikhail Fursov
>            Priority: Minor
>
> In the implementation of branch translator enhancement (HARMONY-5580)
> prevInst - can be lookuped more carefully than just:
> Inst * prevInst = inst->getPrevInst();
> +
> +                    if (prevInst && falseInst)
> There can be some insts that do not affect FALGS between CMP and BRANCH.
> And it is also correct when CMP belongs to another BB that is prior to the BRANCH's one. (the only restriction is: FLAGS are safe from CMP to BRANCH)

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