Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable the new PromoteConstant pass. #1403

Open
wants to merge 7 commits into
base: clang_tot_upgrade
Choose a base branch
from
7 changes: 4 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -372,10 +372,11 @@ add_custom_command(TARGET clang_links POST_BUILD
)

# install certain LLVM libraries needed by HIP
install(PROGRAMS $<TARGET_FILE:LLVMSelectAcceleratorCode>
install(PROGRAMS $<TARGET_FILE:LLVMPromoteConstant>
$<TARGET_FILE:LLVMPromotePointerKernArgsToGlobal>
$<TARGET_FILE:LLVMSelectAcceleratorCode>
DESTINATION lib
COMPONENT llvm-project/llvm
COMPONENT llvm-project/llvm
)

# force library install path to lib
Expand Down Expand Up @@ -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.
Expand Down
4 changes: 4 additions & 0 deletions lib/clamp-device.in
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,14 @@ 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
$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=$?
Expand Down