diff --git a/hpvm/test/README.md b/hpvm/test/README.md index 0032268c55b2234118a3ec9243a8191147eb1e1f..59832c64452d1103d8ff0cd7148a9379611b810f 100644 --- a/hpvm/test/README.md +++ b/hpvm/test/README.md @@ -1,5 +1,7 @@ # Using HPVM -Tests are provided, along with a template Makefile for user projects. +The below benchmarks are provided with HPVM, along with a template Makefile for user projects. In order to be able to build the existing benchmarks, a new `Makefile.config` must be created in [include](/hpvm/test/include) based on the existing `Makefile.config.example`. This configuration file must set up the following paths: +* LLVM_BUILD_DIR: should point to your local `build` directory of HPVM. +* CUDA_PATH: should point to your local CUDA installation. ## Parboil Several tests from the [parboil suite](http://impact.crhc.illinois.edu/parboil/parboil.aspx) have been ported to HPVM. diff --git a/hpvm/test/hpvm-cava/Makefile b/hpvm/test/hpvm-cava/Makefile index b69b9b9c48b8314db45f084b8c570431514a3b34..d172fd9ee2861c4af64a4ee177c65f899941c42f 100644 --- a/hpvm/test/hpvm-cava/Makefile +++ b/hpvm/test/hpvm-cava/Makefile @@ -4,7 +4,7 @@ # Paths to some dependencies (e.g., HPVM, LLVM) must exist in Makefile.config, # which can be copied from Makefile.config.example for a start. -CONFIG_FILE := Makefile.config +CONFIG_FILE := ../include/Makefile.config ifeq ($(wildcard $(CONFIG_FILE)),) $(error $(CONFIG_FILE) not found. See $(CONFIG_FILE).example) @@ -26,13 +26,12 @@ CURRENT_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) INCLUDES += -I$(SRC_DIR) -I$(CAM_PIPE_SRC_DIR) -INCLUDES += -I$(LLVM_SRC_ROOT)/include -I../include -I$(HPVM_BUILD_DIR)/include ifneq ($(CONFUSE_ROOT),) INCLUDES += -I$(CONFUSE_ROOT)/include LFLAGS += -L$(CONFUSE_ROOT)/lib endif -EXE = cava-hpvm-$(VERSION)-$(TARGET) +EXE = cava-hpvm-$(TARGET) LFLAGS += -pthread @@ -52,7 +51,7 @@ OBJS_CFLAGS = -O1 $(APP_CFLAGS) $(PLATFORM_CFLAGS) CXXFLAGS = $(APP_CXXFLAGS) $(PLATFORM_CXXFLAGS) LDFLAGS= $(APP_LDFLAGS) $(PLATFORM_LDFLAGS) -HPVM_RT_PATH = $(LLVM_SRC_ROOT)/../build/tools/hpvm/projects/hpvm-rt +HPVM_RT_PATH = $(LLVM_BUILD_DIR)/tools/hpvm/projects/hpvm-rt HPVM_RT_LIB = $(HPVM_RT_PATH)/hpvm-rt.bc @@ -97,7 +96,6 @@ endif # Targets default: $(FAILSAFE) $(BUILD_DIR) $(KERNEL_OCL) $(EXE) -#default: $(FAILSAFE) $(BUILD_DIR) $(KERNEL_OCL) $(SPIR_ASSEMBLY) $(AOC_CL) $(AOCL_ASSEMBLY) $(EXE) $(KERNEL_OCL) : $(KERNEL) $(OCLBE) $< -o $@ diff --git a/hpvm/test/hpvm-cava/Makefile.config.example b/hpvm/test/hpvm-cava/Makefile.config.example deleted file mode 100644 index 2627ca508f17acb96c858bf4473eed4d89ebec20..0000000000000000000000000000000000000000 --- a/hpvm/test/hpvm-cava/Makefile.config.example +++ /dev/null @@ -1,23 +0,0 @@ -CUDA_PATH=/software/cuda-9.1 -CUDA_LIB_PATH=$(CUDA_PATH)/lib64 -OPENCL_PATH=/software/cuda-9.1 -OPENCL_LIB_PATH=$(OPENCL_PATH)/lib64 - -LLVM_BUILD_DIR =$(LLVM_SRC_ROOT)/../build -CC = $(LLVM_BUILD_DIR)/bin/clang -PLATFORM_CFLAGS = -I$(LLVM_SRC_ROOT)/include -I$(OPENCL_PATH)/include/CL/ -I../include -I$(LLVM_BUILD_DIR)/include -OCLBE = $(LLVM_BUILD_DIR)/bin/llvm-cbe - -CXX = $(LLVM_BUILD_DIR)/bin/clang++ -PLATFORM_CXXFLAGS = -I$(LLVM_SRC_ROOT)/include -I$(OPENCL_PATH)/include/CL/ -I../include -I$(LLVM_BUILD_DIR)/include - -LINKER = $(LLVM_BUILD_DIR)/bin/clang++ -PLATFORM_LDFLAGS = -lm -lpthread -lrt -lOpenCL -L$(OPENCL_LIB_PATH) - -LLVM_LIB_PATH = $(LLVM_BUILD_DIR)/lib -LLVM_BIN_PATH = $(LLVM_BUILD_DIR)/bin - -OPT = $(LLVM_BIN_PATH)/opt -LLVM_LINK = $(LLVM_BIN_PATH)/llvm-link -LLVM_AS = $(LLVM_BIN_PATH)/llvm-as -LIT = $(LLVM_BIN_PATH)/llvm-lit diff --git a/hpvm/test/hpvm-cava/cava-hpvm-gpu b/hpvm/test/hpvm-cava/cava-hpvm-gpu new file mode 100755 index 0000000000000000000000000000000000000000..f9aee40f015e6f64010a7eb70932124835c17f4b Binary files /dev/null and b/hpvm/test/hpvm-cava/cava-hpvm-gpu differ diff --git a/hpvm/test/template/Makefile.config.example b/hpvm/test/include/Makefile.config.example similarity index 64% rename from hpvm/test/template/Makefile.config.example rename to hpvm/test/include/Makefile.config.example index 9b182a3b7998f3a302a758796a9fe950740b1366..d37084cef49a65e823f32c338c8da0c438036d8f 100644 --- a/hpvm/test/template/Makefile.config.example +++ b/hpvm/test/include/Makefile.config.example @@ -4,14 +4,14 @@ CUDA_LIB_PATH=$(CUDA_PATH)/lib64 OPENCL_PATH=$(CUDA_PATH) OPENCL_LIB_PATH=$(OPENCL_PATH)/lib64 -# These paths should be set based on your HPVM build and source locations. +# This path should be set to your HPVM build directory +LLVM_BUILD_DIR =PATH/TO/LOCAL/HPVM/BUILD -LLVM_BUILD_DIR =$(LLVM_SRC_ROOT)/../build CC = $(LLVM_BUILD_DIR)/bin/clang -PLATFORM_CFLAGS = -I$(LLVM_SRC_ROOT)/include -I$(OPENCL_PATH)/include/CL/ -I$(LLVM_BUILD_DIR)/include +PLATFORM_CFLAGS = -I$(OPENCL_PATH)/include/CL/ -I. CXX = $(LLVM_BUILD_DIR)/bin/clang++ -PLATFORM_CXXFLAGS = -I$(LLVM_SRC_ROOT)/include -I$(OPENCL_PATH)/include/CL/ -I$(LLVM_BUILD_DIR)/include +PLATFORM_CXXFLAGS = -I$(OPENCL_PATH)/include/CL/ -I. LINKER = $(LLVM_BUILD_DIR)/bin/clang++ PLATFORM_LDFLAGS = -lm -lpthread -lrt -lOpenCL -L$(OPENCL_LIB_PATH) diff --git a/hpvm/test/lit.cfg.py b/hpvm/test/lit.cfg.py new file mode 100644 index 0000000000000000000000000000000000000000..86acab4f03685239d716c7e8685beaabc1f2a36b --- /dev/null +++ b/hpvm/test/lit.cfg.py @@ -0,0 +1,335 @@ +# -*- Python -*- + +# Configuration file for the 'lit' test runner. + +import os +import sys +import re +import platform +import subprocess + +import lit.util +import lit.formats +from lit.llvm import llvm_config +from lit.llvm.subst import FindTool +from lit.llvm.subst import ToolSubst + +# name: The name of this test suite. +config.name = 'HPVM' + +# testFormat: The test format to use to interpret tests. +config.test_format = lit.formats.ShTest(not llvm_config.use_lit_shell) + +# suffixes: A list of file extensions to treat as test files. This is overriden +# by individual lit.local.cfg files in the test subdirectories. +config.suffixes = ['.ll', '.c', '.cxx', '.test', '.txt', '.s', '.mir'] + +# excludes: A list of directories to exclude from the testsuite. The 'Inputs' +# subdirectories contain auxiliary inputs for various tests in their parent +# directories. +config.excludes = ['Inputs', 'CMakeLists.txt', 'README.txt', 'LICENSE.txt'] + +# test_source_root: The root path where tests are located. +config.test_source_root = os.path.dirname(__file__) + +# test_exec_root: The root path where tests should be run. +config.test_exec_root = os.path.join(config.llvm_obj_root, 'test') + +# Tweak the PATH to include the tools dir. +llvm_config.with_environment('PATH', config.llvm_tools_dir, append_path=True) + +# Propagate some variables from the host environment. +llvm_config.with_system_environment( + ['HOME', 'INCLUDE', 'LIB', 'TMP', 'TEMP', 'ASAN_SYMBOLIZER_PATH', 'MSAN_SYMBOLIZER_PATH']) + + +# Set up OCAMLPATH to include newly built OCaml libraries. +top_ocaml_lib = os.path.join(config.llvm_lib_dir, 'ocaml') +llvm_ocaml_lib = os.path.join(top_ocaml_lib, 'llvm') + +llvm_config.with_system_environment('OCAMLPATH') +llvm_config.with_environment('OCAMLPATH', top_ocaml_lib, append_path=True) +llvm_config.with_environment('OCAMLPATH', llvm_ocaml_lib, append_path=True) + +llvm_config.with_system_environment('CAML_LD_LIBRARY_PATH') +llvm_config.with_environment( + 'CAML_LD_LIBRARY_PATH', llvm_ocaml_lib, append_path=True) + + +# Set up OCAMLRUNPARAM to enable backtraces in OCaml tests. +llvm_config.with_environment('OCAMLRUNPARAM', 'b') + +llvm_config.with_environment('LLVM_SRC_ROOT', config.llvm_src_root) + +# Provide the path to asan runtime lib 'libclang_rt.asan_osx_dynamic.dylib' if +# available. This is darwin specific since it's currently only needed on darwin. + + +def get_asan_rtlib(): + if not 'Address' in config.llvm_use_sanitizer or \ + not 'Darwin' in config.host_os or \ + not 'x86' in config.host_triple: + return '' + try: + import glob + except: + print('glob module not found, skipping get_asan_rtlib() lookup') + return '' + # The libclang_rt.asan_osx_dynamic.dylib path is obtained using the relative + # path from the host cc. + host_lib_dir = os.path.join(os.path.dirname(config.host_cc), '../lib') + asan_dylib_dir_pattern = host_lib_dir + \ + '/clang/*/lib/darwin/libclang_rt.asan_osx_dynamic.dylib' + found_dylibs = glob.glob(asan_dylib_dir_pattern) + if len(found_dylibs) != 1: + return '' + return found_dylibs[0] + + +llvm_config.use_default_substitutions() + +# Add site-specific substitutions. +config.substitutions.append(('%llvmshlibdir', config.llvm_shlib_dir)) +config.substitutions.append(('%shlibext', config.llvm_shlib_ext)) +config.substitutions.append(('%exeext', config.llvm_exe_ext)) + + +lli_args = [] +# The target triple used by default by lli is the process target triple (some +# triple appropriate for generating code for the current process) but because +# we don't support COFF in MCJIT well enough for the tests, force ELF format on +# Windows. FIXME: the process target triple should be used here, but this is +# difficult to obtain on Windows. +if re.search(r'cygwin|windows-gnu|windows-msvc', config.host_triple): + lli_args = ['-mtriple=' + config.host_triple + '-elf'] + +llc_args = [] + +# Similarly, have a macro to use llc with DWARF even when the host is Windows +if re.search(r'windows-msvc', config.target_triple): + llc_args = [' -mtriple=' + + config.target_triple.replace('-msvc', '-gnu')] + +# Provide the path to asan runtime lib if available. On darwin, this lib needs +# to be loaded via DYLD_INSERT_LIBRARIES before libLTO.dylib in case the files +# to be linked contain instrumented sanitizer code. +ld64_cmd = config.ld64_executable +asan_rtlib = get_asan_rtlib() +if asan_rtlib: + ld64_cmd = 'DYLD_INSERT_LIBRARIES={} {}'.format(asan_rtlib, ld64_cmd) + +ocamlc_command = '%s ocamlc -cclib -L%s %s' % ( + config.ocamlfind_executable, config.llvm_lib_dir, config.ocaml_flags) +ocamlopt_command = 'true' +if config.have_ocamlopt: + ocamlopt_command = '%s ocamlopt -cclib -L%s -cclib -Wl,-rpath,%s %s' % ( + config.ocamlfind_executable, config.llvm_lib_dir, config.llvm_lib_dir, config.ocaml_flags) + +opt_viewer_cmd = '%s %s/tools/opt-viewer/opt-viewer.py' % (sys.executable, config.llvm_src_root) + +tools = [ + ToolSubst('%lli', FindTool('lli'), post='.', extra_args=lli_args), + ToolSubst('%llc_dwarf', FindTool('llc'), extra_args=llc_args), + ToolSubst('%go', config.go_executable, unresolved='ignore'), + ToolSubst('%gold', config.gold_executable, unresolved='ignore'), + ToolSubst('%ld64', ld64_cmd, unresolved='ignore'), + ToolSubst('%ocamlc', ocamlc_command, unresolved='ignore'), + ToolSubst('%ocamlopt', ocamlopt_command, unresolved='ignore'), + ToolSubst('%opt-viewer', opt_viewer_cmd), + ToolSubst('%llvm-objcopy', FindTool('llvm-objcopy')), + ToolSubst('%llvm-strip', FindTool('llvm-strip')), +] + +# FIXME: Why do we have both `lli` and `%lli` that do slightly different things? +tools.extend([ + 'dsymutil', 'lli', 'lli-child-target', 'llvm-ar', 'llvm-as', + 'llvm-bcanalyzer', 'llvm-config', 'llvm-cov', 'llvm-cxxdump', 'llvm-cvtres', + 'llvm-diff', 'llvm-dis', 'llvm-dwarfdump', 'llvm-exegesis', 'llvm-extract', + 'llvm-isel-fuzzer', 'llvm-jitlink', 'llvm-opt-fuzzer', 'llvm-lib', + 'llvm-link', 'llvm-lto', 'llvm-lto2', 'llvm-mc', 'llvm-mca', + 'llvm-modextract', 'llvm-nm', 'llvm-objcopy', 'llvm-objdump', + 'llvm-pdbutil', 'llvm-profdata', 'llvm-ranlib', 'llvm-rc', 'llvm-readelf', + 'llvm-readobj', 'llvm-rtdyld', 'llvm-size', 'llvm-split', 'llvm-strings', + 'llvm-strip', 'llvm-tblgen', 'llvm-undname', 'llvm-c-test', 'llvm-cxxfilt', + 'llvm-xray', 'yaml2obj', 'obj2yaml', 'yaml-bench', 'verify-uselistorder', + 'bugpoint', 'llc', 'llvm-symbolizer', 'opt', 'sancov', 'sanstats']) + +# The following tools are optional +tools.extend([ + ToolSubst('llvm-go', unresolved='ignore'), + ToolSubst('llvm-mt', unresolved='ignore'), + ToolSubst('Kaleidoscope-Ch3', unresolved='ignore'), + ToolSubst('Kaleidoscope-Ch4', unresolved='ignore'), + ToolSubst('Kaleidoscope-Ch5', unresolved='ignore'), + ToolSubst('Kaleidoscope-Ch6', unresolved='ignore'), + ToolSubst('Kaleidoscope-Ch7', unresolved='ignore'), + ToolSubst('Kaleidoscope-Ch8', unresolved='ignore')]) + +llvm_config.add_tool_substitutions(tools, config.llvm_tools_dir) + +# Targets + +config.targets = frozenset(config.targets_to_build.split()) + +for arch in config.targets_to_build.split(): + config.available_features.add(arch.lower() + '-registered-target') + +# Features +known_arches = ["x86_64", "mips64", "ppc64", "aarch64"] +if (config.host_ldflags.find("-m32") < 0 + and any(config.llvm_host_triple.startswith(x) for x in known_arches)): + config.available_features.add("llvm-64-bits") + +config.available_features.add("host-byteorder-" + sys.byteorder + "-endian") + +if sys.platform in ['win32']: + # ExecutionEngine, no weak symbols in COFF. + config.available_features.add('uses_COFF') +else: + # Others/can-execute.txt + config.available_features.add('can-execute') + +# Loadable module +if config.has_plugins: + config.available_features.add('plugins') + +# Static libraries are not built if BUILD_SHARED_LIBS is ON. +if not config.build_shared_libs and not config.link_llvm_dylib: + config.available_features.add('static-libs') + +def have_cxx_shared_library(): + readobj_exe = lit.util.which('llvm-readobj', config.llvm_tools_dir) + if not readobj_exe: + print('llvm-readobj not found') + return False + + try: + readobj_cmd = subprocess.Popen( + [readobj_exe, '-needed-libs', readobj_exe], stdout=subprocess.PIPE) + except OSError: + print('could not exec llvm-readobj') + return False + + readobj_out = readobj_cmd.stdout.read().decode('ascii') + readobj_cmd.wait() + + regex = re.compile(r'(libc\+\+|libstdc\+\+|msvcp).*\.(so|dylib|dll)') + needed_libs = False + for line in readobj_out.splitlines(): + if 'NeededLibraries [' in line: + needed_libs = True + if ']' in line: + needed_libs = False + if needed_libs and regex.search(line.lower()): + return True + return False + +if have_cxx_shared_library(): + config.available_features.add('cxx-shared-library') + +if config.libcxx_used: + config.available_features.add('libcxx-used') + +# Direct object generation +if not 'hexagon' in config.target_triple: + config.available_features.add('object-emission') + +# LLVM can be configured with an empty default triple +# Some tests are "generic" and require a valid default triple +if config.target_triple: + config.available_features.add('default_triple') + +import subprocess + + +def have_ld_plugin_support(): + if not os.path.exists(os.path.join(config.llvm_shlib_dir, 'LLVMgold' + config.llvm_shlib_ext)): + return False + + ld_cmd = subprocess.Popen( + [config.gold_executable, '--help'], stdout=subprocess.PIPE, env={'LANG': 'C'}) + ld_out = ld_cmd.stdout.read().decode() + ld_cmd.wait() + + if not '-plugin' in ld_out: + return False + + # check that the used emulations are supported. + emu_line = [l for l in ld_out.split('\n') if 'supported emulations' in l] + if len(emu_line) != 1: + return False + emu_line = emu_line[0] + fields = emu_line.split(':') + if len(fields) != 3: + return False + emulations = fields[2].split() + if 'elf_x86_64' not in emulations: + return False + if 'elf32ppc' in emulations: + config.available_features.add('ld_emu_elf32ppc') + + ld_version = subprocess.Popen( + [config.gold_executable, '--version'], stdout=subprocess.PIPE, env={'LANG': 'C'}) + if not 'GNU gold' in ld_version.stdout.read().decode(): + return False + ld_version.wait() + + return True + + +if have_ld_plugin_support(): + config.available_features.add('ld_plugin') + + +def have_ld64_plugin_support(): + if not os.path.exists(os.path.join(config.llvm_shlib_dir, 'libLTO' + config.llvm_shlib_ext)): + return False + + if config.ld64_executable == '': + return False + + ld_cmd = subprocess.Popen( + [config.ld64_executable, '-v'], stderr=subprocess.PIPE) + ld_out = ld_cmd.stderr.read().decode() + ld_cmd.wait() + + if 'ld64' not in ld_out or 'LTO' not in ld_out: + return False + + return True + + +if have_ld64_plugin_support(): + config.available_features.add('ld64_plugin') + +# Ask llvm-config about asserts and global-isel. +llvm_config.feature_config( + [('--assertion-mode', {'ON': 'asserts'}), + ('--has-global-isel', {'ON': 'global-isel'})]) + +if 'darwin' == sys.platform: + try: + sysctl_cmd = subprocess.Popen(['sysctl', 'hw.optional.fma'], + stdout=subprocess.PIPE) + except OSError: + print('Could not exec sysctl') + result = sysctl_cmd.stdout.read().decode('ascii') + if -1 != result.find('hw.optional.fma: 1'): + config.available_features.add('fma3') + sysctl_cmd.wait() + +# .debug_frame is not emitted for targeting Windows x64. +if not re.match(r'^x86_64.*-(windows-gnu|windows-msvc)', config.target_triple): + config.available_features.add('debug_frame') + +if config.have_libxar: + config.available_features.add('xar') + +if config.enable_threads: + config.available_features.add('thread_support') + +if config.llvm_libxml2_enabled: + config.available_features.add('libxml2') + +if config.have_opt_viewer_modules: + config.available_features.add('have_opt_viewer_modules') diff --git a/hpvm/test/lit.local.cfg b/hpvm/test/lit.local.cfg deleted file mode 100644 index b9086c30005cdae7f6b0f74edcb9728a1430222b..0000000000000000000000000000000000000000 --- a/hpvm/test/lit.local.cfg +++ /dev/null @@ -1,5 +0,0 @@ -llvm_src = os.environ.get('LLVM_SRC_ROOT') -if llvm_src == None: - lit.fatal('Define environment variable LLVM_SRC_ROOT') -config.substitutions.append(('%llvm_src', llvm_src)) -config.suffixes = ['.ll'] diff --git a/hpvm/test/lit.site.cfg.py.in b/hpvm/test/lit.site.cfg.py.in new file mode 100644 index 0000000000000000000000000000000000000000..3fc50039dfa49299c6151fa7bb009e4de4e5d1f8 --- /dev/null +++ b/hpvm/test/lit.site.cfg.py.in @@ -0,0 +1,64 @@ +@LIT_SITE_CFG_IN_HEADER@ + +import sys + +config.host_triple = "@LLVM_HOST_TRIPLE@" +config.target_triple = "@TARGET_TRIPLE@" +config.llvm_src_root = "@LLVM_SOURCE_DIR@" +config.llvm_obj_root = "@LLVM_BINARY_DIR@" +config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" +config.llvm_lib_dir = "@LLVM_LIBRARY_DIR@" +config.llvm_shlib_dir = "@SHLIBDIR@" +config.llvm_shlib_ext = "@SHLIBEXT@" +config.llvm_exe_ext = "@EXEEXT@" +config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@" +config.python_executable = "@PYTHON_EXECUTABLE@" +config.gold_executable = "@GOLD_EXECUTABLE@" +config.ld64_executable = "@LD64_EXECUTABLE@" +config.ocamlfind_executable = "@OCAMLFIND@" +config.have_ocamlopt = @HAVE_OCAMLOPT@ +config.have_ocaml_ounit = @HAVE_OCAML_OUNIT@ +config.ocaml_flags = "@OCAMLFLAGS@" +config.include_go_tests = @LLVM_INCLUDE_GO_TESTS@ +config.go_executable = "@GO_EXECUTABLE@" +config.enable_shared = @ENABLE_SHARED@ +config.enable_assertions = @ENABLE_ASSERTIONS@ +config.targets_to_build = "@TARGETS_TO_BUILD@" +config.native_target = "@LLVM_NATIVE_ARCH@" +config.llvm_bindings = "@LLVM_BINDINGS@".split(' ') +config.host_os = "@HOST_OS@" +config.host_cc = "@HOST_CC@" +config.host_cxx = "@HOST_CXX@" +config.host_ldflags = "@HOST_LDFLAGS@" +config.llvm_use_intel_jitevents = @LLVM_USE_INTEL_JITEVENTS@ +config.llvm_use_sanitizer = "@LLVM_USE_SANITIZER@" +config.have_zlib = @HAVE_LIBZ@ +config.have_libxar = @HAVE_LIBXAR@ +config.have_dia_sdk = @LLVM_ENABLE_DIA_SDK@ +config.enable_ffi = @LLVM_ENABLE_FFI@ +config.build_examples = @LLVM_BUILD_EXAMPLES@ +config.enable_threads = @LLVM_ENABLE_THREADS@ +config.build_shared_libs = @BUILD_SHARED_LIBS@ +config.link_llvm_dylib = @LLVM_LINK_LLVM_DYLIB@ +config.llvm_libxml2_enabled = @LLVM_LIBXML2_ENABLED@ +config.llvm_host_triple = '@LLVM_HOST_TRIPLE@' +config.host_arch = "@HOST_ARCH@" +config.have_opt_viewer_modules = @LLVM_HAVE_OPT_VIEWER_MODULES@ +config.libcxx_used = @LLVM_LIBCXX_USED@ +config.has_plugins = @LLVM_ENABLE_PLUGINS@ + +# Support substitution of the tools_dir with user parameters. This is +# used when we can't determine the tool dir at configuration time. +try: + config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params + config.llvm_shlib_dir = config.llvm_shlib_dir % lit_config.params +except KeyError: + e = sys.exc_info()[1] + key, = e.args + lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key)) + +import lit.llvm +lit.llvm.initialize(lit_config, config) + +# Let the main config do the real work. +lit_config.load_config(config, "@LLVM_SOURCE_DIR@/tools/hpvm/test/lit.cfg.py") diff --git a/hpvm/test/parboil/benchmarks/lbm/Makefile b/hpvm/test/parboil/benchmarks/lbm/Makefile index af7215ff7039795e2d09ce98af675a851b32b0cb..49b8ac896818aa4386a63544f6f5b2f692f9752d 100644 --- a/hpvm/test/parboil/benchmarks/lbm/Makefile +++ b/hpvm/test/parboil/benchmarks/lbm/Makefile @@ -1,4 +1,4 @@ -PARBOIL_ROOT = $(LLVM_SRC_ROOT)/tools/hpvm/test/parboil +PARBOIL_ROOT = ../../ APP = lbm ifeq ($(NUM_CORES),) diff --git a/hpvm/test/parboil/benchmarks/lbm/lbm-hpvm b/hpvm/test/parboil/benchmarks/lbm/lbm-hpvm new file mode 100755 index 0000000000000000000000000000000000000000..9cb786b4cf6f082f9c885ba90c9e8d9af240f213 Binary files /dev/null and b/hpvm/test/parboil/benchmarks/lbm/lbm-hpvm differ diff --git a/hpvm/test/parboil/benchmarks/lbm/run/hpvm/short/reference.dat b/hpvm/test/parboil/benchmarks/lbm/run/hpvm/short/reference.dat new file mode 100644 index 0000000000000000000000000000000000000000..3ca9e0c128ae645fe43a48b2ce7d3474016fcd59 Binary files /dev/null and b/hpvm/test/parboil/benchmarks/lbm/run/hpvm/short/reference.dat differ diff --git a/hpvm/test/parboil/benchmarks/sgemm/Makefile b/hpvm/test/parboil/benchmarks/sgemm/Makefile index 4757432d224ea5a1aaa762bfc89c1c89e869bd32..64968449c5e01ec225ca3e8ff48cd68f437f3da1 100644 --- a/hpvm/test/parboil/benchmarks/sgemm/Makefile +++ b/hpvm/test/parboil/benchmarks/sgemm/Makefile @@ -1,9 +1,9 @@ -PARBOIL_ROOT = $(LLVM_SRC_ROOT)/tools/hpvm/test/parboil +PARBOIL_ROOT = ../../ APP = sgemm # Default compile hpvm ifeq ($(VERSION),) - VERSION = hpvm_sh + VERSION = hpvm endif # Default use small test case diff --git a/hpvm/test/parboil/benchmarks/sgemm/sgemm-hpvm b/hpvm/test/parboil/benchmarks/sgemm/sgemm-hpvm new file mode 100755 index 0000000000000000000000000000000000000000..1afb3bfe46aeb27aaa940a35218c6f5e8d3ad65b Binary files /dev/null and b/hpvm/test/parboil/benchmarks/sgemm/sgemm-hpvm differ diff --git a/hpvm/test/parboil/common/Makefile.conf b/hpvm/test/parboil/common/Makefile.conf index 9d3123260c6322443de8541685312a824c802a39..80939616e06996e520d409737e88c95373fa3c35 100644 --- a/hpvm/test/parboil/common/Makefile.conf +++ b/hpvm/test/parboil/common/Makefile.conf @@ -1,4 +1,6 @@ -CUDA_PATH=/software/cuda-9.1/ -CUDA_LIB_PATH=/software/cuda-9.1/lib64/ -OPENCL_PATH=/opt/intel/opencl-sdk/ -OPENCL_LIB_PATH=/usr/lib64/ +CONFIG_FILE := $(PARBOIL_ROOT)/../include/Makefile.config + +ifeq ($(wildcard $(CONFIG_FILE)),) + $(error $(CONFIG_FILE) not found. See $(CONFIG_FILE).example) +endif +include $(CONFIG_FILE) diff --git a/hpvm/test/parboil/common/mk/Makefile b/hpvm/test/parboil/common/mk/Makefile index 3be9e351054b5cb6d3428010bfdca182d501bf82..f0c2f6476665f316335e387d8e06aa44ac03c1bf 100644 --- a/hpvm/test/parboil/common/mk/Makefile +++ b/hpvm/test/parboil/common/mk/Makefile @@ -14,9 +14,6 @@ include $(PARBOIL_ROOT)/common/Makefile.conf SRC_MK=$(SRCDIR)/Makefile include $(SRC_MK) -PLATFORM_MK=$(PARBOIL_ROOT)/common/platform/$(LANGUAGE).$(PLATFORM).mk -include $(PLATFORM_MK) - LANGUAGE_MK=$(PARBOIL_ROOT)/common/mk/$(LANGUAGE).mk include $(LANGUAGE_MK) diff --git a/hpvm/test/parboil/common/mk/hpvm.mk b/hpvm/test/parboil/common/mk/hpvm.mk index cbc4071be246517e9d0d70a7c5d220e04f48f427..e42e95f0d788a5af278ba46133d1fe7ce3eee44c 100755 --- a/hpvm/test/parboil/common/mk/hpvm.mk +++ b/hpvm/test/parboil/common/mk/hpvm.mk @@ -10,33 +10,16 @@ CXXFLAGS=$(LANG_CXXFLAGS) $(PLATFORM_CXXFLAGS) $(APP_CXXFLAGS) LDFLAGS=$(LANG_LDFLAGS) $(PLATFORM_LDFLAGS) $(APP_LDFLAGS) # HPVM -LIBCLC_LIB_PATH = $(LLVM_SRC_ROOT)/../libclc/built_libs -HPVM_RT_PATH = $(LLVM_SRC_ROOT)/../build/tools/hpvm/projects/hpvm-rt +HPVM_RT_PATH = $(LLVM_BUILD_DIR)/tools/hpvm/projects/hpvm-rt HPVM_RT_LIB = $(HPVM_RT_PATH)/hpvm-rt.bc -#LIBCLC_NVPTX_LIB = $(LIBCLC_LIB_PATH)/nvptx--nvidiacl.bc -LIBCLC_NVPTX_LIB = $(LIBCLC_LIB_PATH)/nvptx64--nvidiacl.bc -#LIBCLC_NVPTX_LIB = nvptx64--nvidiacl.bc - -LLVM_34_AS = /opt/llvm/bin/llvm-as TESTGEN_OPTFLAGS = -load LLVMGenHPVM.so -genhpvm -globaldce KERNEL_GEN_FLAGS = -O3 -target nvptx64-nvidia-nvcl -ifeq ($(TARGET),x86) - DEVICE = SPIR_TARGET - HPVM_OPTFLAGS = -load LLVMBuildDFG.so -load LLVMLocalMem.so -load LLVMDFG2LLVM_SPIR.so -load LLVMDFG2LLVM_X86.so -load LLVMClearDFG.so -localmem -dfg2llvm-spir -dfg2llvm-x86 -clearDFG - CFLAGS += -DOPENCL_CPU -else ifeq ($(TARGET),seq) +ifeq ($(TARGET),seq) DEVICE = CPU_TARGET HPVM_OPTFLAGS = -load LLVMBuildDFG.so -load LLVMDFG2LLVM_X86.so -load LLVMClearDFG.so -dfg2llvm-x86 -clearDFG -else ifeq ($(TARGET),seqx86) - DEVICE = CPU_OR_SPIR_TARGET - HPVM_OPTFLAGS = -load LLVMBuildDFG.so -load LLVMLocalMem.so -load LLVMDFG2LLVM_SPIR.so -load LLVMDFG2LLVM_X86.so -load LLVMClearDFG.so -localmem -dfg2llvm-spir -dfg2llvm-x86 -clearDFG - CFLAGS += -DOPENCL_CPU -else ifeq ($(TARGET),seqgpu) - DEVICE = CPU_OR_GPU_TARGET - HPVM_OPTFLAGS = -load LLVMBuildDFG.so -load LLVMLocalMem.so -load LLVMDFG2LLVM_NVPTX.so -load LLVMDFG2LLVM_X86.so -load LLVMClearDFG.so -localmem -dfg2llvm-nvptx -dfg2llvm-x86 -clearDFG else DEVICE = GPU_TARGET HPVM_OPTFLAGS = -load LLVMBuildDFG.so -load LLVMLocalMem.so -load LLVMDFG2LLVM_NVPTX.so -load LLVMDFG2LLVM_X86.so -load LLVMClearDFG.so -localmem -dfg2llvm-nvptx -dfg2llvm-x86 -clearDFG @@ -49,22 +32,12 @@ HOST_LINKFLAGS = ifeq ($(TIMER),x86) HPVM_OPTFLAGS += -hpvm-timers-x86 -else ifeq ($(TIMER),ptx) - HPVM_OPTFLAGS += -hpvm-timers-ptx else ifeq ($(TIMER),gen) TESTGEN_OPTFLAGS += -hpvm-timers-gen -else ifeq ($(TIMER),spir) - TESTGEN_OPTFLAGS += -hpvm-timers-spir else ifeq ($(TIMER),no) else - ifeq ($(TARGET),x86) - HPVM_OPTFLAGS += -hpvm-timers-x86 -hpvm-timers-spir - else ifeq ($(TARGET),seq) + ifeq ($(TARGET),seq) HPVM_OPTFLAGS += -hpvm-timers-x86 - else ifeq ($(TARGET),seqx86) - HPVM_OPTFLAGS += -hpvm-timers-x86 -hpvm-timers-spir - else ifeq ($(TARGET),seqgpu) - HPVM_OPTFLAGS += -hpvm-timers-x86 -hpvm-timers-ptx else HPVM_OPTFLAGS += -hpvm-timers-x86 -hpvm-timers-ptx endif @@ -87,8 +60,6 @@ INBUILDDIR=$(addprefix $(BUILDDIR)/,$(1)) # Add SRCDIR as a prefix to each element of $1 INSRCDIR=$(addprefix $(SRCDIR)/,$(1)) -PYTHON_LLVM_40_34 = ../llvm-40-34.py - ######################################## # Environment variable check ######################################## @@ -123,19 +94,8 @@ OBJS = $(call INBUILDDIR,$(SRCDIR_OBJS)) TEST_OBJS = $(call INBUILDDIR,$(HPVM_OBJS)) PARBOIL_OBJS = $(call INBUILDDIR,parboil.ll) KERNEL = $(TEST_OBJS).kernels.ll -KERNEL_OPT = $(BUILDDIR)/$(APP).kernels.opt.ll -ifeq ($(TARGET),x86) - SPIR_ASSEMBLY = $(TEST_OBJS).kernels.bc -else ifeq ($(TARGET),seq) -else ifeq ($(TARGET),seqx86) - SPIR_ASSEMBLY = $(TEST_OBJS).kernels.bc -else ifeq ($(TARGET),seqgpu) - KERNEL_LINKED = $(BUILDDIR)/$(APP).kernels.linked.ll - #KERNEL = $(TEST_OBJS).kernels.ll - KERNEL_OCL = $(TEST_OBJS).kernels.cl +ifeq ($(TARGET),seq) else - KERNEL_LINKED = $(BUILDDIR)/$(APP).kernels.linked.ll - #KERNEL = $(TEST_OBJS).kernels.ll KERNEL_OCL = $(TEST_OBJS).kernels.cl endif HOST_LINKED = $(BUILDDIR)/$(APP).linked.ll @@ -172,12 +132,9 @@ clean : if [ -d $(BUILDDIR) ]; then rm -rf $(BUILDDIR); fi if [ -d $(RUNDIR) ]; then rm -rf $(RUNDIR); fi -$(KERNEL_OCL) : $(KERNEL_OPT) +$(KERNEL_OCL) : $(KERNEL) $(OCLBE) $< -o $@ -$(KERNEL_OPT) : $(KERNEL) - $(OPT) $(APP_OPTFLAGS) -S $< -o $@ - $(BIN) : $(HOST_LINKED) $(CXX) -O3 $(LDFLAGS) $< -o $@ diff --git a/hpvm/test/parboil/common/platform/hpvm.default.mk b/hpvm/test/parboil/common/platform/hpvm.default.mk index ca90d453a38d0b63d16e850b57de5622cbd1f2e1..4d40d5815f72a1d58ca28b0d23b01f9cba2f2f99 100644 --- a/hpvm/test/parboil/common/platform/hpvm.default.mk +++ b/hpvm/test/parboil/common/platform/hpvm.default.mk @@ -11,9 +11,6 @@ #OPENCL_PATH=/scr/hskim/ati-stream-sdk-v2.3-lnx64 #OPENCL_LIB_PATH=$(OPENCL_PATH)/lib/x86_64 -#build -HPVM_BUILD_DIR = $(LLVM_SRC_ROOT)/../build -# gcc (default) CC = $(HPVM_BUILD_DIR)/bin/clang OCLBE = $(HPVM_BUILD_DIR)/bin/llvm-cbe PLATFORM_CFLAGS = -I$(LLVM_SRC_ROOT)/include -I$(HPVM_BUILD_DIR)/include -I../../../include diff --git a/hpvm/test/parboil/common/python/binaryfilecompare.pyc b/hpvm/test/parboil/common/python/binaryfilecompare.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5137e38a5859946f5f13aca3b44697ec05384749 Binary files /dev/null and b/hpvm/test/parboil/common/python/binaryfilecompare.pyc differ diff --git a/hpvm/test/parboil/common/python/filecompare.pyc b/hpvm/test/parboil/common/python/filecompare.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f1ec4c7ad9533fbaad52ea36244160953aff3576 Binary files /dev/null and b/hpvm/test/parboil/common/python/filecompare.pyc differ diff --git a/hpvm/test/parboil/common/python/textfilecompare.pyc b/hpvm/test/parboil/common/python/textfilecompare.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2922943dfe4840d6138911f9986a34ef3b36dc95 Binary files /dev/null and b/hpvm/test/parboil/common/python/textfilecompare.pyc differ diff --git a/hpvm/test/pipeline/Makefile b/hpvm/test/pipeline/Makefile index 548949fe72aea79ef6b387154384ad4e7d3cd374..f46b52391a33b846996dff6311981596bcc3bcad 100644 --- a/hpvm/test/pipeline/Makefile +++ b/hpvm/test/pipeline/Makefile @@ -4,7 +4,7 @@ # Paths to some dependencies (e.g., HPVM, LLVM) must exist in Makefile.config, # which can be copied from Makefile.config.example for a start. -CONFIG_FILE := Makefile.config +CONFIG_FILE := ../include/Makefile.config ifeq ($(wildcard $(CONFIG_FILE)),) $(error $(CONFIG_FILE) not found. See $(CONFIG_FILE).example) @@ -23,7 +23,6 @@ CURRENT_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) EXE = pipeline-$(TARGET) INCLUDES += -I$(SRC_DIR) -I$(CAM_PIPE_SRC_DIR) -INCLUDES += -I$(LLVM_SRC_ROOT)/include -I../include -I$(HPVM_BUILD_DIR)/include ## BEGIN HPVM MAKEFILE SRCDIR_OBJS= io.ll @@ -39,7 +38,7 @@ OBJS_CFLAGS = $(APP_CFLAGS) $(PLATFORM_CFLAGS) CXXFLAGS = $(APP_CXXFLAGS) $(PLATFORM_CXXFLAGS) LDFLAGS= $(APP_LDFLAGS) $(PLATFORM_LDFLAGS) -HPVM_RT_PATH = $(LLVM_SRC_ROOT)/../build/tools/hpvm/projects/hpvm-rt +HPVM_RT_PATH = $(LLVM_BUILD_DIR)/tools/hpvm/projects/hpvm-rt HPVM_RT_LIB = $(HPVM_RT_PATH)/hpvm-rt.bc TESTGEN_OPTFLAGS = -load LLVMGenHPVM.so -genhpvm -globaldce @@ -69,7 +68,6 @@ KERNEL = $(TEST_OBJS).kernels.ll ifeq ($(TARGET),seq) else - KERNEL_LINKED = $(BUILD_DIR)/$(APP).kernels.linked.ll KERNEL_OCL = $(TEST_OBJS).kernels.cl endif diff --git a/hpvm/test/pipeline/Makefile.config.example b/hpvm/test/pipeline/Makefile.config.example deleted file mode 100644 index 2627ca508f17acb96c858bf4473eed4d89ebec20..0000000000000000000000000000000000000000 --- a/hpvm/test/pipeline/Makefile.config.example +++ /dev/null @@ -1,23 +0,0 @@ -CUDA_PATH=/software/cuda-9.1 -CUDA_LIB_PATH=$(CUDA_PATH)/lib64 -OPENCL_PATH=/software/cuda-9.1 -OPENCL_LIB_PATH=$(OPENCL_PATH)/lib64 - -LLVM_BUILD_DIR =$(LLVM_SRC_ROOT)/../build -CC = $(LLVM_BUILD_DIR)/bin/clang -PLATFORM_CFLAGS = -I$(LLVM_SRC_ROOT)/include -I$(OPENCL_PATH)/include/CL/ -I../include -I$(LLVM_BUILD_DIR)/include -OCLBE = $(LLVM_BUILD_DIR)/bin/llvm-cbe - -CXX = $(LLVM_BUILD_DIR)/bin/clang++ -PLATFORM_CXXFLAGS = -I$(LLVM_SRC_ROOT)/include -I$(OPENCL_PATH)/include/CL/ -I../include -I$(LLVM_BUILD_DIR)/include - -LINKER = $(LLVM_BUILD_DIR)/bin/clang++ -PLATFORM_LDFLAGS = -lm -lpthread -lrt -lOpenCL -L$(OPENCL_LIB_PATH) - -LLVM_LIB_PATH = $(LLVM_BUILD_DIR)/lib -LLVM_BIN_PATH = $(LLVM_BUILD_DIR)/bin - -OPT = $(LLVM_BIN_PATH)/opt -LLVM_LINK = $(LLVM_BIN_PATH)/llvm-link -LLVM_AS = $(LLVM_BIN_PATH)/llvm-as -LIT = $(LLVM_BIN_PATH)/llvm-lit diff --git a/hpvm/test/unitTests/CreateNodeAndEdge.c b/hpvm/test/unitTests/CreateNodeAndEdge.c deleted file mode 100644 index c3f58c95d631b5c49a47de1cbe41ed5ea871f5f4..0000000000000000000000000000000000000000 --- a/hpvm/test/unitTests/CreateNodeAndEdge.c +++ /dev/null @@ -1,50 +0,0 @@ -#include "hpvm.h" -#include <stdio.h> - -struct Root { - int *input; - int *output; -}; - -void Func1(int *In, int *Out) { - __hpvm__hint(CPU_TARGET); - __hpvm__attributes(1, In, 1, Out); - - __hpvm__return(1, Out); -} - -void Func2(int *BindIn, int *SrcIn, int *Out) { - __hpvm__hint(CPU_TARGET); - __hpvm__attributes(2, BindIn, SrcIn, 1, Out); - - __hpvm__return(1, Out); -} - -void PipeRoot(int *In, int *Out) { - __hpvm__hint(CPU_TARGET); - - __hpvm__attributes(1, In, 1, Out); - - void *SrcNode = __hpvm__createNodeND(0, Func1); - void *DestNode = __hpvm__createNodeND(0, Func2); - - __hpvm__bindIn(SrcNode, 0, 0, 0); - - __hpvm__bindIn(DestNode, 0, 0, 0); - __hpvm__edge(SrcNode, DestNode, 1, 0, 1, 0); - - __hpvm__bindOut(SrcNode, 0, 0, 0); -} - -int main(void) { - int In = 1; - int Out = 0; - struct Root RootArgs = {(int *)&In, (int *)&Out}; - - __hpvm__init(); - void *PipeDFG = __hpvm__launch(0, PipeRoot, (void *)&RootArgs); - __hpvm__wait(PipeDFG); - __hpvm__cleanup(); - - return 0; -} diff --git a/hpvm/test/unitTests/Makefile b/hpvm/test/unitTests/Makefile deleted file mode 100644 index 15580e9300a119f55e4a828b645c27dd00b62ff8..0000000000000000000000000000000000000000 --- a/hpvm/test/unitTests/Makefile +++ /dev/null @@ -1,13 +0,0 @@ -PASSES := - -.PHONY: clean - -LLVM_INSTALL:=/home/psrivas2/Hetero/HPVM/Code/trunk/llvm-install -LIBCLC:=/home/psrivas2/Hetero/HPVM/Code/trunk/libclc -HOST:=gemm_opencl -KERNELS:=matrixMul -LLVM_CC:=$(LLVM_INSTALL)/bin/clang -LLVM_LINK:=$(LLVM_INSTALL)/bin/llvm-link - -clean : - rm -f DataflowGraph.dot* diff --git a/hpvm/test/unitTests/MallocIntrinsic.c b/hpvm/test/unitTests/MallocIntrinsic.c deleted file mode 100644 index 173f6b3b16d1090a98242d345cefa330910d862d..0000000000000000000000000000000000000000 --- a/hpvm/test/unitTests/MallocIntrinsic.c +++ /dev/null @@ -1,37 +0,0 @@ -#include "hpvm.h" -#include <stdlib.h> - -struct Root { - int *input; - int *output; -}; - -void PipeRoot(int *In, int *Out) { - __hpvm__hint(CPU_TARGET); - __hpvm__attributes(1, In, 1, Out); - - Out = (int *)__hpvm__malloc(*In); - - __hpvm__return(1, Out); -} - -int main(void) { - int In, Out; - - // struct Root RootArgs; - // RootArgs.input = (int *)&In; - // RootArgs.output = (int *)&Out; - - struct Root *RootArgs = (struct Root *)malloc(sizeof(struct Root)); - RootArgs->input = (int *)&In; - RootArgs->output = (int *)&Out; - - __hpvm__init(); - - void *PipeDFG = __hpvm__launch(0, PipeRoot, (void *)RootArgs); - __hpvm__wait(PipeDFG); - - __hpvm__cleanup(); - - return 0; -} diff --git a/hpvm/test/unitTests/PipelineIntrinsics.c b/hpvm/test/unitTests/PipelineIntrinsics.c deleted file mode 100644 index 43ba0ef56cf160acb1fab6ea334732e56e0359d2..0000000000000000000000000000000000000000 --- a/hpvm/test/unitTests/PipelineIntrinsics.c +++ /dev/null @@ -1,34 +0,0 @@ -#include "hpvm.h" -#include <stdlib.h> - -struct Root { - int *input; - int *output; -}; - -void PipeRoot(int *In, int *Out) { - __hpvm__hint(CPU_TARGET); - __hpvm__attributes(1, In, 1, Out); - __hpvm__return(1, Out); -} - -int main(void) { - int In, Out; - - // struct Root RootArgs; - // RootArgs.input = (int *)&In; - // RootArgs.output = (int *)&Out; - - struct Root *RootArgs = (struct Root *)malloc(sizeof(struct Root)); - RootArgs->input = (int *)&In; - RootArgs->output = (int *)&Out; - - __hpvm__init(); - - void *PipeDFG = __hpvm__launch(0, PipeRoot, (void *)RootArgs); - __hpvm__wait(PipeDFG); - - __hpvm__cleanup(); - - return 0; -} diff --git a/hpvm/test/unitTests/PipelineIntrinsics.malloc.c b/hpvm/test/unitTests/PipelineIntrinsics.malloc.c deleted file mode 100644 index c2deed98679bf794316f283acef8e3c1db9ffa88..0000000000000000000000000000000000000000 --- a/hpvm/test/unitTests/PipelineIntrinsics.malloc.c +++ /dev/null @@ -1,30 +0,0 @@ -#include "hpvm.h" -#include <stdlib.h> - -struct Root { - int *input; - int *output; -}; - -void PipeRoot(int *In, int *Out) { - __hpvm__hint(CPU_TARGET); - __hpvm__attributes(1, In, 1, Out); - __hpvm__return(1, Out); -} - -int main(void) { - int In, Out; - - __hpvm__init(); - - struct Root *RootArgs = (struct Root *)malloc(sizeof(struct Root)); - RootArgs->input = (int *)&In; - RootArgs->output = (int *)&Out; - - void *PipeDFG = __hpvm__launch(0, PipeRoot, (void *)RootArgs); - __hpvm__wait(PipeDFG); - - __hpvm__cleanup(); - - return 0; -} diff --git a/hpvm/test/unitTests/lit.local.cfg b/hpvm/test/unitTests/lit.local.cfg deleted file mode 100644 index c6106e4746f2d7da0600337ec7c03385d2460096..0000000000000000000000000000000000000000 --- a/hpvm/test/unitTests/lit.local.cfg +++ /dev/null @@ -1 +0,0 @@ -config.suffixes = ['.ll'] diff --git a/hpvm/test/unitTests/temp/3level.ll b/hpvm/test/unitTests/temp/3level.ll deleted file mode 100644 index 2e3753f1400798d0989e2a01be78ab338205a291..0000000000000000000000000000000000000000 --- a/hpvm/test/unitTests/temp/3level.ll +++ /dev/null @@ -1,116 +0,0 @@ -; RUN: opt -load LLVMBuildDFG.so -load LLVMDFG2LLVM_X86.so -load LLVMClearDFG.so -dfg2llvm-x86 -clearDFG -o %t.ll -S < %s -; RUN: llvm-link %t.ll ~/current-src/projects/hpvm-rt/hpvm-rt.ll -S -o %t.linked.ll -; RUN: clang++ -O3 %t.linked.ll -lpthread -lOpenCL -lrt -o %t.bin -; RUN: %t.bin 5 -; ModuleID = '/home/psrivas2/current-test/unitTests/3level.ll' -target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" - -%rtype = type <{i32, i32}> -%rtype_internal = type <{i32}> -%struct.arg = type <{ i32, %rtype }> - -@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 - -; Function Attrs: nounwind -declare void @llvm.hpvm.init() #1 - -; Function Attrs: nounwind -declare void @llvm.hpvm.cleanup() #1 - -; Function Attrs: nounwind -declare i8* @llvm.hpvm.createNode(i8*) #0 - -; Function Attrs: nounwind -declare i8* @llvm.hpvm.createEdge(i8*, i8*, i1, i32, i32) #0 - -; Function Attrs: nounwind -declare i8* @llvm.hpvm.launch(i8*, i8*) #0 - -; Function Attrs: nounwind -declare void @llvm.hpvm.wait(i8*) #0 - -; Function Attrs: nounwind -declare i8* @llvm.hpvm.getNode() #0 - -; Function Attrs: nounwind -declare void @llvm.hpvm.bind.input(i8*, i32, i32) - -; Function Attrs: nounwind -declare void @llvm.hpvm.bind.output(i8*, i32, i32) - -; Function Attrs: nounwind uwtable -define i32 @main(i32 %argc, i8** nocapture %argv) #1 { -entry: - %in.addr = alloca %struct.arg - %arrayidx = getelementptr inbounds i8** %argv, i64 1 - %0 = load i8** %arrayidx, align 8, !tbaa !0 - %call.i = tail call i64 @strtol(i8* nocapture %0, i8** null, i32 10) #0 - %conv.i = trunc i64 %call.i to i32 - call void @llvm.hpvm.init() - %1 = bitcast %struct.arg* %in.addr to i32* - store i32 %conv.i, i32* %1 - %args = bitcast %struct.arg* %in.addr to i8* - %graphID = call i8* @llvm.hpvm.launch(i8* bitcast (%rtype (i32)* @Root to i8*), i8* %args) - %call1 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8]* @.str, i64 0, i64 0), i32 %conv.i) #0 - call void @llvm.hpvm.wait(i8* %graphID) - %2 = getelementptr %struct.arg* %in.addr, i32 0, i32 1 - %outputstruct = load %rtype* %2 - %output1 = extractvalue %rtype %outputstruct, 0 - %output2 = extractvalue %rtype %outputstruct, 1 - call void @llvm.hpvm.cleanup() - %call2 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8]* @.str, i64 0, i64 0), i32 %output1) #0 - %call3 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8]* @.str, i64 0, i64 0), i32 %output2) #0 - ret i32 0 -} - -define %rtype_internal @producer(i32 %id) { - %sum = add i32 4, %id - %output = insertvalue %rtype_internal undef, i32 %sum, 0 - ret %rtype_internal %output -} - -define %rtype_internal @consumer(i32 %id) { - %sum = add i32 10, %id - %output = insertvalue %rtype_internal undef, i32 %sum, 0 - ret %rtype_internal %output -} - -define %rtype_internal @foo(i32 %id) { - %sum = add i32 15, %id - %output = insertvalue %rtype_internal undef, i32 %sum, 0 - ret %rtype_internal %output -} - -define %rtype_internal @subNode(i32 %id) { - %foo_node = call i8* @llvm.hpvm.createNode(i8* bitcast (%rtype_internal (i32)* @foo to i8*)) - call void @llvm.hpvm.bind.input(i8* %foo_node, i32 0, i32 0) - call void @llvm.hpvm.bind.output(i8* %foo_node, i32 0, i32 0) - ret %rtype_internal zeroinitializer -} - -define %rtype @Root(i32 %id) { - %p_node = call i8* @llvm.hpvm.createNode(i8* bitcast (%rtype_internal (i32)* @producer to i8*)) - %c_node = call i8* @llvm.hpvm.createNode(i8* bitcast (%rtype_internal (i32)* @consumer to i8*)) - %sub_node = call i8* @llvm.hpvm.createNode(i8* bitcast (%rtype_internal (i32)* @subNode to i8*)) - %edge = call i8* @llvm.hpvm.createEdge(i8* %p_node, i8* %c_node, i1 false, i32 0, i32 0) - call void @llvm.hpvm.bind.input(i8* %p_node, i32 0, i32 0) - call void @llvm.hpvm.bind.output(i8* %c_node, i32 0, i32 0) - call void @llvm.hpvm.bind.input(i8* %sub_node, i32 0, i32 0) - call void @llvm.hpvm.bind.output(i8* %sub_node, i32 0, i32 1) - ret %rtype zeroinitializer -} - -; Function Attrs: nounwind -declare i32 @printf(i8* nocapture, ...) #2 - -; Function Attrs: nounwind -declare i64 @strtol(i8*, i8** nocapture, i32) #2 - -attributes #0 = { nounwind } -attributes #1 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" } -attributes #2 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" } - -!0 = metadata !{metadata !"any pointer", metadata !1} -!1 = metadata !{metadata !"omnipotent char", metadata !2} -!2 = metadata !{metadata !"Simple C/C++ TBAA"} diff --git a/hpvm/test/unitTests/temp/Makefile b/hpvm/test/unitTests/temp/Makefile deleted file mode 100644 index 15580e9300a119f55e4a828b645c27dd00b62ff8..0000000000000000000000000000000000000000 --- a/hpvm/test/unitTests/temp/Makefile +++ /dev/null @@ -1,13 +0,0 @@ -PASSES := - -.PHONY: clean - -LLVM_INSTALL:=/home/psrivas2/Hetero/HPVM/Code/trunk/llvm-install -LIBCLC:=/home/psrivas2/Hetero/HPVM/Code/trunk/libclc -HOST:=gemm_opencl -KERNELS:=matrixMul -LLVM_CC:=$(LLVM_INSTALL)/bin/clang -LLVM_LINK:=$(LLVM_INSTALL)/bin/llvm-link - -clean : - rm -f DataflowGraph.dot* diff --git a/hpvm/test/unitTests/temp/lit.local.cfg b/hpvm/test/unitTests/temp/lit.local.cfg deleted file mode 100644 index c6106e4746f2d7da0600337ec7c03385d2460096..0000000000000000000000000000000000000000 --- a/hpvm/test/unitTests/temp/lit.local.cfg +++ /dev/null @@ -1 +0,0 @@ -config.suffixes = ['.ll'] diff --git a/hpvm/test/unitTests/temp/query2D.ll b/hpvm/test/unitTests/temp/query2D.ll deleted file mode 100644 index 48358a3527553c8f4a31ff89454010289d02c072..0000000000000000000000000000000000000000 --- a/hpvm/test/unitTests/temp/query2D.ll +++ /dev/null @@ -1,115 +0,0 @@ -; RUN: opt -load LLVMBuildDFG.so -load LLVMDFG2LLVM_X86.so -load LLVMClearDFG.so -dfg2llvm-x86 -clearDFG -o %t.ll -S < %s -; RUN: llvm-link %t.ll ~/current-src/projects/hpvm-rt/hpvm-rt.ll -S -o %t.linked.ll -; RUN: clang++ -O3 %t.linked.ll -lpthread -lOpenCL -lrt -o %t.bin -; RUN: %t.bin 5 -; ModuleID = '/home/psrivas2/current-test/unitTests/query2D.ll' -target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" - -%rtype = type <{i32}> -%struct.arg = type <{ i32, %rtype }> - -@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 - -; Function Attrs: nounwind -declare void @llvm.hpvm.init() #1 - -; Function Attrs: nounwind -declare void @llvm.hpvm.cleanup() #1 - -; Function Attrs: nounwind -declare i8* @llvm.hpvm.createNode(i8*) #0 - -; Function Attrs: nounwind -declare i8* @llvm.hpvm.createNode1D(i8*, i32) #0 - -; Function Attrs: nounwind -declare i8* @llvm.hpvm.createNode2D(i8*, i32, i32) #0 - -; Function Attrs: nounwind -declare i8* @llvm.hpvm.createEdge(i8*, i8*, i1, i32, i32) #0 - -; Function Attrs: nounwind -declare i8* @llvm.hpvm.launch(i8*, i8*) #0 - -; Function Attrs: nounwind -declare void @llvm.hpvm.wait(i8*) #0 - -; Function Attrs: nounwind -declare void @llvm.hpvm.bind.input(i8*, i32, i32) - -; Function Attrs: nounwind -declare void @llvm.hpvm.bind.output(i8*, i32, i32) - -; Function Attrs: nounwind -declare i8* @llvm.hpvm.getNode() #0 - -; Function Attrs: nounwind -declare i8* @llvm.hpvm.getParentNode(i8*) #0 - -; Function Attrs: nounwind -declare i32 @llvm.hpvm.getNumDims(i8*) #0 - -; Function Attrs: nounwind -declare i32 @llvm.hpvm.getNumNodeInstances.x(i8*) #0 - -; Function Attrs: nounwind uwtable -define i32 @main(i32 %argc, i8** nocapture %argv) #1 { -entry: - %in.addr = alloca %struct.arg - %arrayidx = getelementptr inbounds i8** %argv, i64 1 - %0 = load i8** %arrayidx, align 8, !tbaa !0 - %call.i = tail call i64 @strtol(i8* nocapture %0, i8** null, i32 10) #0 - %conv.i = trunc i64 %call.i to i32 - call void @llvm.hpvm.init() - %1 = bitcast %struct.arg* %in.addr to i32* - store i32 %conv.i, i32* %1 - %args = bitcast %struct.arg* %in.addr to i8* - %graphID = call i8* @llvm.hpvm.launch(i8* bitcast (%rtype (i32)* @Root to i8*), i8* %args) - %call1 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8]* @.str, i64 0, i64 0), i32 %conv.i) #0 - call void @llvm.hpvm.wait(i8* %graphID) - %2 = getelementptr %struct.arg* %in.addr, i32 0, i32 1 - %outputstruct = load %rtype* %2 - %output = extractvalue %rtype %outputstruct, 0 - call void @llvm.hpvm.cleanup() - %call2 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8]* @.str, i64 0, i64 0), i32 %output) #0 - ret i32 0 -} - -define %rtype @producer(i32 %id) { - %sum = add i32 4, %id - %this_node = call i8* @llvm.hpvm.getNode() - %dim = call i32 @llvm.hpvm.getNumNodeInstances.x(i8* %this_node) - %sum2 = add i32 %sum, %dim - %output = insertvalue %rtype undef, i32 %sum2, 0 - ret %rtype %output -} - -define %rtype @consumer(i32 %id) { - %sum = add i32 10, %id - %output = insertvalue %rtype undef, i32 %sum, 0 - ret %rtype %output -} - -define %rtype @Root(i32 %dimension) { - %p_node = call i8* @llvm.hpvm.createNode2D(i8* bitcast (%rtype (i32)* @producer to i8*), i32 %dimension, i32 %dimension) - %c_node = call i8* @llvm.hpvm.createNode(i8* bitcast (%rtype (i32)* @consumer to i8*)) - %edge = call i8* @llvm.hpvm.createEdge(i8* %p_node, i8* %c_node, i1 false, i32 0, i32 0) - call void @llvm.hpvm.bind.input(i8* %p_node, i32 0, i32 0) - call void @llvm.hpvm.bind.output(i8* %c_node, i32 0, i32 0) - ret %rtype zeroinitializer -} - -; Function Attrs: nounwind -declare i32 @printf(i8* nocapture, ...) #2 - -; Function Attrs: nounwind -declare i64 @strtol(i8*, i8** nocapture, i32) #2 - -attributes #0 = { nounwind } -attributes #1 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" } -attributes #2 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" } - -!0 = metadata !{metadata !"any pointer", metadata !1} -!1 = metadata !{metadata !"omnipotent char", metadata !2} -!2 = metadata !{metadata !"Simple C/C++ TBAA"} diff --git a/hpvm/test/unitTests/temp/query3D.ll b/hpvm/test/unitTests/temp/query3D.ll deleted file mode 100644 index d2ff16ef56628752b997577891c44fd904be4405..0000000000000000000000000000000000000000 --- a/hpvm/test/unitTests/temp/query3D.ll +++ /dev/null @@ -1,121 +0,0 @@ -; RUN: opt -load LLVMBuildDFG.so -load LLVMDFG2LLVM_X86.so -load LLVMClearDFG.so -dfg2llvm-x86 -clearDFG -o %t.ll -S < %s -; RUN: llvm-link %t.ll ~/current-src/projects/hpvm-rt/hpvm-rt.ll -S -o %t.linked.ll -; RUN: clang++ -O3 %t.linked.ll -lpthread -lOpenCL -lrt -o %t.bin -; RUN: %t.bin 5 -; ModuleID = '/home/psrivas2/current-test/unitTests/query3D.ll' -target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" - -%rtype = type <{i32}> -%struct.arg = type <{ i32, %rtype }> - -@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 - -; Function Attrs: nounwind -declare void @llvm.hpvm.init() #1 - -; Function Attrs: nounwind -declare void @llvm.hpvm.cleanup() #1 - -; Function Attrs: nounwind -declare i8* @llvm.hpvm.createNode(i8*) #0 - -; Function Attrs: nounwind -declare i8* @llvm.hpvm.createNode1D(i8*, i32) #0 - -; Function Attrs: nounwind -declare i8* @llvm.hpvm.createNode2D(i8*, i32, i32) #0 - -; Function Attrs: nounwind -declare i8* @llvm.hpvm.createNode3D(i8*, i32, i32, i32) #0 - -; Function Attrs: nounwind -declare i8* @llvm.hpvm.createEdge(i8*, i8*, i1, i32, i32) #0 - -; Function Attrs: nounwind -declare i8* @llvm.hpvm.launch(i8*, i8*) #0 - -; Function Attrs: nounwind -declare void @llvm.hpvm.wait(i8*) #0 - -; Function Attrs: nounwind -declare void @llvm.hpvm.bind.input(i8*, i32, i32) - -; Function Attrs: nounwind -declare void @llvm.hpvm.bind.output(i8*, i32, i32) - -; Function Attrs: nounwind -declare i8* @llvm.hpvm.getNode() #0 - -; Function Attrs: nounwind -declare i8* @llvm.hpvm.getParentNode(i8*) #0 - -; Function Attrs: nounwind -declare i32 @llvm.hpvm.getNumDims(i8*) #0 - -; Function Attrs: nounwind -declare i32 @llvm.hpvm.getNumNodeInstances.x(i8*) #0 - -; Function Attrs: nounwind -declare i32 @llvm.hpvm.getNumNodeInstances.y(i8*) #0 - -; Function Attrs: nounwind uwtable -define i32 @main(i32 %argc, i8** nocapture %argv) #1 { -entry: - call void @llvm.hpvm.init() - %in.addr = alloca %struct.arg - %arrayidx = getelementptr inbounds i8** %argv, i64 1 - %0 = load i8** %arrayidx, align 8, !tbaa !0 - %call.i = tail call i64 @strtol(i8* nocapture %0, i8** null, i32 10) #0 - %conv.i = trunc i64 %call.i to i32 - %1 = bitcast %struct.arg* %in.addr to i32* - store i32 %conv.i, i32* %1 - %args = bitcast %struct.arg* %in.addr to i8* - %graphID = call i8* @llvm.hpvm.launch(i8* bitcast (%rtype (i32)* @Root to i8*), i8* %args) - %call1 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8]* @.str, i64 0, i64 0), i32 %conv.i) #0 - call void @llvm.hpvm.wait(i8* %graphID) - %2 = getelementptr %struct.arg* %in.addr, i32 0, i32 1 - %outputstruct = load %rtype* %2 - %output = extractvalue %rtype %outputstruct, 0 - %call2 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8]* @.str, i64 0, i64 0), i32 %output) #0 - call void @llvm.hpvm.cleanup() - ret i32 0 -} - -define %rtype @producer(i32 %id) { - %sum = add i32 4, %id - %this_node = call i8* @llvm.hpvm.getNode() - %dim = call i32 @llvm.hpvm.getNumNodeInstances.y(i8* %this_node) - %sum2 = add i32 %sum, %dim - %output = insertvalue %rtype undef, i32 %sum2, 0 - ret %rtype %output -} - -define %rtype @consumer(i32 %id) { - %sum = add i32 10, %id - %output = insertvalue %rtype undef, i32 %sum, 0 - ret %rtype %output -} - -define %rtype @Root(i32 %dimension) { - %p_node = call i8* @llvm.hpvm.createNode3D(i8* bitcast (%rtype (i32)* @producer to i8*), i32 %dimension, i32 10, i32 30) - %c_node = call i8* @llvm.hpvm.createNode(i8* bitcast (%rtype (i32)* @consumer to i8*)) - %edge = call i8* @llvm.hpvm.createEdge(i8* %p_node, i8* %c_node, i1 false, i32 0, i32 0) - call void @llvm.hpvm.bind.input(i8* %p_node, i32 0, i32 0) - call void @llvm.hpvm.bind.output(i8* %c_node, i32 0, i32 0) - ret %rtype zeroinitializer -} - -; Function Attrs: nounwind -declare i32 @printf(i8* nocapture, ...) #2 - -; Function Attrs: nounwind -declare i64 @strtol(i8*, i8** nocapture, i32) #2 - -attributes #0 = { nounwind } -attributes #1 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" } -attributes #2 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" } - -!0 = metadata !{metadata !"any pointer", metadata !1} -!1 = metadata !{metadata !"omnipotent char", metadata !2} -!2 = metadata !{metadata !"Simple C/C++ TBAA"} diff --git a/hpvm/test/unitTests/temp/queryNodeInst.ll b/hpvm/test/unitTests/temp/queryNodeInst.ll deleted file mode 100644 index 4e3dd7553045d466199c726416db220a6be2d1aa..0000000000000000000000000000000000000000 --- a/hpvm/test/unitTests/temp/queryNodeInst.ll +++ /dev/null @@ -1,104 +0,0 @@ -; RUN: opt -load LLVMBuildDFG.so -load LLVMDFG2LLVM_X86.so -load LLVMClearDFG.so -dfg2llvm-x86 -clearDFG -o %t.ll -S < %s -; RUN: llvm-link %t.ll ~/current-src/projects/hpvm-rt/hpvm-rt.ll -S -o %t.linked.ll -; RUN: clang++ -O3 %t.linked.ll -lpthread -lOpenCL -lrt -o %t.bin -; RUN: %t.bin 5 -; ModuleID = '/home/psrivas2/current-test/unitTests/twoNode.ll' -target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" - -%rtype = type <{i32}> -%struct.arg = type <{ i32, %rtype }> - -@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 - -; Function Attrs: nounwind -declare void @llvm.hpvm.init() #1 - -; Function Attrs: nounwind -declare void @llvm.hpvm.cleanup() #1 - -; Function Attrs: nounwind -declare i8* @llvm.hpvm.createNode(i8*) #0 - -; Function Attrs: nounwind -declare i8* @llvm.hpvm.createEdge(i8*, i8*, i1, i32, i32) #0 - -; Function Attrs: nounwind -declare i8* @llvm.hpvm.launch(i8*, i8*) #0 - -; Function Attrs: nounwind -declare void @llvm.hpvm.wait(i8*) #0 - -; Function Attrs: nounwind -declare void @llvm.hpvm.bind.input(i8*, i32, i32) - -; Function Attrs: nounwind -declare void @llvm.hpvm.bind.output(i8*, i32, i32) - -; Function Attrs: nounwind -declare i8* @llvm.hpvm.getNode() #0 - -; Function Attrs: nounwind -declare i32 @llvm.hpvm.getNumDims(i8*) #0 - - -; Function Attrs: nounwind uwtable -define i32 @main(i32 %argc, i8** nocapture %argv) #1 { -entry: - call void @llvm.hpvm.init() - %in.addr = alloca %struct.arg - %arrayidx = getelementptr inbounds i8** %argv, i64 1 - %0 = load i8** %arrayidx, align 8, !tbaa !0 - %call.i = tail call i64 @strtol(i8* nocapture %0, i8** null, i32 10) #0 - %conv.i = trunc i64 %call.i to i32 - %1 = bitcast %struct.arg* %in.addr to i32* - store i32 %conv.i, i32* %1 - %args = bitcast %struct.arg* %in.addr to i8* - %graphID = call i8* @llvm.hpvm.launch(i8* bitcast (%rtype (i32)* @Root to i8*), i8* %args) - %call1 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8]* @.str, i64 0, i64 0), i32 %conv.i) #0 - call void @llvm.hpvm.wait(i8* %graphID) - %2 = getelementptr %struct.arg* %in.addr, i32 0, i32 1 - %outputstruct = load %rtype* %2 - %output = extractvalue %rtype %outputstruct, 0 - %call2 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8]* @.str, i64 0, i64 0), i32 %output) #0 - call void @llvm.hpvm.cleanup() - ret i32 0 -} - -define %rtype @producer(i32 %id) { - %sum = add i32 4, %id - %this_node = call i8* @llvm.hpvm.getNode() - %numDim = call i32 @llvm.hpvm.getNumDims(i8* %this_node) - %sum2 = add i32 %sum, %numDim - %output = insertvalue %rtype undef, i32 %sum, 0 - ret %rtype %output -} - -define %rtype @consumer(i32 %id) { - %sum = add i32 10, %id - %output = insertvalue %rtype undef, i32 %sum, 0 - ret %rtype %output -} - -define %rtype @Root(i32 %id) { - %p_node = call i8* @llvm.hpvm.createNode(i8* bitcast (%rtype (i32)* @producer to i8*)) - %c_node = call i8* @llvm.hpvm.createNode(i8* bitcast (%rtype (i32)* @consumer to i8*)) - %edge = call i8* @llvm.hpvm.createEdge(i8* %p_node, i8* %c_node, i1 false, i32 0, i32 0) - call void @llvm.hpvm.bind.input(i8* %p_node, i32 0, i32 0) - call void @llvm.hpvm.bind.output(i8* %c_node, i32 0, i32 0) - ret %rtype zeroinitializer -} - -; Function Attrs: nounwind -declare i32 @printf(i8* nocapture, ...) #2 - -; Function Attrs: nounwind -declare i64 @strtol(i8*, i8** nocapture, i32) #2 - -attributes #0 = { nounwind } -attributes #1 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" } -attributes #2 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" } - -!0 = metadata !{metadata !"any pointer", metadata !1} -!1 = metadata !{metadata !"omnipotent char", metadata !2} -!2 = metadata !{metadata !"Simple C/C++ TBAA"} diff --git a/hpvm/test/unitTests/temp/queryNumDim.ll b/hpvm/test/unitTests/temp/queryNumDim.ll deleted file mode 100644 index caa0978dabab0bf6295853e35f23e3ed68f00840..0000000000000000000000000000000000000000 --- a/hpvm/test/unitTests/temp/queryNumDim.ll +++ /dev/null @@ -1,106 +0,0 @@ -; RUN: opt -load LLVMBuildDFG.so -load LLVMDFG2LLVM_X86.so -load LLVMClearDFG.so -dfg2llvm-x86 -clearDFG -o %t.ll -S < %s -; RUN: llvm-link %t.ll ~/current-src/projects/hpvm-rt/hpvm-rt.ll -S -o %t.linked.ll -; RUN: clang++ -O3 %t.linked.ll -lpthread -lOpenCL -lrt -o %t.bin -; RUN: %t.bin 5 -; ModuleID = '/home/psrivas2/current-test/unitTests/twoNode.ll' -target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" - -%rtype = type <{i32}> -%struct.arg = type <{ i32, %rtype }> - -@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 - -; Function Attrs: nounwind -declare void @llvm.hpvm.init() #1 - -; Function Attrs: nounwind -declare void @llvm.hpvm.cleanup() #1 - -; Function Attrs: nounwind -declare i8* @llvm.hpvm.createNode(i8*) #0 - -; Function Attrs: nounwind -declare i8* @llvm.hpvm.createEdge(i8*, i8*, i1, i32, i32) #0 - -; Function Attrs: nounwind -declare i8* @llvm.hpvm.launch(i8*, i8*) #0 - -; Function Attrs: nounwind -declare void @llvm.hpvm.wait(i8*) #0 - -; Function Attrs: nounwind -declare i8* @llvm.hpvm.getNode() #0 - -; Function Attrs: nounwind -declare i8* @llvm.hpvm.getParentNode(i8*) #0 - -; Function Attrs: nounwind -declare i32 @llvm.hpvm.getNumDims(i8*) #0 - -; Function Attrs: nounwind -declare void @llvm.hpvm.bind.input(i8*, i32, i32) - -; Function Attrs: nounwind -declare void @llvm.hpvm.bind.output(i8*, i32, i32) - -; Function Attrs: nounwind uwtable -define i32 @main(i32 %argc, i8** nocapture %argv) #1 { -entry: - call void @llvm.hpvm.init() - %in.addr = alloca %struct.arg - %arrayidx = getelementptr inbounds i8** %argv, i64 1 - %0 = load i8** %arrayidx, align 8, !tbaa !0 - %call.i = tail call i64 @strtol(i8* nocapture %0, i8** null, i32 10) #0 - %conv.i = trunc i64 %call.i to i32 - %1 = bitcast %struct.arg* %in.addr to i32* - store i32 %conv.i, i32* %1 - %args = bitcast %struct.arg* %in.addr to i8* - %graphID = call i8* @llvm.hpvm.launch(i8* bitcast (%rtype (i32)* @Root to i8*), i8* %args) - %call1 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8]* @.str, i64 0, i64 0), i32 %conv.i) #0 - call void @llvm.hpvm.wait(i8* %graphID) - %2 = getelementptr %struct.arg* %in.addr, i32 0, i32 1 - %outputstruct = load %rtype* %2 - %output = extractvalue %rtype %outputstruct, 0 - %call2 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8]* @.str, i64 0, i64 0), i32 %output) #0 - call void @llvm.hpvm.cleanup() - ret i32 0 -} - -define %rtype @producer(i32 %id) { - %sum = add i32 4, %id - %this_node = call i8* @llvm.hpvm.getNode() - %numDim = call i32 @llvm.hpvm.getNumDims(i8* %this_node) - %sum2 = add i32 %sum, %numDim - %output = insertvalue %rtype undef, i32 %sum, 0 - ret %rtype %output -} - -define %rtype @consumer(i32 %id) { - %sum = add i32 10, %id - %output = insertvalue %rtype undef, i32 %sum, 0 - ret %rtype %output -} - -define %rtype @Root(i32 %id) { - %p_node = call i8* @llvm.hpvm.createNode(i8* bitcast (%rtype (i32)* @producer to i8*)) - %c_node = call i8* @llvm.hpvm.createNode(i8* bitcast (%rtype (i32)* @consumer to i8*)) - %edge = call i8* @llvm.hpvm.createEdge(i8* %p_node, i8* %c_node, i1 false, i32 0, i32 0) - call void @llvm.hpvm.bind.input(i8* %p_node, i32 0, i32 0) - call void @llvm.hpvm.bind.output(i8* %c_node, i32 0, i32 0) - ret %rtype zeroinitializer -} - -; Function Attrs: nounwind -declare i32 @printf(i8* nocapture, ...) #2 - -; Function Attrs: nounwind -declare i64 @strtol(i8*, i8** nocapture, i32) #2 - -attributes #0 = { nounwind } -attributes #1 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" } -attributes #2 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" } - -!0 = metadata !{metadata !"any pointer", metadata !1} -!1 = metadata !{metadata !"omnipotent char", metadata !2} -!2 = metadata !{metadata !"Simple C/C++ TBAA"} diff --git a/hpvm/test/unitTests/temp/queryNumNodeInst.ll b/hpvm/test/unitTests/temp/queryNumNodeInst.ll deleted file mode 100644 index 07418ff725c277e2e8adbe6a39d8831e2b77bc59..0000000000000000000000000000000000000000 --- a/hpvm/test/unitTests/temp/queryNumNodeInst.ll +++ /dev/null @@ -1,112 +0,0 @@ -; RUN: opt -load LLVMBuildDFG.so -load LLVMDFG2LLVM_X86.so -load LLVMClearDFG.so -dfg2llvm-x86 -clearDFG -o %t.ll -S < %s -; RUN: llvm-link %t.ll ~/current-src/projects/hpvm-rt/hpvm-rt.ll -S -o %t.linked.ll -; RUN: clang++ -O3 %t.linked.ll -lpthread -lOpenCL -lrt -o %t.bin -; RUN: %t.bin 5 -; ModuleID = '/home/psrivas2/current-test/unitTests/twoNode.ll' -target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" - -%rtype = type <{i32}> -%struct.arg = type <{ i32, %rtype }> - -@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 - -; Function Attrs: nounwind -declare void @llvm.hpvm.init() #1 - -; Function Attrs: nounwind -declare void @llvm.hpvm.cleanup() #1 - -; Function Attrs: nounwind -declare i8* @llvm.hpvm.createNode(i8*) #0 - -; Function Attrs: nounwind -declare i8* @llvm.hpvm.createNode1D(i8*, i32) #0 - -; Function Attrs: nounwind -declare i8* @llvm.hpvm.createEdge(i8*, i8*, i1, i32, i32) #0 - -; Function Attrs: nounwind -declare i8* @llvm.hpvm.launch(i8*, i8*) #0 - -; Function Attrs: nounwind -declare void @llvm.hpvm.wait(i8*) #0 - -; Function Attrs: nounwind -declare i8* @llvm.hpvm.getNode() #0 - -; Function Attrs: nounwind -declare i8* @llvm.hpvm.getParentNode(i8*) #0 - -; Function Attrs: nounwind -declare i32 @llvm.hpvm.getNumDims(i8*) #0 - -; Function Attrs: nounwind -declare i32 @llvm.hpvm.getNumNodeInstances.x(i8*) #0 - -; Function Attrs: nounwind -declare void @llvm.hpvm.bind.input(i8*, i32, i32) - -; Function Attrs: nounwind -declare void @llvm.hpvm.bind.output(i8*, i32, i32) - -; Function Attrs: nounwind uwtable -define i32 @main(i32 %argc, i8** nocapture %argv) #1 { -entry: - call void @llvm.hpvm.init() - %in.addr = alloca %struct.arg - %arrayidx = getelementptr inbounds i8** %argv, i64 1 - %0 = load i8** %arrayidx, align 8, !tbaa !0 - %call.i = tail call i64 @strtol(i8* nocapture %0, i8** null, i32 10) #0 - %conv.i = trunc i64 %call.i to i32 - %1 = bitcast %struct.arg* %in.addr to i32* - store i32 %conv.i, i32* %1 - %args = bitcast %struct.arg* %in.addr to i8* - %graphID = call i8* @llvm.hpvm.launch(i8* bitcast (%rtype (i32)* @Root to i8*), i8* %args) - %call1 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8]* @.str, i64 0, i64 0), i32 %conv.i) #0 - call void @llvm.hpvm.wait(i8* %graphID) - %2 = getelementptr %struct.arg* %in.addr, i32 0, i32 1 - %outputstruct = load %rtype* %2 - %output = extractvalue %rtype %outputstruct, 0 - %call2 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8]* @.str, i64 0, i64 0), i32 %output) #0 - call void @llvm.hpvm.cleanup() - ret i32 0 -} - -define %rtype @producer(i32 %id) { - %sum = add i32 4, %id - %this_node = call i8* @llvm.hpvm.getNode() - %dim = call i32 @llvm.hpvm.getNumNodeInstances.x(i8* %this_node) - %sum2 = add i32 %sum, %dim - %output = insertvalue %rtype undef, i32 %sum2, 0 - ret %rtype %output -} - -define %rtype @consumer(i32 %id) { - %sum = add i32 10, %id - %output = insertvalue %rtype undef, i32 %sum, 0 - ret %rtype %output -} - -define %rtype @Root(i32 %dimension) { - %p_node = call i8* @llvm.hpvm.createNode1D(i8* bitcast (%rtype (i32)* @producer to i8*), i32 %dimension) - %c_node = call i8* @llvm.hpvm.createNode(i8* bitcast (%rtype (i32)* @consumer to i8*)) - %edge = call i8* @llvm.hpvm.createEdge(i8* %p_node, i8* %c_node, i1 false, i32 0, i32 0) - call void @llvm.hpvm.bind.input(i8* %p_node, i32 0, i32 0) - call void @llvm.hpvm.bind.output(i8* %c_node, i32 0, i32 0) - ret %rtype zeroinitializer -} - -; Function Attrs: nounwind -declare i32 @printf(i8* nocapture, ...) #2 - -; Function Attrs: nounwind -declare i64 @strtol(i8*, i8** nocapture, i32) #2 - -attributes #0 = { nounwind } -attributes #1 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" } -attributes #2 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" } - -!0 = metadata !{metadata !"any pointer", metadata !1} -!1 = metadata !{metadata !"omnipotent char", metadata !2} -!2 = metadata !{metadata !"Simple C/C++ TBAA"} diff --git a/hpvm/test/unitTests/temp/singleNode.ll b/hpvm/test/unitTests/temp/singleNode.ll deleted file mode 100644 index 99e53181317a6b27a83916682bcf1457895c0bfc..0000000000000000000000000000000000000000 --- a/hpvm/test/unitTests/temp/singleNode.ll +++ /dev/null @@ -1,79 +0,0 @@ -; RUN: opt -load LLVMBuildDFG.so -load LLVMDFG2LLVM_X86.so -load LLVMClearDFG.so -dfg2llvm-x86 -clearDFG -o %t.ll -S < %s -; RUN: llvm-link %t.ll ~/current-src/projects/hpvm-rt/hpvm-rt.ll -S -o %t.linked.ll -; RUN: clang++ -O3 %t.linked.ll -lpthread -lOpenCL -lrt -o %t.bin -; RUN: %t.bin 5 -; ModuleID = '/home/psrivas2/current-test/unitTests/singleNode.ll' -target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" - -%rtype = type <{i32}> -%struct.arg = type <{ %rtype }> - -@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 - -; Function Attrs: nounwind -declare void @llvm.hpvm.init() #1 - -; Function Attrs: nounwind -declare void @llvm.hpvm.cleanup() #1 - -; Function Attrs: nounwind -declare i8* @llvm.hpvm.createNode(i8*) #0 - -; Function Attrs: nounwind -declare i8* @llvm.hpvm.createEdge(i8*, i8*, i1, i32, i32) #0 - -; Function Attrs: nounwind -declare i8* @llvm.hpvm.launch(i8*, i8*) #0 - -; Function Attrs: nounwind -declare void @llvm.hpvm.wait(i8*) #0 - -; Function Attrs: nounwind -declare void @llvm.hpvm.bind.input(i8*, i32, i32) - -; Function Attrs: nounwind -declare void @llvm.hpvm.bind.output(i8*, i32, i32) - -; Function Attrs: nounwind uwtable -define i32 @main(i32 %argc, i8** nocapture %argv) #1 { -entry: - call void @llvm.hpvm.init() - %in.addr = alloca %struct.arg - %arrayidx = getelementptr inbounds i8** %argv, i64 1 - %0 = load i8** %arrayidx, align 8, !tbaa !0 - %call.i = tail call i64 @strtol(i8* nocapture %0, i8** null, i32 10) #0 - %conv.i = trunc i64 %call.i to i32 - %args = bitcast %struct.arg* %in.addr to i8* - %graphID = call i8* @llvm.hpvm.launch(i8* bitcast (%rtype ()* @Root to i8*), i8* %args) - %call1 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8]* @.str, i64 0, i64 0), i32 %conv.i) #0 - call void @llvm.hpvm.wait(i8* %graphID) - call void @llvm.hpvm.cleanup() - ret i32 0 -} - -define %rtype @foo() { - %sum = add i32 4, 10 - %output = insertvalue %rtype undef, i32 %sum, 0 - ret %rtype %output -} - -define %rtype @Root() { - %node = call i8* @llvm.hpvm.createNode(i8* bitcast (%rtype ()* @foo to i8*)) - call void @llvm.hpvm.bind.output(i8* %node, i32 0, i32 0) - ret %rtype zeroinitializer -} - -; Function Attrs: nounwind -declare i32 @printf(i8* nocapture, ...) #2 - -; Function Attrs: nounwind -declare i64 @strtol(i8*, i8** nocapture, i32) #2 - -attributes #0 = { nounwind } -attributes #1 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" } -attributes #2 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" } - -!0 = metadata !{metadata !"any pointer", metadata !1} -!1 = metadata !{metadata !"omnipotent char", metadata !2} -!2 = metadata !{metadata !"Simple C/C++ TBAA"} diff --git a/hpvm/test/unitTests/temp/singleNodeStream.ll b/hpvm/test/unitTests/temp/singleNodeStream.ll deleted file mode 100644 index aa0243603c420a21f51f9842d467f9da814f1814..0000000000000000000000000000000000000000 --- a/hpvm/test/unitTests/temp/singleNodeStream.ll +++ /dev/null @@ -1,118 +0,0 @@ -; RUN: opt -load LLVMBuildDFG.so -load LLVMDFG2LLVM_X86.so -load LLVMClearDFG.so -dfg2llvm-x86 -clearDFG -o %t.ll -S < %s -; RUN: llvm-link %t.ll ~/current-src/projects/hpvm-rt/hpvm-rt.ll -S -o %t.linked.ll -; RUN: clang++ -O3 %t.linked.ll -lpthread -lOpenCL -lrt -o %t.bin -; RUN: %t.bin 5 -; ModuleID = '/home/psrivas2/current-test/unitTests/twoNodeConnect.ll' -target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" -%rptype = type <{i32*, i64}> -%struct.arg = type <{ i32*, i64, %rptype }> - -@in.str = private unnamed_addr constant [17 x i8] c"Input Value: %d\0A\00", align 1 -@out.str = private unnamed_addr constant [18 x i8] c"Output Value: %d\0A\00", align 1 -@hex.str = private unnamed_addr constant [19 x i8] c"Pointer Value: %d\0A\00", align 1 -@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 - -; Function Attrs: nounwind -declare void @llvm.hpvm.init() #1 - -; Function Attrs: nounwind -declare void @llvm.hpvm.cleanup() #1 - -; Function Attrs: nounwind -declare i8* @llvm.hpvm.createNode(i8*) #0 - -; Function Attrs: nounwind -declare i8* @llvm.hpvm.createEdge(i8*, i8*, i1, i32, i32, i1) #0 - -; Function Attrs: nounwind -declare i8* @llvm.hpvm.launch(i8*, i8*, i1) #0 - -; Function Attrs: nounwind -declare void @llvm.hpvm.push(i8*, i8*) #0 - -; Function Attrs: nounwind -declare i8* @llvm.hpvm.pop(i8*) #0 - -; Function Attrs: nounwind -declare void @llvm.hpvm.wait(i8*) #0 - -; Function Attrs: nounwind -declare void @llvm.hpvm.bind.input(i8*, i32, i32, i1) - -; Function Attrs: nounwind -declare void @llvm.hpvm.bind.output(i8*, i32, i32, i1) - -; Function Attrs: nounwind uwtable -define i32 @main(i32 %argc, i8** nocapture %argv) #1 { -entry: - call void @llvm.hpvm.init() - %in.addr = alloca %struct.arg - %num = alloca i32 - %arrayidx = getelementptr inbounds i8** %argv, i64 1 - %0 = load i8** %arrayidx, align 8, !tbaa !0 - %call.i = tail call i64 @strtol(i8* nocapture %0, i8** null, i32 10) #0 - %conv.i = trunc i64 %call.i to i32 - %call1 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([17 x i8]* @in.str, i64 0, i64 0), i32 %conv.i) #0 - %1 = bitcast %struct.arg* %in.addr to i32** - store i32 %conv.i, i32* %num - store i32* %num, i32** %1 - %args = bitcast %struct.arg* %in.addr to i8* - - ; Launch the pipeline - %graphID = call i8* @llvm.hpvm.launch(i8* bitcast (%rptype (i32*, i64)* @Root to i8*), i8* %args, i1 1) - - ; Push arguments into the pipeline - call void @llvm.hpvm.push(i8* %graphID, i8* %args) - call void @llvm.hpvm.push(i8* %graphID, i8* %args) - call void @llvm.hpvm.push(i8* %graphID, i8* %args) - call void @llvm.hpvm.push(i8* %graphID, i8* %args) - - ; Pop out arguments and read the output - %graph_output = call i8* @llvm.hpvm.pop(i8* %graphID) - %graph_output1 = call i8* @llvm.hpvm.pop(i8* %graphID) - %graph_output2 = call i8* @llvm.hpvm.pop(i8* %graphID) - %graph_output3 = call i8* @llvm.hpvm.pop(i8* %graphID) - %output.addr = bitcast i8* %graph_output to %rptype* - %outputstruct = load %rptype* %output.addr - %output = extractvalue %rptype %outputstruct, 0 - %output_val = load i32* %output - %call2 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([18 x i8]* @out.str, i64 0, i64 0), i32 %output_val) #0 - - call void @llvm.hpvm.wait(i8* %graphID) - call void @llvm.hpvm.cleanup() - ret i32 0 -} - -define %rptype @producer(i32* %id, i64 %size) { - %val = load i32* %id - ;%call1 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([17 x i8]* @in.str, i64 0, i64 0), i32 %val) #0 - %sum = add i32 2, %val - store i32 %sum, i32* %id - %temp = insertvalue %rptype undef, i32* %id, 0 - %output = insertvalue %rptype %temp, i64 %size, 1 - ret %rptype %output -} - -define %rptype @Root(i32* %id, i64 %size) { - %p_node = call i8* @llvm.hpvm.createNode(i8* bitcast (%rptype (i32*, i64)* @producer to i8*)) - call void @llvm.hpvm.bind.input(i8* %p_node, i32 0, i32 0, i1 1) - call void @llvm.hpvm.bind.input(i8* %p_node, i32 1, i32 1, i1 1) - call void @llvm.hpvm.bind.output(i8* %p_node, i32 0, i32 0, i1 1) - call void @llvm.hpvm.bind.output(i8* %p_node, i32 1, i32 1, i1 1) - ret %rptype zeroinitializer -} - -; Function Attrs: nounwind -declare i32 @printf(i8* nocapture, ...) #2 - -; Function Attrs: nounwind -declare i64 @strtol(i8*, i8** nocapture, i32) #2 - -attributes #0 = { nounwind } -attributes #1 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" } -attributes #2 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" } - -!0 = metadata !{metadata !"any pointer", metadata !1} -!1 = metadata !{metadata !"omnipotent char", metadata !2} -!2 = metadata !{metadata !"Simple C/C++ TBAA"} diff --git a/hpvm/test/unitTests/temp/twoLaunch.ll b/hpvm/test/unitTests/temp/twoLaunch.ll deleted file mode 100644 index ee602f58d82f004a7b19bf54e55e1c0759c17bef..0000000000000000000000000000000000000000 --- a/hpvm/test/unitTests/temp/twoLaunch.ll +++ /dev/null @@ -1,96 +0,0 @@ -; RUN: opt -load LLVMBuildDFG.so -load LLVMDFG2LLVM_X86.so -load LLVMClearDFG.so -dfg2llvm-x86 -clearDFG -o %t.ll -S < %s -; RUN: llvm-link %t.ll ~/current-src/projects/hpvm-rt/hpvm-rt.ll -S -o %t.linked.ll -; RUN: clang++ -O3 %t.linked.ll -lpthread -lOpenCL -lrt -o %t.bin -; RUN: %t.bin 5 -; ModuleID = '/home/psrivas2/current-test/unitTests/singleNode.ll' -target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" - -%rtype = type <{i32}> -%struct.arg = type <{ %rtype }> - -@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 - -; Function Attrs: nounwind -declare void @llvm.hpvm.init() #1 - -; Function Attrs: nounwind -declare void @llvm.hpvm.cleanup() #1 - -; Function Attrs: nounwind -declare i8* @llvm.hpvm.createNode(i8*) #0 - -; Function Attrs: nounwind -declare i8* @llvm.hpvm.createEdge(i8*, i8*, i1, i32, i32) #0 - -; Function Attrs: nounwind -declare i8* @llvm.hpvm.launch(i8*, i8*) #0 - -; Function Attrs: nounwind -declare void @llvm.hpvm.wait(i8*) #0 - -; Function Attrs: nounwind -declare void @llvm.hpvm.bind.input(i8*, i32, i32) - -; Function Attrs: nounwind -declare void @llvm.hpvm.bind.output(i8*, i32, i32) - -; Function Attrs: nounwind uwtable -define i32 @main(i32 %argc, i8** nocapture %argv) #1 { -entry: - call void @llvm.hpvm.init() - %in.addr_1 = alloca %struct.arg - %in.addr_2= alloca %struct.arg - %arrayidx = getelementptr inbounds i8** %argv, i64 1 - %0 = load i8** %arrayidx, align 8, !tbaa !0 - %call.i = tail call i64 @strtol(i8* nocapture %0, i8** null, i32 10) #0 - %conv.i = trunc i64 %call.i to i32 - %args_1 = bitcast %struct.arg* %in.addr_1 to i8* - %args_2 = bitcast %struct.arg* %in.addr_2 to i8* - %graphID_1 = call i8* @llvm.hpvm.launch(i8* bitcast (%rtype ()* @Root_1 to i8*), i8* %args_1) - %graphID_2 = call i8* @llvm.hpvm.launch(i8* bitcast (%rtype ()* @Root_2 to i8*), i8* %args_2) - %call1 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8]* @.str, i64 0, i64 0), i32 %conv.i) #0 - call void @llvm.hpvm.wait(i8* %graphID_1) - call void @llvm.hpvm.wait(i8* %graphID_2) - call void @llvm.hpvm.cleanup() - - ret i32 0 -} - -define %rtype @foo_1() { - %sum = add i32 4, 10 - %output = insertvalue %rtype undef, i32 %sum, 0 - ret %rtype %output -} - -define %rtype @foo_2() { - %sum = add i32 4, 10 - %output = insertvalue %rtype undef, i32 %sum, 0 - ret %rtype %output -} - -define %rtype @Root_1() { - %node = call i8* @llvm.hpvm.createNode(i8* bitcast (%rtype ()* @foo_1 to i8*)) - call void @llvm.hpvm.bind.output(i8* %node, i32 0, i32 0) - ret %rtype zeroinitializer -} - -define %rtype @Root_2() { - %node = call i8* @llvm.hpvm.createNode(i8* bitcast (%rtype ()* @foo_2 to i8*)) - call void @llvm.hpvm.bind.output(i8* %node, i32 0, i32 0) - ret %rtype zeroinitializer -} - -; Function Attrs: nounwind -declare i32 @printf(i8* nocapture, ...) #2 - -; Function Attrs: nounwind -declare i64 @strtol(i8*, i8** nocapture, i32) #2 - -attributes #0 = { nounwind } -attributes #1 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" } -attributes #2 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" } - -!0 = metadata !{metadata !"any pointer", metadata !1} -!1 = metadata !{metadata !"omnipotent char", metadata !2} -!2 = metadata !{metadata !"Simple C/C++ TBAA"} diff --git a/hpvm/test/unitTests/temp/twoNode.ll b/hpvm/test/unitTests/temp/twoNode.ll deleted file mode 100644 index 74e4c64d599f7204b375743687c6da2b7ed8c9f6..0000000000000000000000000000000000000000 --- a/hpvm/test/unitTests/temp/twoNode.ll +++ /dev/null @@ -1,88 +0,0 @@ -; RUN: opt -load LLVMBuildDFG.so -load LLVMDFG2LLVM_X86.so -load LLVMClearDFG.so -dfg2llvm-x86 -clearDFG -o %t.ll -S < %s -; RUN: llvm-link %t.ll ~/current-src/projects/hpvm-rt/hpvm-rt.ll -S -o %t.linked.ll -; RUN: clang++ -O3 %t.linked.ll -lpthread -lOpenCL -lrt -o %t.bin -; RUN: %t.bin 5 -; ModuleID = '/home/psrivas2/current-test/unitTests/twoNode.ll' -target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" -%rtype = type <{i32}> -%struct.arg = type <{ %rtype }> - -@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 - -; Function Attrs: nounwind -declare void @llvm.hpvm.init() #1 - -; Function Attrs: nounwind -declare void @llvm.hpvm.cleanup() #1 - -; Function Attrs: nounwind -declare i8* @llvm.hpvm.createNode(i8*) #0 - -; Function Attrs: nounwind -declare i8* @llvm.hpvm.createEdge(i8*, i8*, i1, i32, i32) #0 - -; Function Attrs: nounwind -declare i8* @llvm.hpvm.launch(i8*, i8*) #0 - -; Function Attrs: nounwind -declare void @llvm.hpvm.wait(i8*) #0 - -; Function Attrs: nounwind -declare void @llvm.hpvm.bind.input(i8*, i32, i32) - -; Function Attrs: nounwind -declare void @llvm.hpvm.bind.output(i8*, i32, i32) - -; Function Attrs: nounwind uwtable -define i32 @main(i32 %argc, i8** nocapture %argv) #1 { -entry: - call void @llvm.hpvm.init() - %in.addr = alloca %struct.arg - %arrayidx = getelementptr inbounds i8** %argv, i64 1 - %0 = load i8** %arrayidx, align 8, !tbaa !0 - %call.i = tail call i64 @strtol(i8* nocapture %0, i8** null, i32 10) #0 - %conv.i = trunc i64 %call.i to i32 - %1 = bitcast %struct.arg* %in.addr to i32* - store i32 %conv.i, i32* %1 - %args = bitcast %struct.arg* %in.addr to i8* - %graphID = call i8* @llvm.hpvm.launch(i8* bitcast (%rtype (i32)* @Root to i8*), i8* %args) - %call1 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8]* @.str, i64 0, i64 0), i32 %conv.i) #0 - call void @llvm.hpvm.wait(i8* %graphID) - call void @llvm.hpvm.cleanup() - ret i32 0 -} - -define %rtype @producer() { - %sum = add i32 4, 10 - %output = insertvalue %rtype undef, i32 %sum, 0 - ret %rtype %output -} - -define %rtype @consumer(i32 %id) { - %sum = add i32 10, %id - %output = insertvalue %rtype undef, i32 %sum, 0 - ret %rtype %output -} - -define %rtype @Root(i32 %id) { - %p_node = call i8* @llvm.hpvm.createNode(i8* bitcast (%rtype ()* @producer to i8*)) - %c_node = call i8* @llvm.hpvm.createNode(i8* bitcast (%rtype (i32)* @consumer to i8*)) - %edge = call i8* @llvm.hpvm.createEdge(i8* %p_node, i8* %c_node, i1 false, i32 0, i32 0) - call void @llvm.hpvm.bind.output(i8* %c_node, i32 0, i32 0) - ret %rtype zeroinitializer -} - -; Function Attrs: nounwind -declare i32 @printf(i8* nocapture, ...) #2 - -; Function Attrs: nounwind -declare i64 @strtol(i8*, i8** nocapture, i32) #2 - -attributes #0 = { nounwind } -attributes #1 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" } -attributes #2 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" } - -!0 = metadata !{metadata !"any pointer", metadata !1} -!1 = metadata !{metadata !"omnipotent char", metadata !2} -!2 = metadata !{metadata !"Simple C/C++ TBAA"} diff --git a/hpvm/test/unitTests/temp/twoNodeConnect.ll b/hpvm/test/unitTests/temp/twoNodeConnect.ll deleted file mode 100644 index 6b23ad691bacb42c39fe681967d4c584179644f1..0000000000000000000000000000000000000000 --- a/hpvm/test/unitTests/temp/twoNodeConnect.ll +++ /dev/null @@ -1,93 +0,0 @@ -; RUN: opt -load LLVMBuildDFG.so -load LLVMDFG2LLVM_X86.so -load LLVMClearDFG.so -dfg2llvm-x86 -clearDFG -o %t.ll -S < %s -; RUN: llvm-link %t.ll ~/current-src/projects/hpvm-rt/hpvm-rt.ll -S -o %t.linked.ll -; RUN: clang++ -O3 %t.linked.ll -lpthread -lOpenCL -lrt -o %t.bin -; RUN: %t.bin 5 -; ModuleID = '/home/psrivas2/current-test/unitTests/twoNodeConnect.ll' -target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" -%rtype = type <{i32}> -%struct.arg = type <{ i32, %rtype }> - -@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 - -; Function Attrs: nounwind -declare void @llvm.hpvm.init() #1 - -; Function Attrs: nounwind -declare void @llvm.hpvm.cleanup() #1 - -; Function Attrs: nounwind -declare i8* @llvm.hpvm.createNode(i8*) #0 - -; Function Attrs: nounwind -declare i8* @llvm.hpvm.createEdge(i8*, i8*, i1, i32, i32) #0 - -; Function Attrs: nounwind -declare i8* @llvm.hpvm.launch(i8*, i8*) #0 - -; Function Attrs: nounwind -declare void @llvm.hpvm.wait(i8*) #0 - -; Function Attrs: nounwind -declare void @llvm.hpvm.bind.input(i8*, i32, i32) - -; Function Attrs: nounwind -declare void @llvm.hpvm.bind.output(i8*, i32, i32) - -; Function Attrs: nounwind uwtable -define i32 @main(i32 %argc, i8** nocapture %argv) #1 { -entry: - call void @llvm.hpvm.init() - %in.addr = alloca %struct.arg - %arrayidx = getelementptr inbounds i8** %argv, i64 1 - %0 = load i8** %arrayidx, align 8, !tbaa !0 - %call.i = tail call i64 @strtol(i8* nocapture %0, i8** null, i32 10) #0 - %conv.i = trunc i64 %call.i to i32 - %1 = bitcast %struct.arg* %in.addr to i32* - store i32 %conv.i, i32* %1 - %args = bitcast %struct.arg* %in.addr to i8* - %graphID = call i8* @llvm.hpvm.launch(i8* bitcast (%rtype (i32)* @Root to i8*), i8* %args) - %call1 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8]* @.str, i64 0, i64 0), i32 %conv.i) #0 - call void @llvm.hpvm.wait(i8* %graphID) - %2 = getelementptr %struct.arg* %in.addr, i32 0, i32 1 - %outputstruct = load %rtype* %2 - %output = extractvalue %rtype %outputstruct, 0 - %call2 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8]* @.str, i64 0, i64 0), i32 %output) #0 - call void @llvm.hpvm.cleanup() - ret i32 0 -} - -define %rtype @producer(i32 %id) { - %sum = add i32 4, %id - %output = insertvalue %rtype undef, i32 %sum, 0 - ret %rtype %output -} - -define %rtype @consumer(i32 %id) { - %sum = add i32 10, %id - %output = insertvalue %rtype undef, i32 %sum, 0 - ret %rtype %output -} - -define %rtype @Root(i32 %id) { - %p_node = call i8* @llvm.hpvm.createNode(i8* bitcast (%rtype (i32)* @producer to i8*)) - %c_node = call i8* @llvm.hpvm.createNode(i8* bitcast (%rtype (i32)* @consumer to i8*)) - %edge = call i8* @llvm.hpvm.createEdge(i8* %p_node, i8* %c_node, i1 false, i32 0, i32 0) - call void @llvm.hpvm.bind.input(i8* %p_node, i32 0, i32 0) - call void @llvm.hpvm.bind.output(i8* %c_node, i32 0, i32 0) - ret %rtype zeroinitializer -} - -; Function Attrs: nounwind -declare i32 @printf(i8* nocapture, ...) #2 - -; Function Attrs: nounwind -declare i64 @strtol(i8*, i8** nocapture, i32) #2 - -attributes #0 = { nounwind } -attributes #1 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" } -attributes #2 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" } - -!0 = metadata !{metadata !"any pointer", metadata !1} -!1 = metadata !{metadata !"omnipotent char", metadata !2} -!2 = metadata !{metadata !"Simple C/C++ TBAA"} diff --git a/hpvm/test/unitTests/temp/twoNodeQuery.ll b/hpvm/test/unitTests/temp/twoNodeQuery.ll deleted file mode 100644 index 247d1830dadff69ac5380b939d26c5f850bc08ac..0000000000000000000000000000000000000000 --- a/hpvm/test/unitTests/temp/twoNodeQuery.ll +++ /dev/null @@ -1,105 +0,0 @@ -; RUN: opt -load LLVMBuildDFG.so -load LLVMDFG2LLVM_X86.so -load LLVMClearDFG.so -dfg2llvm-x86 -clearDFG -o %t.ll -S < %s -; RUN: llvm-link %t.ll ~/current-src/projects/hpvm-rt/hpvm-rt.ll -S -o %t.linked.ll -; RUN: clang++ -O3 %t.linked.ll -lpthread -lOpenCL -lrt -o %t.bin -; RUN: %t.bin 5 -; ModuleID = '/home/psrivas2/current-test/unitTests/twoNodeQuery.ll' -target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" -%rtype = type <{i32}> -%struct.arg = type <{ i32, %rtype }> - -@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 - -; Function Attrs: nounwind -declare void @llvm.hpvm.init() #1 - -; Function Attrs: nounwind -declare void @llvm.hpvm.cleanup() #1 - -; Function Attrs: nounwind -declare i8* @llvm.hpvm.createNode(i8*) #0 - -; Function Attrs: nounwind -declare i8* @llvm.hpvm.createEdge(i8*, i8*, i1, i32, i32) #0 - -; Function Attrs: nounwind -declare i8* @llvm.hpvm.launch(i8*, i8*) #0 - -; Function Attrs: nounwind -declare void @llvm.hpvm.wait(i8*) #0 - -; Function Attrs: nounwind -declare void @llvm.hpvm.bind.input(i8*, i32, i32) - -; Function Attrs: nounwind -declare void @llvm.hpvm.bind.output(i8*, i32, i32) - -; Function Attrs: nounwind -declare i8* @llvm.hpvm.getNode() #0 - -; Function Attrs: nounwind -declare i8* @llvm.hpvm.getParentNode(i8*) #0 - -; Function Attrs: nounwind -declare i32 @llvm.hpvm.getNumDims(i8*) #0 - -; Function Attrs: nounwind uwtable -define i32 @main(i32 %argc, i8** nocapture %argv) #1 { -entry: - call void @llvm.hpvm.init() - %in.addr = alloca %struct.arg - %arrayidx = getelementptr inbounds i8** %argv, i64 1 - %0 = load i8** %arrayidx, align 8, !tbaa !0 - %call.i = tail call i64 @strtol(i8* nocapture %0, i8** null, i32 10) #0 - %conv.i = trunc i64 %call.i to i32 - %1 = bitcast %struct.arg* %in.addr to i32* - store i32 %conv.i, i32* %1 - %args = bitcast %struct.arg* %in.addr to i8* - %graphID = call i8* @llvm.hpvm.launch(i8* bitcast (%rtype (i32)* @Root to i8*), i8* %args) - %call1 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8]* @.str, i64 0, i64 0), i32 %conv.i) #0 - call void @llvm.hpvm.wait(i8* %graphID) - %2 = getelementptr %struct.arg* %in.addr, i32 0, i32 1 - %outputstruct = load %rtype* %2 - %output = extractvalue %rtype %outputstruct, 0 - %call2 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8]* @.str, i64 0, i64 0), i32 %output) #0 - call void @llvm.hpvm.cleanup() - ret i32 0 -} - -define %rtype @producer(i32 %id) { - %sum = add i32 4, %id - %this_node = call i8* @llvm.hpvm.getNode() - %numDim = call i32 @llvm.hpvm.getNumDims(i8* %this_node) - %sum2 = add i32 %sum, %numDim - %output = insertvalue %rtype undef, i32 %sum, 0 - ret %rtype %output -} - -define %rtype @consumer(i32 %id) { - %sum = add i32 10, %id - %output = insertvalue %rtype undef, i32 %sum, 0 - ret %rtype %output -} - -define %rtype @Root(i32 %id) { - %p_node = call i8* @llvm.hpvm.createNode(i8* bitcast (%rtype (i32)* @producer to i8*)) - %c_node = call i8* @llvm.hpvm.createNode(i8* bitcast (%rtype (i32)* @consumer to i8*)) - %edge = call i8* @llvm.hpvm.createEdge(i8* %p_node, i8* %c_node, i1 false, i32 0, i32 0) - call void @llvm.hpvm.bind.input(i8* %p_node, i32 0, i32 0) - call void @llvm.hpvm.bind.output(i8* %c_node, i32 0, i32 0) - ret %rtype zeroinitializer -} - -; Function Attrs: nounwind -declare i32 @printf(i8* nocapture, ...) #2 - -; Function Attrs: nounwind -declare i64 @strtol(i8*, i8** nocapture, i32) #2 - -attributes #0 = { nounwind } -attributes #1 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" } -attributes #2 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" } - -!0 = metadata !{metadata !"any pointer", metadata !1} -!1 = metadata !{metadata !"omnipotent char", metadata !2} -!2 = metadata !{metadata !"Simple C/C++ TBAA"} diff --git a/hpvm/test/unitTests/temp/twoNodeStream.ll b/hpvm/test/unitTests/temp/twoNodeStream.ll deleted file mode 100644 index f9820abd19eb7b329b2c7184719d9699b15891e6..0000000000000000000000000000000000000000 --- a/hpvm/test/unitTests/temp/twoNodeStream.ll +++ /dev/null @@ -1,123 +0,0 @@ -; RUN: opt -load LLVMBuildDFG.so -load LLVMDFG2LLVM_X86.so -load LLVMClearDFG.so -dfg2llvm-x86 -clearDFG -o %t.ll -S < %s -; RUN: llvm-link %t.ll ~/current-src/projects/hpvm-rt/hpvm-rt.ll -S -o %t.linked.ll -; RUN: clang++ -O3 %t.linked.ll -lpthread -lOpenCL -lrt -o %t.bin -; RUN: %t.bin 5 -; ModuleID = '/home/psrivas2/current-test/unitTests/twoNodeConnect.ll' -target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" -%rptype = type <{i32*, i64}> -%rctype = type <{i32*, i64}> -%struct.arg = type <{ i32*, i64, %rctype }> - -@in.str = private unnamed_addr constant [17 x i8] c"Input Value: %d\0A\00", align 1 -@out.str = private unnamed_addr constant [18 x i8] c"Output Value: %d\0A\00", align 1 -@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 - -; Function Attrs: nounwind -declare void @llvm.hpvm.init() #1 - -; Function Attrs: nounwind -declare void @llvm.hpvm.cleanup() #1 - -; Function Attrs: nounwind -declare i8* @llvm.hpvm.createNode(i8*) #0 - -; Function Attrs: nounwind -declare i8* @llvm.hpvm.createEdge(i8*, i8*, i1, i32, i32, i1) #0 - -; Function Attrs: nounwind -declare i8* @llvm.hpvm.launch(i8*, i8*, i1) #0 - -; Function Attrs: nounwind -declare void @llvm.hpvm.push(i8*, i8*) #0 - -; Function Attrs: nounwind -declare i8* @llvm.hpvm.pop(i8*) #0 - -; Function Attrs: nounwind -declare void @llvm.hpvm.wait(i8*) #0 - -; Function Attrs: nounwind -declare void @llvm.hpvm.bind.input(i8*, i32, i32, i1) - -; Function Attrs: nounwind -declare void @llvm.hpvm.bind.output(i8*, i32, i32, i1) - -; Function Attrs: nounwind uwtable -define i32 @main(i32 %argc, i8** nocapture %argv) #1 { -entry: - call void @llvm.hpvm.init() - %in.addr = alloca %struct.arg - %num = alloca i32 - %arrayidx = getelementptr inbounds i8** %argv, i64 1 - %0 = load i8** %arrayidx, align 8, !tbaa !0 - %call.i = tail call i64 @strtol(i8* nocapture %0, i8** null, i32 10) #0 - %conv.i = trunc i64 %call.i to i32 - %call1 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([17 x i8]* @in.str, i64 0, i64 0), i32 %conv.i) #0 - %1 = bitcast %struct.arg* %in.addr to i32** - store i32 %conv.i, i32* %num - store i32* %num, i32** %1 - %args = bitcast %struct.arg* %in.addr to i8* - - ; Launch the pipeline - %graphID = call i8* @llvm.hpvm.launch(i8* bitcast (%rctype (i32*, i64)* @Root to i8*), i8* %args, i1 1) - - ; Push arguments into the pipeline - call void @llvm.hpvm.push(i8* %graphID, i8* %args) - - ; Pop out arguments and read the output - %graph_output = call i8* @llvm.hpvm.pop(i8* %graphID) - %output.addr = bitcast i8* %graph_output to %rctype* - %outputstruct = load %rctype* %output.addr - %output = extractvalue %rctype %outputstruct, 0 - %output_val = load i32* %output - %call2 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([18 x i8]* @out.str, i64 0, i64 0), i32 %output_val) #0 - - call void @llvm.hpvm.wait(i8* %graphID) - call void @llvm.hpvm.cleanup() - ret i32 0 -} - -define %rptype @producer(i32* %id, i64 %size) { - %val = load i32* %id - %sum = add i32 2, %val - store i32 %sum, i32* %id - %temp = insertvalue %rptype undef, i32* %id, 0 - %output = insertvalue %rptype %temp, i64 %size, 1 - ret %rptype %output -} - -define %rctype @consumer(i32* %id, i64 %size) { - %val = load i32* %id - %sum = add i32 3, %val - store i32 %sum, i32* %id - %temp = insertvalue %rctype undef, i32* %id, 0 - %output = insertvalue %rctype %temp, i64 %size, 1 - ret %rctype %output -} - -define %rctype @Root(i32* %id, i64 %size) { - %p_node = call i8* @llvm.hpvm.createNode(i8* bitcast (%rptype (i32*, i64)* @producer to i8*)) - %c_node = call i8* @llvm.hpvm.createNode(i8* bitcast (%rctype (i32*, i64)* @consumer to i8*)) - %edge = call i8* @llvm.hpvm.createEdge(i8* %p_node, i8* %c_node, i1 false, i32 0, i32 0, i1 1) - %edge2 = call i8* @llvm.hpvm.createEdge(i8* %p_node, i8* %c_node, i1 false, i32 1, i32 1, i1 1) - call void @llvm.hpvm.bind.input(i8* %p_node, i32 0, i32 0, i1 1) - call void @llvm.hpvm.bind.input(i8* %p_node, i32 1, i32 1, i1 0) - call void @llvm.hpvm.bind.output(i8* %c_node, i32 0, i32 0, i1 1) - call void @llvm.hpvm.bind.output(i8* %c_node, i32 1, i32 1, i1 1) - ret %rctype zeroinitializer -} - -; Function Attrs: nounwind -declare i32 @printf(i8* nocapture, ...) #2 - -; Function Attrs: nounwind -declare i64 @strtol(i8*, i8** nocapture, i32) #2 - -attributes #0 = { nounwind } -attributes #1 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" } -attributes #2 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" } - -!0 = metadata !{metadata !"any pointer", metadata !1} -!1 = metadata !{metadata !"omnipotent char", metadata !2} -!2 = metadata !{metadata !"Simple C/C++ TBAA"}