[llvm] [Offload][OpenMP] Prettify error messages by "demangling" the kernel name (PR #101400)

Johannes Doerfert via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 1 15:19:20 PDT 2024


jdoerfert wrote:

> > I ran into a similar issue downstream and extended `llvm::demangle` to support these function names itself. Would it make sense to do this upstream too? The format of the unmangled name would be similar to what `prettifyFunctionName` produces except without the mangled name added on the end.
> 
> We could possibly make the OpenMP offloading kernel mangling compatible with the mangling format, then we'd get it for free. The issue is that the manged kernel name needs to contain something pseudo-unique (We use the file's inode + the line number currently). Everything else like `__omp_offloading` isn't strictly necessary AFAIK.

We could make it regular mangling, but I'm not sold it is worth it.
Having the prefix is actually somewhat nice.

@dwoodwor-intel We should decide if we want to use Itanium mangling or not, if not, I'd be happy to review your changes and you can remove some of the stuff in this PR. We can always add the original kernel name, which is useful since other tools emit it, e.g., rocprof.

https://github.com/llvm/llvm-project/pull/101400


More information about the llvm-commits mailing list