[llvm-dev] 'Simple Register Coalescing' pass error

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[llvm-dev] 'Simple Register Coalescing' pass error

Shawn Webb via llvm-dev
 
Hi all,
I have an error I do not understand. My program crashes during the 'Simple Register Coalescing' pass. All I know is that the crash happens inside LiveRange::Query() in llvm/include/llvm/CodeGen/LiveInterval.h and is due to the fact that EarlyVal is null and causes a crash when evaluating if (EarlyVal->def == Idx.getBaseIndex()). What could be the reason why EarlyVal is null? The function on which the pass is being run is:



void foo(uint8_t* input, const uint8_t* key, uint8_t *output, size_t len)
{

uint16_t np1 = (len * 8)/64;
uint16_t n = np1 - 1;
uint64_t A;
uint64_t R[n+1];
int i,j;


       memcpy(&A,input,8);
       for (i = 1; i<= n;i++)
       {
           memcpy(&R[i], input + 8*i,8);
       }


       for (j = 5; j >= 0; j--)
           for (i = n; i >= 1; i--)
           {
            uint64_t l_input[2] =
            {
              A ^ (((uint64_t)(n*j+i))<<56),
              R[i]
            };

               dec((uint8_t*)l_input, key, output);
               memcpy(&A,output,8);
               memcpy(&R[i],output+8,8);
           }

       memcpy(output,&A,8);
       int k;
       for(k=1;k<(n+1);k++)
       {
        memcpy(output+8*k,&R[k],8);
       }
}

Thanks.

_______________________________________________
LLVM Developers mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] 'Simple Register Coalescing' pass error

Shawn Webb via llvm-dev
Hi Josh,

That sounds like a bug, but I don’t have enough information to know what is going on.

Could you file a public report in buzgilla and attach the IR (run clang with `-emit-llvm`) and the debug output of the coalescer (-mllvm -debug-only=regalloc)?

Thanks,
-Quentin

On Apr 11, 2019, at 9:32 PM, Josh Sharp via llvm-dev <[hidden email]> wrote:

 
Hi all,
I have an error I do not understand. My program crashes during the 'Simple Register Coalescing' pass. All I know is that the crash happens inside LiveRange::Query() in llvm/include/llvm/CodeGen/LiveInterval.h and is due to the fact that EarlyVal is null and causes a crash when evaluating if (EarlyVal->def == Idx.getBaseIndex()). What could be the reason why EarlyVal is null? The function on which the pass is being run is:



void foo(uint8_t* input, const uint8_t* key, uint8_t *output, size_t len)
{

uint16_t np1 = (len * 8)/64;
uint16_t n = np1 - 1;
uint64_t A;
uint64_t R[n+1];
int i,j;


       memcpy(&A,input,8);
       for (i = 1; i<= n;i++)
       {
           memcpy(&R[i], input + 8*i,8);
       }


       for (j = 5; j >= 0; j--)
           for (i = n; i >= 1; i--)
           {
            uint64_t l_input[2] =
            {
              A ^ (((uint64_t)(n*j+i))<<56),
              R[i]
            };

               dec((uint8_t*)l_input, key, output);
               memcpy(&A,output,8);
               memcpy(&R[i],output+8,8);
           }

       memcpy(output,&A,8);
       int k;
       for(k=1;k<(n+1);k++)
       {
        memcpy(output+8*k,&R[k],8);
       }
}

Thanks.
_______________________________________________
LLVM Developers mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev


_______________________________________________
LLVM Developers mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev