Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[perl #40802] Investigate Supposed JIT Bug with if/unless Optimization

5 views
Skip to first unread message

Matt Diephouse

unread,
Nov 10, 2006, 8:36:05 PM11/10/06
to bugs-bi...@rt.perl.org
# New Ticket Created by Matt Diephouse
# Please include the string: [perl #40802]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=40802 >


This was taken from t/pmc/iterator.t:

# XXX
# swapping the next two lines breaks JIT/i386
# the reason is the if/unless optimization: When the
# previous opcode sets flags, these are used - but
# there is no check, that the same register is used in the "if".
inc I0
dec I1
if I1, fill

I've taken this comment out of the test file because it's in no way
relevant to Iterator. It needs to be confirmed or rejected. And if it
*is* confirmed, it needs to be added as a test somewhere else.

--
Matt Diephouse

jnthn@jnthn.net via RT

unread,
Dec 16, 2006, 11:53:38 AM12/16/06
to perl6-i...@perl.org
On Fri Nov 10 17:36:05 2006, mdiep wrote:
> This was taken from t/pmc/iterator.t:
>
> # XXX
> # swapping the next two lines breaks JIT/i386
> # the reason is the if/unless optimization: When the
> # previous opcode sets flags, these are used - but
> # there is no check, that the same register is used in the "if".
> inc I0
> dec I1
> if I1, fill
>
> I've taken this comment out of the test file because it's in no way
> relevant to Iterator. It needs to be confirmed or rejected. And if it
> *is* confirmed, it needs to be added as a test somewhere else.
>
Well, in core.jit I see:

TEMPLATE Parrot_ifunless_x_ic {
/*
* FIXME - the compare prev_op[1] == cur_op[1] should do it
* dec I1
* inc I0
* if I1, boom
*/
if ( P_ARITH && jit_info->prev_op[1] == jit_info->cur_op[1]) {

It's not clear to me from that comment if the text after FIXME explains
that the test does not work or that it was added to do the fix. I
suspect the second - it's the Right Thing to do as far as I can see, and
trying to re-create the bug does not show it up. I swapped those lines
round on the test, and it still passes under -j.

I think maybe this bug is resolved and the FIXME comment should go, but
a comment from someone who's worked on the JIT would be nice.

Jonathan

jnthn@jnthn.net via RT

unread,
Dec 20, 2006, 5:38:20 PM12/20/06
to perl6-i...@perl.org
Hi,

After chatting with leo on IRC, and observing that this bug can't be
recreated with Parrot today, it appears that the apparent fix really
does fix it. Comment from core.jit removed.

Thanks,

Jonathan

0 new messages