From 1b2f5e03bc09705d5da69e8e4144f65f758d305d Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Thu, 25 Aug 2016 00:25:10 +0000 Subject: 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 --- utils/prepare-builtins.cpp | 7 +++++++ 1 file changed, 7 insertions(+) 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) -- cgit v1.2.3