Skip to content

Commit 11efe63

Browse files
author
iclsrc
committed
Merge from 'sycl' to 'sycl-web'
2 parents 459904b + 7ed894a commit 11efe63

File tree

25 files changed

+482
-408
lines changed

25 files changed

+482
-408
lines changed

clang/lib/Driver/ToolChains/SYCL.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1247,11 +1247,6 @@ void SYCLToolChain::AddImpliedTargetArgs(const llvm::Triple &Triple,
12471247
if (Arg *A = Args.getLastArg(options::OPT_O_Group))
12481248
if (A->getOption().matches(options::OPT_O0))
12491249
BeArgs.push_back("-cl-opt-disable");
1250-
// In precise floating-point mode we pass the OpenCL flag forcing division to
1251-
// be correctly rounded.
1252-
if (Arg *A = Args.getLastArg(options::OPT_ffp_model_EQ))
1253-
if (StringRef{A->getValue()}.equals("precise"))
1254-
BeArgs.push_back("-cl-fp32-correctly-rounded-divide-sqrt");
12551250
StringRef RegAllocModeOptName = "-ftarget-register-alloc-mode=";
12561251
if (Arg *A = Args.getLastArg(options::OPT_ftarget_register_alloc_mode_EQ)) {
12571252
StringRef RegAllocModeVal = A->getValue(0);

clang/test/Driver/sycl-offload-aot.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -220,18 +220,6 @@
220220
// RUN: | FileCheck -check-prefix=CHK-TOOLS-IMPLIED-OPTS-GEN %s
221221
// CHK-TOOLS-IMPLIED-OPTS-GEN: ocloc{{.*}} "-options" "-g -cl-opt-disable" "-DFOO1" "-DFOO2"
222222

223-
// RUN: %clang -### -target x86_64-unknown-linux-gnu -fsycl -fsycl-targets=spir64_fpga-unknown-unknown -ffp-model=precise -Xsycl-target-backend "-DFOO1 -DFOO2" %s 2>&1 \
224-
// RUN: | FileCheck -check-prefix=CHK-TOOLS-IMPLIED-ROUNDING-FPGA %s
225-
// CHK-TOOLS-IMPLIED-ROUNDING-FPGA: opencl-aot{{.*}} "--bo=-cl-fp32-correctly-rounded-divide-sqrt" "-DFOO1" "-DFOO2"
226-
227-
// RUN: %clang -### -target x86_64-unknown-linux-gnu -fsycl -fsycl-targets=spir64_x86_64-unknown-unknown -ffp-model=precise -Xsycl-target-backend "-DFOO1 -DFOO2" %s 2>&1 \
228-
// RUN: | FileCheck -check-prefix=CHK-TOOLS-IMPLIED-ROUNDING-CPU %s
229-
// CHK-TOOLS-IMPLIED-ROUNDING-CPU: opencl-aot{{.*}} "--bo=-cl-fp32-correctly-rounded-divide-sqrt" "-DFOO1" "-DFOO2"
230-
231-
// RUN: %clang -### -target x86_64-unknown-linux-gnu -fsycl -fsycl-targets=spir64_gen-unknown-unknown -ffp-model=precise -Xsycl-target-backend "-DFOO1 -DFOO2" %s 2>&1 \
232-
// RUN: | FileCheck -check-prefix=CHK-TOOLS-IMPLIED-ROUNDING-GEN %s
233-
// CHK-TOOLS-IMPLIED-ROUNDING-GEN: ocloc{{.*}} "-options" "-cl-fp32-correctly-rounded-divide-sqrt" "-DFOO1" "-DFOO2"
234-
235223
/// Check -Xsycl-target-linker option passing
236224
// RUN: %clang -### -target x86_64-unknown-linux-gnu -fsycl -fsycl-targets=spir64_fpga-unknown-unknown -Xshardware -Xsycl-target-linker "-DFOO1 -DFOO2" %s 2>&1 \
237225
// RUN: | FileCheck -check-prefix=CHK-TOOLS-FPGA-OPTS2 %s

clang/test/Driver/sycl-offload.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -424,11 +424,6 @@
424424
// CHK-TOOLS-IMPLIED-OPTS-O0-NOT: clang-offload-wrapper{{.*}} "-compile-opts={{.*}}-cl-opt-disable"
425425
// CHK-TOOLS-IMPLIED-OPTS-O2-NOT: clang-offload-wrapper{{.*}} "-compile-opts={{.*}}-cl-opt-disable"
426426

427-
/// Check for implied options (-ffp-model=precise)
428-
// RUN: %clang -### -target x86_64-unknown-linux-gnu -fsycl -fsycl-targets=spir64 -ffp-model=precise %s 2>&1 \
429-
// RUN: | FileCheck -check-prefix=CHK-TOOLS-IMPLIED-ROUNDING %s
430-
// CHK-TOOLS-IMPLIED-ROUNDING: clang-offload-wrapper{{.*}} "-compile-opts={{.*}}-cl-fp32-correctly-rounded-divide-sqrt
431-
432427
// RUN: %clang -### -target x86_64-unknown-linux-gnu -fsycl -fsycl-targets=spir64-unknown-unknown -Xsycl-target-linker "-DFOO1 -DFOO2" %s 2>&1 \
433428
// RUN: | FileCheck -check-prefix=CHK-TOOLS-OPTS2 %s
434429
// CHK-TOOLS-OPTS2: clang-offload-wrapper{{.*}} "-link-opts=-DFOO1 -DFOO2"

libclc/CMakeLists.txt

Lines changed: 51 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -116,19 +116,63 @@ execute_process( COMMAND ${LLVM_CONFIG} "--bindir"
116116
# These were not properly reported in early LLVM and we don't need them
117117
list( APPEND LLVM_CXX_FLAGS -fno-rtti -fno-exceptions )
118118

119+
# List containing all the toolchain variables.
120+
list( APPEND BINARY_VARIABLES LLVM_CLANG LLVM_AS LLVM_LINK LLVM_OPT LLVM_SPIRV
121+
LIBCLC_REMANGLER )
122+
# List containing all the names of toolchain binaries.
123+
# NOTE: both lists (BINARY_VARIABLES and BINARY_NAMES) must be in sync.
124+
list( APPEND BINARY_NAMES clang llvm-as llvm-link opt llvm-spirv
125+
libclc-remangler )
126+
127+
# find_program needs the variable to be cleared in order to perform a search.
128+
# Make sure that the cached entries are cleared as well.
129+
function( ClearVariables BINARY_VARIABLES_LIST )
130+
foreach( V ${BINARY_VARIABLES_LIST} )
131+
unset( ${V} CACHE )
132+
unset( ${V} PARENT_SCOPE )
133+
endforeach( V )
134+
endfunction()
135+
136+
# Use find_program to locate toolchain binaries.
137+
function( FindToolBinary BINARY_VARIABLES_LIST BINARY_NAMES_LIST PATH_NAME )
138+
list( LENGTH BINARY_NAMES_LIST COUNT )
139+
math( EXPR COUNT "${COUNT}-1" )
140+
foreach( I RANGE ${COUNT} )
141+
list( GET BINARY_VARIABLES_LIST ${I} BV )
142+
list( GET BINARY_NAMES_LIST ${I} BN )
143+
find_program( ${BV} ${BN} PATHS ${PATH_NAME} NO_DEFAULT_PATH )
144+
endforeach( I )
145+
endfunction()
146+
147+
# Use custom toolchain to build libclc, this can be useful when dealing with
148+
# debug builds, that do not need libclc bitcode to be built using debug tools.
149+
if ( EXISTS ${LIBCLC_CUSTOM_LLVM_TOOLS_BINARY_DIR} )
150+
message( WARNING "Using custom LLVM tools to build libclc: "
151+
"${LIBCLC_CUSTOM_LLVM_TOOLS_BINARY_DIR}, "
152+
" make sure that the tools are up to date." )
153+
154+
# First clear the variables,
155+
ClearVariables( "${BINARY_VARIABLES}" )
156+
# then set.
157+
FindToolBinary( "${BINARY_VARIABLES}" "${BINARY_NAMES}"
158+
${LIBCLC_CUSTOM_LLVM_TOOLS_BINARY_DIR} )
159+
160+
if( NOT LLVM_CLANG OR NOT LLVM_OPT OR NOT LLVM_AS OR NOT LLVM_LINK
161+
OR NOT LIBCLC_REMANGLER )
162+
message( FATAL_ERROR "Custom toolchain incomplete!" )
163+
endif()
164+
endif()
165+
119166
# Print LLVM variables
120167
message( "LLVM libdir: ${LLVM_LIBRARY_DIR}" )
121168
message( "LLVM bindir: ${LLVM_TOOLS_BINARY_DIR}" )
122169
message( "LLVM cxx flags: ${LLVM_CXX_FLAGS}" )
123170
message( "" )
124171

125-
find_program( LLVM_CLANG clang PATHS ${LLVM_TOOLS_BINARY_DIR} NO_DEFAULT_PATH )
126-
find_program( LLVM_AS llvm-as PATHS ${LLVM_TOOLS_BINARY_DIR} NO_DEFAULT_PATH )
127-
find_program( LLVM_LINK llvm-link PATHS ${LLVM_TOOLS_BINARY_DIR} NO_DEFAULT_PATH )
128-
find_program( LLVM_OPT opt PATHS ${LLVM_TOOLS_BINARY_DIR} NO_DEFAULT_PATH )
129-
find_program( LLVM_SPIRV llvm-spirv PATHS ${LLVM_TOOLS_BINARY_DIR} NO_DEFAULT_PATH )
130-
find_program( LIBCLC_REMANGLER libclc-remangler PATHS ${LLVM_TOOLS_BINARY_DIR}
131-
NO_DEFAULT_PATH )
172+
# It's OK to call find program again, if the variables have been set in the
173+
# custom location clause, find_program returns immediately.
174+
FindToolBinary( "${BINARY_VARIABLES}" "${BINARY_NAMES}"
175+
${LLVM_TOOLS_BINARY_DIR} )
132176

133177
# Print toolchain
134178
message( "clang: ${LLVM_CLANG}" )

llvm-spirv/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# LLVM/SPIR-V Bi-Directional Translator
22

3-
[![Out-of-tree build & tests](https://github.com/KhronosGroup/SPIRV-LLVM-Translator/workflows/Out-of-tree%20build%20&%20tests/badge.svg?branch=main&event=schedule)](https://github.com/KhronosGroup/SPIRV-LLVM-Translator/actions?query=workflow%3A%22Out-of-tree+build+%26+tests%22+event%3Aschedule)
4-
[![In-tree build & tests](https://github.com/KhronosGroup/SPIRV-LLVM-Translator/workflows/In-tree%20build%20&%20tests/badge.svg?branch=main&event=schedule)](https://github.com/KhronosGroup/SPIRV-LLVM-Translator/actions?query=workflow%3A%22In-tree+build+%26+tests%22+event%3Aschedule)
3+
[![Out-of-tree build & tests](https://github.com/KhronosGroup/SPIRV-LLVM-Translator/actions/workflows/check-out-of-tree-build.yml/badge.svg?branch=main&event=schedule)](https://github.com/KhronosGroup/SPIRV-LLVM-Translator/actions?query=workflow%3A%22Out-of-tree+build+%26+tests%22+event%3Aschedule)
4+
[![In-tree build & tests](https://github.com/KhronosGroup/SPIRV-LLVM-Translator/actions/workflows/check-in-tree-build.yml/badge.svg?branch=main&event=schedule)](https://github.com/KhronosGroup/SPIRV-LLVM-Translator/actions?query=workflow%3A%22In-tree+build+%26+tests%22+event%3Aschedule)
55

66
This repository contains source code for the LLVM/SPIR-V Bi-Directional Translator, a library and tool for translation between LLVM IR and [SPIR-V](https://www.khronos.org/registry/spir-v/).
77

llvm-spirv/include/LLVMSPIRVExtensions.inc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ EXT(SPV_INTEL_variable_length_array)
4343
EXT(SPV_INTEL_fp_fast_math_mode)
4444
EXT(SPV_INTEL_fpga_cluster_attributes)
4545
EXT(SPV_INTEL_loop_fuse)
46-
EXT(SPV_INTEL_long_constant_composite)
46+
EXT(SPV_INTEL_long_constant_composite) // TODO: rename to
47+
// SPV_INTEL_long_composites later
4748
EXT(SPV_INTEL_optnone)
4849
EXT(SPV_INTEL_fpga_dsp_control)
4950
EXT(SPV_INTEL_memory_access_aliasing)

llvm-spirv/lib/SPIRV/libSPIRV/SPIRVEntry.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -908,7 +908,7 @@ class SPIRVContinuedInstINTELBase : public SPIRVEntryNoId<OC> {
908908
}
909909

910910
SPIRVCapVec getRequiredCapability() const override {
911-
return getVec(CapabilityLongConstantCompositeINTEL);
911+
return getVec(CapabilityLongCompositesINTEL);
912912
}
913913

914914
std::optional<ExtensionID> getRequiredExtension() const override {

llvm-spirv/lib/SPIRV/libSPIRV/SPIRVNameMapEnum.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,7 @@ template <> inline void SPIRVMap<Capability, std::string>::init() {
633633
add(CapabilityGroupNonUniformRotateKHR, "GroupNonUniformRotateKHR");
634634
add(CapabilityAtomicFloat32AddEXT, "AtomicFloat32AddEXT");
635635
add(CapabilityAtomicFloat64AddEXT, "AtomicFloat64AddEXT");
636-
add(CapabilityLongConstantCompositeINTEL, "LongConstantCompositeINTEL");
636+
add(CapabilityLongCompositesINTEL, "LongCompositesINTEL");
637637
add(CapabilityOptNoneINTEL, "OptNoneINTEL");
638638
add(CapabilityAtomicFloat16AddEXT, "AtomicFloat16AddEXT");
639639
add(CapabilityDebugInfoModuleINTEL, "DebugInfoModuleINTEL");

llvm-spirv/spirv-headers-tag.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
cca08c63cefa129d082abca0302adcb81610b465
1+
1c6bb2743599e6eb6f37b2969acc0aef812e32e3

llvm-spirv/test/SpecConstants/long-spec-const-composite.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-n8:16:32:64"
1212
target triple = "spir64-unknown-unknown"
1313

14-
; CHECK-SPIRV: Capability LongConstantCompositeINTEL
14+
; CHECK-SPIRV: Capability LongCompositesINTEL
1515
; CHECK-SPIRV: Extension "SPV_INTEL_long_constant_composite"
1616
; CHECK-SPIRV-DAG: Decorate [[First:[0-9]+]] SpecId 0
1717
; CHECK-SPIRV-DAG: Decorate [[Last:[0-9]+]] SpecId 65548

0 commit comments

Comments
 (0)