[PATCH] D122734: [HIP] Fix mangling number for local struct

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 7 13:59:15 PDT 2022

tra added a comment.

In D122734#3435086 <https://reviews.llvm.org/D122734#3435086>, @yaxunl wrote:

> This patch takes a similar approach as https://reviews.llvm.org/D69322 has done for lambda. When doing host compilation for CUDA/HIP on Windows with MSVC toolchain, mangling number of lambda always uses Itanium mangling number. In this case, mangling number of local struct types always uses Itanium mangling number. I assume this should be fine as long as it is consistent for all HIP programs.

I'm fairly sure that the code does what you need it to do for HIP. What I'm not sure is whether it will impact other users.

I've missed that `getManglingNumber` is part of `MSHIPNumberingContext`, so it is HIP-specific and should not change mangling for non-HIP users.

Would it make it possible to end up with different mangling for the shared code compiled as regular C++ code and host-side code in HIP sources? E.g. from a common header included in both.



More information about the cfe-commits mailing list