[SYCL] Ignore unknown users of virtual functions instead of crashing
The SYCLVirtualFunctionsAnalysis pass was crashing (calling llvm_unreachable) when it encountered a non-constant non-global use of an indirectly callable function.
Instead of that just ignore any user we don't know how to handle and log a debug message. The LLVM User hierarchy is mostly closed, so in practice the ignored users are mostly going to be instructions.
ping @intel/dpcpp-tools-reviewers
@intel/dpcpp-tools-reviewers Can you please look at this?
BTW I believe the test failures are unrelated: https://github.com/intel/llvm/issues/17075
Ping.
Hi,
I had a couple of questions (Sorry, new to virtual functions support in SYCL).
- Do we know if the SYCL program (that was provided as a comment in this PR) has all the required markings that are required to support SYCL virtual functions?
- Do we know if the frontend device compiler (till the call to analyze virtual functions) lowers everything (w.r.t virtual functions) correctly and if the LLVM IR fed into the virtual function is as per expectations?
Thanks
I had a couple of questions (Sorry, new to virtual functions support in SYCL).
Np, I'm also only mostly a user of SYCL in this case, I believe I initially discovered this issue while playing with how the virtual function lowering works. @AlexeySachkov might now better as the author of https://github.com/intel/llvm/pull/10540 Though this extension is in a WIP state I assume given the documentation is still pending.
- Do we know if the SYCL program (that was provided as a comment in this PR) has all the required markings that are required to support SYCL virtual functions?
I think yes.
- Do we know if the frontend device compiler (till the call to analyze virtual functions) lowers everything (w.r.t virtual functions) correctly and if the LLVM IR fed into the virtual function is as per expectations?
As far as I could see yes, the job of the frontend here is limited to placing the right LLVM attributes, the rest is done in the middle-end SYCL passes.