From b221dcadefc5b8f89bd56b2caf16fb4fd87de786 Mon Sep 17 00:00:00 2001 From: Alex Voicu Date: Fri, 28 Feb 2020 22:40:04 +0200 Subject: [PATCH 1/2] Enable the new PromoteConstant pass. --- CMakeLists.txt | 7 ++++--- lib/clamp-device.in | 2 ++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7402c697be2..cacbfed9ff8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -372,10 +372,11 @@ add_custom_command(TARGET clang_links POST_BUILD ) # install certain LLVM libraries needed by HIP -install(PROGRAMS $ +install(PROGRAMS $ $ + $ DESTINATION lib - COMPONENT llvm-project/llvm + COMPONENT llvm-project/llvm ) # force library install path to lib @@ -574,7 +575,7 @@ set(CPACK_DEBIAN_PACKAGE_SECTION "devel") set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${PROJECT_BINARY_DIR}/packaging/debian/postinst;${PROJECT_BINARY_DIR}/packaging/debian/prerm") -set(HCC_GENERAL_DEBIAN_DEP "coreutils, g++-multilib, gcc-multilib, findutils, libelf1, libpci3, file, +set(HCC_GENERAL_DEBIAN_DEP "coreutils, g++-multilib, gcc-multilib, findutils, libelf1, libpci3, file, libfile-basedir-perl, libfile-copy-recursive-perl, libfile-listing-perl, libfile-which-perl") # control the list of package dependency depending on whether this is an official release build. diff --git a/lib/clamp-device.in b/lib/clamp-device.in index 0824a0ad205..c3f41020304 100755 --- a/lib/clamp-device.in +++ b/lib/clamp-device.in @@ -219,8 +219,10 @@ fi $OPT $HCC_OPT -mtriple amdgcn-amd-amdhsa -mcpu=$AMDGPU_TARGET \ -load $LIB/LLVMSelectAcceleratorCode@CMAKE_SHARED_LIBRARY_SUFFIX@ \ -load $LIB/LLVMPromotePointerKernArgsToGlobal@CMAKE_SHARED_LIBRARY_SUFFIX@ \ + -load $LIB/LLVMPromoteConstant@CMAKE_SHARED_LIBRARY_SUFFIX@ \ -select-accelerator-code -sac-enable-function-calls=$AMDGPU_FUNC_CALLS \ -promote-pointer-kernargs-to-global \ + -promote-constant \ -infer-address-spaces \ -verify < $2.linked.bc -o $2.opt.bc From cbc10c0634142be00b99f0fb2c9c429a70a751d4 Mon Sep 17 00:00:00 2001 From: Alex Voicu Date: Fri, 6 Mar 2020 16:09:40 +0200 Subject: [PATCH 2/2] Fix pessimisation I introduced more than 1 year ago. --- lib/clamp-device.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/clamp-device.in b/lib/clamp-device.in index c3f41020304..9ad8cfbcb12 100755 --- a/lib/clamp-device.in +++ b/lib/clamp-device.in @@ -225,6 +225,8 @@ $OPT $HCC_OPT -mtriple amdgcn-amd-amdhsa -mcpu=$AMDGPU_TARGET \ -promote-constant \ -infer-address-spaces \ -verify < $2.linked.bc -o $2.opt.bc +$OPT $HCC_OPT -mtriple amdgcn-amd-amdhsa -mcpu=$AMDGPU_TARGET \ + -verify < $2.opt.bc -o $2.opt.bc # error handling for HCC-specific opt passes RETVAL=$?