diff --git a/buildbot/configure.py b/buildbot/configure.py index a87fcea367867..dda3a14528fe2 100644 --- a/buildbot/configure.py +++ b/buildbot/configure.py @@ -15,6 +15,9 @@ def do_configure(args): llvm_external_projects = 'sycl;llvm-spirv;opencl;libdevice;xpti;xptifw' + libclc_amd_target_names = ';amdgcn--;amdgcn--amdhsa' + libclc_nvidia_target_names = 'nvptx64--;nvptx64--nvidiacl' + if args.llvm_external_projects: llvm_external_projects += ";" + args.llvm_external_projects.replace(",", ";") @@ -43,18 +46,6 @@ def do_configure(args): sycl_enable_xpti_tracing = 'ON' xpti_enable_werror = 'ON' - build_libclc = False - - if args.ci_defaults: - print("#############################################") - print("# Default CI configuration will be applied. #") - print("#############################################") - - # For clang-format and clang-tidy - llvm_enable_projects += ";clang-tools-extra" - # libclc is required for CI validation - build_libclc = True - # replace not append, so ARM ^ X86 if args.arm: llvm_targets_to_build = 'ARM;AArch64' @@ -63,18 +54,18 @@ def do_configure(args): sycl_build_pi_esimd_emulator = 'ON' if args.cuda or args.hip: - build_libclc = True + llvm_enable_projects += ';libclc' if args.cuda: llvm_targets_to_build += ';NVPTX' - libclc_targets_to_build = 'nvptx64--;nvptx64--nvidiacl' + libclc_targets_to_build = libclc_nvidia_target_names libclc_gen_remangled_variants = 'ON' sycl_build_pi_cuda = 'ON' if args.hip: if args.hip_platform == 'AMD': llvm_targets_to_build += ';AMDGPU' - libclc_targets_to_build += ';amdgcn--;amdgcn--amdhsa' + libclc_targets_to_build += libclc_amd_target_names if args.hip_amd_arch: sycl_clang_extra_flags += "-Xsycl-target-backend=amdgcn-amd-amdhsa --offload-arch="+args.hip_amd_arch @@ -82,7 +73,7 @@ def do_configure(args): llvm_enable_projects += ';lld' elif args.hip_platform == 'NVIDIA' and not args.cuda: llvm_targets_to_build += ';NVPTX' - libclc_targets_to_build += ';nvptx64--;nvptx64--nvidiacl' + libclc_targets_to_build += libclc_nvidia_target_names libclc_gen_remangled_variants = 'ON' sycl_build_pi_hip_platform = args.hip_platform @@ -103,10 +94,28 @@ def do_configure(args): llvm_build_shared_libs = 'ON' if args.use_lld: - llvm_enable_lld = 'ON' + llvm_enable_lld = 'ON' - if build_libclc: - llvm_enable_projects += ';libclc' + # CI Default conditionally appends to options, keep it at the bottom of + # args handling + if args.ci_defaults: + print("#############################################") + print("# Default CI configuration will be applied. #") + print("#############################################") + + # For clang-format and clang-tidy + llvm_enable_projects += ";clang-tools-extra" + # libclc is required for CI validation + if 'libclc' not in llvm_enable_projects: + llvm_enable_projects += ';libclc' + # libclc passes `--nvvm-reflect-enable=false`, build NVPTX to enable it + if 'NVPTX' not in llvm_targets_to_build: + llvm_targets_to_build += ';NVPTX' + # Add both NVIDIA and AMD libclc targets + if libclc_amd_target_names not in libclc_targets_to_build: + libclc_targets_to_build += libclc_amd_target_names + if libclc_nvidia_target_names not in libclc_targets_to_build: + libclc_targets_to_build += libclc_nvidia_target_names install_dir = os.path.join(abs_obj_dir, "install") diff --git a/libclc/test/CMakeLists.txt b/libclc/test/CMakeLists.txt index de7f7803d40b5..80ec1f05d0264 100644 --- a/libclc/test/CMakeLists.txt +++ b/libclc/test/CMakeLists.txt @@ -13,6 +13,7 @@ set(LIBCLC_TEST_DEPS llvm-dis not clang + count ) add_custom_target(check-libclc) diff --git a/libclc/test/lit.cfg.py b/libclc/test/lit.cfg.py index ca0fa43231022..7a427032bfa70 100644 --- a/libclc/test/lit.cfg.py +++ b/libclc/test/lit.cfg.py @@ -44,7 +44,8 @@ "-target", target, "-Xclang", "-fdeclare-spirv-builtins", "-Xclang", "-mlink-builtin-bitcode", - "-Xclang", os.path.join(config.llvm_libs_dir, "clc", builtins) + "-Xclang", os.path.join(config.llvm_libs_dir, "clc", builtins), + "-nogpulib" ] if target == 'amdgcn--amdhsa':