The call didn't have the right calling convention, but calls to
kernels are supposed to be illegal anyway.
Details
Diff Detail
Event Timeline
Unfortunately OpenCL allows calls to kernels. We even had a pass to lower such calls.
It seems to remove the test when a caller is in a called function, because the called function is a kernel. But should it be an another function it shall be valid, yet I do not see such test. This is in fact what it would become after kernel call lowering. It seems worth to add such test with a non-kernel caller.
We probably should have a separate phase ordering test for the current scheme, which is not what we have here. However, I'm working on a patch to move this into clang since the comment at the top of the file explaining why this is impossible is wrong
But the test for a call for a non-inlined regular function is still needed regardless of pass ordering.