You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While testing simple OpenCL image kernels through the HSAIL LLVM I noticed that three nested loops cause the outer loop to branch incorrectly. More specifically, the loop variable is incremented every other iteration of the outer loop. Attached is a simple OpenCL kernel that reproduces the issue. The issue persists up to -O2, but is not present when using -O3.
For this kernel, the HSAIL LLVM create the following outer loop structure (complete HSAIL attached):
The boolean c1 is negated on each iteration, but only every other iteration increments the outer loop variable $s4. It seems that the not clause is related to a check that asserts that the outer loop is executed at all (in this case, that x_size > -1).
Pull request #29 fixes this simple case, but more thorough control flow analysis is required to detect all variable uses inside loops.
While testing simple OpenCL image kernels through the HSAIL LLVM I noticed that three nested loops cause the outer loop to branch incorrectly. More specifically, the loop variable is incremented every other iteration of the outer loop. Attached is a simple OpenCL kernel that reproduces the issue. The issue persists up to -O2, but is not present when using -O3.
For this kernel, the HSAIL LLVM create the following outer loop structure (complete HSAIL attached):
The boolean
c1
is negated on each iteration, but only every other iteration increments the outer loop variable$s4
. It seems that the not clause is related to a check that asserts that the outer loop is executed at all (in this case, thatx_size > -1
).Pull request #29 fixes this simple case, but more thorough control flow analysis is required to detect all variable uses inside loops.
kernel.zip
The text was updated successfully, but these errors were encountered: