[libclc] r236113 - Allow compilation depending to the LLVM version

Tom Stellard thomas.stellard at amd.com
Wed Apr 29 08:37:06 PDT 2015


Author: tstellar
Date: Wed Apr 29 10:37:06 2015
New Revision: 236113

URL: http://llvm.org/viewvc/llvm-project?rev=236113&view=rev
Log:
Allow compilation depending to the LLVM version

It allows to keep temporary compatibilty with older version.
For exemple, this can be use when change are not to large.

Patch by: EdB

Added:
    libclc/trunk/generic/lib/LLVM3.6/
    libclc/trunk/generic/lib/LLVM3.6/subnormal_helper_func.ll
    libclc/trunk/generic/lib/SOURCES_LLVM3.6
Modified:
    libclc/trunk/configure.py

Modified: libclc/trunk/configure.py
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/configure.py?rev=236113&r1=236112&r2=236113&view=diff
==============================================================================
--- libclc/trunk/configure.py (original)
+++ libclc/trunk/configure.py Wed Apr 29 10:37:06 2015
@@ -70,6 +70,8 @@ if (int(llvm_version[0]) != 3 and int(ll
     print "libclc requires LLVM 3.6"
     sys.exit(1)
 
+llvm_string_version = 'LLVM' + llvm_version[0] + '.' + llvm_version[1]
+
 llvm_system_libs = llvm_config(['--system-libs'])
 llvm_bindir = llvm_config(['--bindir'])
 llvm_core_libs = llvm_config(['--libs', 'core', 'bitreader', 'bitwriter']) + ' ' + \
@@ -189,6 +191,7 @@ for target in targets:
 
     objects = []
     sources_seen = set()
+    compats_seen = set()
 
     if device['gpu'] == '':
       full_target_name = target
@@ -201,6 +204,14 @@ for target in targets:
       subdir_list_file = os.path.join(libdir, 'SOURCES')
       manifest_deps.add(subdir_list_file)
       override_list_file = os.path.join(libdir, 'OVERRIDES')
+      compat_list_file = os.path.join(libdir,
+        'SOURCES_' + llvm_string_version)
+
+      # Build compat list
+      if os.path.exists(compat_list_file):
+        for compat in open(compat_list_file).readlines():
+          compat = compat.rstrip()
+          compats_seen.add(compat)
 
       # Add target overrides
       if os.path.exists(override_list_file):
@@ -214,7 +225,10 @@ for target in targets:
           sources_seen.add(src)
           obj = os.path.join(target, 'lib', src + obj_suffix + '.bc')
           objects.append(obj)
-          src_file = os.path.join(libdir, src)
+          src_path = libdir
+          if src in compats_seen:
+            src_path = os.path.join(libdir, llvm_string_version)
+          src_file = os.path.join(src_path, src)
           ext = os.path.splitext(src)[1]
           if ext == '.ll':
             b.build(obj, 'LLVM_AS', src_file)

Added: libclc/trunk/generic/lib/LLVM3.6/subnormal_helper_func.ll
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/LLVM3.6/subnormal_helper_func.ll?rev=236113&view=auto
==============================================================================
--- libclc/trunk/generic/lib/LLVM3.6/subnormal_helper_func.ll (added)
+++ libclc/trunk/generic/lib/LLVM3.6/subnormal_helper_func.ll Wed Apr 29 10:37:06 2015
@@ -0,0 +1,8 @@
+ at __CLC_SUBNORMAL_DISABLE = external global i1
+
+define i1 @__clc_subnormals_disabled() #0 {
+  %disable = load i1* @__CLC_SUBNORMAL_DISABLE
+  ret i1 %disable
+}
+
+attributes #0 = { alwaysinline }

Added: libclc/trunk/generic/lib/SOURCES_LLVM3.6
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/SOURCES_LLVM3.6?rev=236113&view=auto
==============================================================================
--- libclc/trunk/generic/lib/SOURCES_LLVM3.6 (added)
+++ libclc/trunk/generic/lib/SOURCES_LLVM3.6 Wed Apr 29 10:37:06 2015
@@ -0,0 +1 @@
+subnormal_helper_func.ll





More information about the cfe-commits mailing list