diff options
author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2016-08-25 00:25:10 +0000 |
---|---|---|
committer | Matt Arsenault <Matthew.Arsenault@amd.com> | 2016-08-25 00:25:10 +0000 |
commit | 1b2f5e03bc09705d5da69e8e4144f65f758d305d (patch) | |
tree | 302630dc05dbc3ab9f7f92c98fd9d6ce3aedc2fa | |
parent | b674069148135713c41eba492780fb9a9e156a7b (diff) |
Strip opencl.ocl.version metadata
This should be uniqued when linking, but right now it creates
a lot of metadata spam listing the same version. This should also
probably be reporting the compiled version of the user program,
which may differ from the library. Currently the library IR files report
1.0 while 1.1/1.2 are the default for user programs.
git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@279692 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | utils/prepare-builtins.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/utils/prepare-builtins.cpp b/utils/prepare-builtins.cpp index 3122f48..8870672 100644 --- a/utils/prepare-builtins.cpp +++ b/utils/prepare-builtins.cpp @@ -57,6 +57,13 @@ int main(int argc, char **argv) { return 1; } + // Strip the OpenCL version metadata. There are a lot of linked + // modules in the library build, each spamming the same + // version. This may also report a different version than the user + // program is using. This should probably be uniqued when linking. + if (NamedMDNode *OCLVersion = M->getNamedMetadata("opencl.ocl.version")) + M->eraseNamedMetadata(OCLVersion); + // Set linkage of every external definition to linkonce_odr. for (Module::iterator i = M->begin(), e = M->end(); i != e; ++i) { if (!i->isDeclaration() && i->getLinkage() == GlobalValue::ExternalLinkage) |