3 Replies Latest reply: Feb 24, 2014 10:05 AM by gordonei RSS

LLVM error when compiling kernel

s23ba32 Newbie
Currently Being Moderated

I am getting this error message:

LLVM ERROR: Cannot select: 0xb1e670: i8 = setcc 0xa94230, 0xf72f00, 0xae22a0 [ID=25]

  0xa94230: i32 = AMDILISD::ADD 0xf72f00, 0xf6f7d0 [ID=22]

    0xf72f00: i32 = mul 0xb30210, 0xf99250 [ORD=831] [ID=19]

      0xb30210: i32,ch = CopyFromReg 0xbbea30, 0xb71800 [ORD=830] [ID=14]

        0xb71800: i32 = Register %vreg41 [ORD=830] [ID=1]

      0xf99250: i32 = Constant<-83941> [ORD=831] [ID=3]

    0xf6f7d0: i32,ch = CopyFromReg 0xbbea30, 0xae37b0 [ORD=830] [ID=15]

      0xae37b0: i32 = Register %vreg42 [ORD=830] [ID=2]

  0xf72f00: i32 = mul 0xb30210, 0xf99250 [ORD=831] [ID=19]

    0xb30210: i32,ch = CopyFromReg 0xbbea30, 0xb71800 [ORD=830] [ID=14]

      0xb71800: i32 = Register %vreg41 [ORD=830] [ID=1]

    0xf99250: i32 = Constant<-83941> [ORD=831] [ID=3]

 

This is the code that is triggering the error:

typedef struct{ uint x; uint c; } mwc64x_state_t;

 

enum{ MWC64X_A = 4294883355U };

enum{ MWC64X_M = 18446383549859758079UL };

 

void MWC64X_Step(mwc64x_state_t *s)

{

    uint X=s->x, C=s->c;

 

    uint Xn=MWC64X_A*X+C;

    uint carry=(uint)(Xn<C);

                     

    // Replacing this line with a constant makes the error go away.  

    uint Cn=mad_hi(MWC64X_A,X,carry);

 

    s->x=Xn;

 

    // As does replacing this assignment with a constant.

    s->c=Cn;

}

  • Re: LLVM error when compiling kernel
    himanshu.gautam Master
    Currently Being Moderated

    Hi,

    Can you let us your system setup details: CPU, GPU, SDK , Driver, OS (Window/Linux) (32/64)

    I copied your function MXC64X_step inside a opencl sample, and ran the sample. So I assume, I am able to compile your code with out any issues. I used SDK 2.8, Win8 64 bit, 13.1 driver, AMD A10 5800K APU with HD 7660D iGPU.

    Regards

    Himanshu , Bruhaspati

    --------------------------------

    The information presented in this document is for informational purposes only and may contain technical inaccuracies, omissions and typographical errors. Links to third party sites are for convenience only, and no endorsement is implied

    • Re: LLVM error when compiling kernel
      AlexMcLeod Newbie
      Currently Being Moderated

      I realise this is an old thread, but this issue still exists with APP SDK 2.9.

       

      MWC64X is a useful random number generator, and it works with earlier versions of the APP SDK - but it triggers an LLVM error in the current version. It comes from here:

      http://cas.ee.ic.ac.uk/people/dt10/research/rngs-gpu-mwc64x.html

       

      Building my program with -cl-opt-disable fixes the error and the program runs, but overall performance is reduced. It'd be really nice if MWC64X wasn't broken by the system's attempts to optimise it.

       

      My hardware:

      CPU: FX-8350

      GPU: Radeon R9 290

      APP SDK: 2.9

      OS: Windows 8.1, 64-bit

      • Re: LLVM error when compiling kernel
        gordonei Newbie
        Currently Being Moderated

        Ja, also seeing this issue with Firepro W5000, SDK 2.9, running on CentOS 6.3.

         

        Using the -cl-opt-disable flag results in a x20 performance hit for my code (the runtime is in the order of seconds, so this really hurts). I've found a better solution is to use the CPU to seed the Random Number Generator (i.e. create a separate context, device, command queue, etc.). The RNG state struct is only 2 uints, so if you overlap your communication and compute carefully, then you can still use the MWC RNG. Its a pain, but depending on your application it might be worth it.

More Like This

Legend

  • Correct Answers - 4 points
  • Helpful Answers - 2 points