clBuildProgram crashes with LLVM error

Discussion created by pangea on Feb 3, 2018
Latest reply on Mar 7, 2018 by dipak


i am trying to build a simple kernel (see attachments) to test some implementation of a random number generator. However calling into clBuildProgram everything crashes with the following error message:


LLVM ERROR: Cannot select: 0xf57d440: i64,i64 = shl_parts Constant:i64<1>, Constant:i64<0>, 0xf57d350
  0xf57d800: i64 = Constant<1>
  0xf582580: i64 = Constant<0>
  0xf57d350: i32 = add 0xf5822b0, Constant:i32<1>
    0xf5822b0: i32,ch = CopyFromReg 0xf314c40, Register:i32 %vreg2
      0xf57dbc0: i32 = Register %vreg2
    0xf57d170: i32 = Constant<1>
In function: __OpenCL_JumpKernel_kernel


The strange thing is, this happens only when targeting some GPUs (i can reproduce it with the Radeon RX480). When targeting the CPU or some older Radeon card (HD 6870) everything seems to work fine and the code executes correctly.


Am i doing something wrong? (Maybe ignoring some device constraint?) Or is this is indeed a bug?


The driver version in question is 18.2.1 (with a OpenCl version of 23.20.15017.3010).