[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [omr-dev] Help needed - what is wrong with this IL?
|
On 24 June 2018 at 17:12, Leonardo <leonardo2718@xxxxxxxxxxxxxx> wrote:
>> Hi,
>>
>> I am still stuck with this problem and would appreciate any help.
>> Below is the smallest snippet I was able to create that fails.
>> The code below was generated with OP code icmpeq - although in the
>> dump it appears to be icmpne - I do not understand why.
>> If I use the icmpne OP code or other comparison op codes the code compiles.
>>
>> The error I am getting is:
>>
>> *** VALIDATION ERROR ***
>> Node: BBEnd n1n
>> Method: file:line:comp
>> Node cannot live across block boundary at n13n
>> Here is IL from the trace log.
>
> I'm very confused by this error message because it doesn't make sense.
> This error normally indicates that a node is commoned across basic blocks,
> which is not allowed. However, this error is saying that node n1n, a BBEnd, is
> somehow referenced after the supposed end of the basic block at node n13n,
> which is not a BBEnd.
>
> Looking at the log snippit you posted, I don't see any illegal commoning.
> The fact that the icmpeq appears as an icmpne also doesn't make sense.
>
> This, to me, indicates there's a bug somewhere.
>
> One thing to try is to write a Tril test that generates that same sequence of trees.
> I assume you're using your nj C API to generate the IL?
>
I am translating from my C front-end IR to IL. And yes I am using the
C api to access OMR rather than C++ but the C api is a very thin
layer.
Curiously the problem only occurs with cmpeq - the exact same IL
sequence with other op codes such as cmpne, cmplt, cmple, etc compiles
and runs fine.
For now I have worked around this by using cmpne and then inverting
the result using ternary op.
I am also puzzled by why cmpeq got translated to cmpne - I checked
that the code is actually requesting a cmpeq op code.
I will try to construct a trill test that generates the same sequence.
Thanks and Regards
Dibyendu