[PATCH] D50218: [OpenMP] Encode offload target triples into comdat key for offload initialization code
Alexey Bataev via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Aug 3 11:28:09 PDT 2018
ABataev added inline comments.
================
Comment at: lib/CodeGen/CGOpenMPRuntime.cpp:3828-3829
+ RegFnNameParts[1] = "descriptor_reg";
+ for (size_t I = 0; I < Devices.size(); ++I)
+ RegFnNameParts[I + 2U] = Devices[I].getTriple();
+ llvm::sort(RegFnNameParts.begin() + 2, RegFnNameParts.end());
----------------
Use something like this:
```
llvm::copy(Devices, std::next(RegFnNameParts.begin(), 2));
```
================
Comment at: lib/CodeGen/CGOpenMPRuntime.cpp:3830
+ RegFnNameParts[I + 2U] = Devices[I].getTriple();
+ llvm::sort(RegFnNameParts.begin() + 2, RegFnNameParts.end());
+ std::string Descriptor = getName(RegFnNameParts);
----------------
Also, use `std::next(RegFnNameParts.begin(), 2)`
https://reviews.llvm.org/D50218
More information about the cfe-commits
mailing list