summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/ReachingDefAnalysis.cpp
diff options
context:
space:
mode:
authorMichael Liao <michael.hliao@gmail.com>2019-10-19 00:15:19 +0000
committerMichael Liao <michael.hliao@gmail.com>2019-10-19 00:15:19 +0000
commit243ebfba17da72566ba29a891193e4814cbc4ef3 (patch)
tree494d360ee8310f749feb7b36dfb540274877100a /llvm/lib/CodeGen/ReachingDefAnalysis.cpp
parentb0914e7276bf97cb57f84fecc3a95e0d3ceeaf3e (diff)
downloadbcm5719-llvm-243ebfba17da72566ba29a891193e4814cbc4ef3.tar.gz
bcm5719-llvm-243ebfba17da72566ba29a891193e4814cbc4ef3.zip
[hip][cuda] Fix the extended lambda name mangling issue.
Summary: - HIP/CUDA host side needs to use device kernel symbol name to match the device side binaries. Without a consistent naming between host- and device-side compilations, it's risky that wrong device binaries are executed. Consistent naming is usually not an issue until unnamed types are used, especially the lambda. In this patch, the consistent name mangling is addressed for the extended lambdas, i.e. the lambdas annotated with `__device__`. - In [Itanium C++ ABI][1], the mangling of the lambda is generally unspecified unless, in certain cases, ODR rule is required to ensure consisent naming cross TUs. The extended lambda is such a case as its name may be part of a device kernel function, e.g., the extended lambda is used as a template argument and etc. Thus, we need to force ODR for extended lambdas as they are referenced in both device- and host-side TUs. Furthermore, if a extended lambda is nested in other (extended or not) lambdas, those lambdas are required to follow ODR naming as well. This patch revises the current lambda mangle numbering to force ODR from an extended lambda to all its parent lambdas. - On the other side, the aforementioned ODR naming should not change those lambdas' original linkages, i.e., we cannot replace the original `internal` with `linkonce_odr`; otherwise, we may violate ODR in general. This patch introduces a new field `HasKnownInternalLinkage` in lambda data to decouple the current linkage calculation based on mangling number assigned. [1]: https://itanium-cxx-abi.github.io/cxx-abi/abi.html Reviewers: tra, rsmith, yaxunl, martong, shafik Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D68818 llvm-svn: 375309
Diffstat (limited to 'llvm/lib/CodeGen/ReachingDefAnalysis.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud