[libclc] 49/58: Strip opencl.ocl.version metadata

Andreas Boll aboll-guest at moszumanska.debian.org
Thu Oct 6 08:16:34 UTC 2016


This is an automated email from the git hooks/post-receive script.

aboll-guest pushed a commit to branch master
in repository libclc.

commit 1b2f5e03bc09705d5da69e8e4144f65f758d305d
Author: Matt Arsenault <Matthew.Arsenault at amd.com>
Date:   Thu Aug 25 00:25:10 2016 +0000

    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)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-opencl/libclc.git



More information about the Pkg-opencl-commits mailing list