llongeri

CAL compilation hanging

Discussion created by llongeri on Mar 9, 2011
Latest reply on Mar 22, 2011 by llongeri
CAL compiler hands depending on constant value in a UMUL instruction

Hi,

I have come up with this IL code that hangs the CAL compiler with 100% CPU usage (ati-stream-sdk-v2.3).

The code is a simple computation and uses some constants.

The compilation seems to go fine up to the last 2 umul instructions. Here a register is multiplied by the constant 0x1000000 (L[2].z). the thing is, if I try changing ramdomly the constant value, like to 0x1000001, the compiler works fine.

il_cs_2_0
dcl_num_thread_per_group 64
dcl_cb cb0[2]
dcl_literal l0, 5, 10, 0x100, 100
dcl_literal l1, 4, 3, 2, 1
dcl_literal l2, 0x10000, 1000, 0x1000001, 0
mov r0.x, vaTid.x
mov r0.y, vThreadGrpId.x
mov r0.z, vTidInGrp.x
umul r0.w, r0.x, l[0].x
iadd r1, r0.wwww, l[1]
iadd r2, cb0[0].xxxx, r1
iadd r3.x, cb0[0].x, r0.w
umod r4, r2, l[0].yyyy
umod r3.y, r3.x, l[0].y
udiv r5, r2, l[0].yyyy
udiv r3.z, r3.x, l[0].y
umod r6, r5, l[0].yyyy
umod r3.w, r3.z, l[0].y
umul r5, r6, l[0].zzzz
umul r3.z, r3.w, l[0].z
iadd r6, r4, r5
iadd r3.w, r3.y, r3.z
udiv r4, r2, l[0].wwww
udiv r3.y, r3.x, l[0].w
umod r5, r4, l[0].yyyy
umod r3.z, r3.y, l[0].y
umul r4, r5, l[2].xxxx
umul r3.y, r3.z, l[2].x
iadd r5, r6, r4
iadd r3.z, r3.w, r3.y
udiv r4, r2, l[2].yyyy
udiv r3.y, r3.x, l[2].y
umod r6, r4, l[0].yyyy
umod r3.w, r3.y, l[0].y
umul r4, r6, l[2].zzzz
umul r3.y, r3.w, l[2].z
iadd r6, r5, r4
iadd r3.w, r3.z, r3.y
mov g[r0.x], r6
end

Outcomes