aboutsummaryrefslogtreecommitdiff
path: root/libclc
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2016-08-25 00:25:10 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2016-08-25 00:25:10 +0000
commit7ef7e6aacd5446118cb284244f80a7cbc3faa241 (patch)
tree2781c72fef545909fe199f5a0fc97ab9f7945782 /libclc
parent72ae62c1c0cb31e6478b73fcf241d1fab0485ccb (diff)
downloadllvm-7ef7e6aacd5446118cb284244f80a7cbc3faa241.zip
llvm-7ef7e6aacd5446118cb284244f80a7cbc3faa241.tar.gz
llvm-7ef7e6aacd5446118cb284244f80a7cbc3faa241.tar.bz2
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. llvm-svn: 279692
Diffstat (limited to 'libclc')
-rw-r--r--libclc/utils/prepare-builtins.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/libclc/utils/prepare-builtins.cpp b/libclc/utils/prepare-builtins.cpp
index 3122f48..8870672 100644
--- a/libclc/utils/prepare-builtins.cpp
+++ b/libclc/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)