Fun with optimization...
Mandelbulber-opencl has an opencl kernel that doesn't compile with mesa's clover:
<unknown>:0:0: in function fractal3D void (%struct.sClPixel addrspace(1), %struct.sClInBuff addrspace(1), %struct.sClInConstants addrspace(2), %struct.sClReflect addrspace(1), %opencl.image2d_ro_t.0 addrspace(2)*, i32): unsupported call to function logf
Since the messages of the opencl compiler are ... lacking and the code is split over many files, I was going through the code manually and narrowed it down to this line:
out.distance = dist;
Of course that's weird. An assignment that causes an "unsupported call to function logf" error?
As the code (yes, the code of a single function) is spread over several files, I searched for dumping the CL code and finally found CLOVER_DEBUG=clc. With its help I could finally see this series of statements:
1. dist = 0.5f * r * native_log(r) / (r_dz);
2. if(dist < 0.0f) dist = 0.0f;
3. out.distance = dist;
native_log(r) is the problem. Probably a bug in mesa. But the fun thing is that when the assignment from line 3 is removed, it is not triggered. Or if you replace the condition dist < 0.0f with 1, then it is also not triggered.
Kinda interesting to see how compile errors in later stages are sometimes not hit just because the semantic analysis allows the compiler to throw away the problematic code because it can infer that its result isn't being used anyway.