Skip to content

Commit f667227

Browse files
author
iclsrc
committed
Merge from 'sycl' to 'sycl-web'
2 parents 9106759 + 1d61e69 commit f667227

32 files changed

+227
-230
lines changed

.github/workflows/sycl-detect-changes.yml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
filters:
77
description: Matched filters
88
value: ${{ jobs.need_check.outputs.filters }}
9+
arc_tests:
10+
description: Tests to run on Arc
11+
value: ${{ jobs.need_check.outputs.arc_tests }}
912

1013
jobs:
1114
need_check:
@@ -16,6 +19,7 @@ jobs:
1619
timeout-minutes: 3
1720
outputs:
1821
filters: ${{ steps.result.outputs.result }}
22+
arc_tests: ${{ steps.arc_tests.outputs.arc_tests }}
1923
steps:
2024
- name: Check file changes
2125
uses: dorny/paths-filter@0bc4621a3135347011ad047f9ecf449bf72ce2bd
@@ -57,6 +61,19 @@ jobs:
5761
- devops/scripts/install_drivers.sh
5862
perf-tests:
5963
- sycl/test-e2e/PerformanceTests/**
64+
esimd:
65+
- 'llvm/lib/SYCLLowerIR/ESIMD/**'
66+
- 'llvm/lib/SYCLLowerIR/LowerInvokeSimd.cpp'
67+
- 'llvm/include/llvm/SYCLLowerIR/LowerInvokeSimd.h'
68+
- 'sycl/include/std/experimental/simd.hpp'
69+
- 'sycl/include/std/experimental/simd.hpp'
70+
- 'sycl/include/sycl/ext/intel/esimd.hpp'
71+
- 'sycl/include/sycl/ext/intel/esimd/**'
72+
- 'sycl/include/sycl/ext/intel/esimd.hpp'
73+
- 'sycl/include/sycl/ext/intel/experimental/esimd/**'
74+
- 'sycl/include/sycl/ext/oneapi/experimental/invoke_simd.hpp'
75+
- 'sycl/include/sycl/ext/oneapi/experimental/detail/invoke_simd_types.hpp'
76+
- 'sycl/test-e2e/(ESIMD|InvokeSimd)/**'
6077
6178
- name: Set output
6279
id: result
@@ -69,6 +86,15 @@ jobs:
6986
return '${{ steps.changes.outputs.changes }}';
7087
}
7188
// Treat everything as changed for huge PRs.
72-
return ["llvm", "llvm_spirv", "clang", "sycl_fusion", "xptifw", "libclc", "sycl", "ci"];
89+
return ["llvm", "llvm_spirv", "clang", "sycl_fusion", "xptifw", "libclc", "sycl", "ci", "esimd"];
7390
7491
- run: echo '${{ steps.result.outputs.result }}'
92+
93+
- name: Set Arc tests
94+
id: arc_tests
95+
run: |
96+
if [ "${{ contains(steps.result.outputs.result, 'esimd') }}" == "true" ]; then
97+
echo 'arc_tests="(ESIMD|InvokeSimd|Matrix)/"' >> "$GITHUB_OUTPUT"
98+
else
99+
echo 'arc_tests="Matrix/"' >> "$GITHUB_OUTPUT"
100+
fi

.github/workflows/sycl-linux-precommit.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,15 @@ jobs:
6868
reset_gpu: true
6969
install_drivers: ${{ contains(needs.detect_changes.outputs.filters, 'drivers') }}
7070
extra_lit_opts: --param gpu-intel-gen12=True
71-
- name: Matrix E2E tests on Intel Arc A-Series Graphics
71+
- name: E2E tests on Intel Arc A-Series Graphics
7272
runner: '["Linux", "arc"]'
7373
image: ghcr.io/intel/llvm/ubuntu2204_intel_drivers:latest
7474
image_options: -u 1001 --device=/dev/dri --privileged --cap-add SYS_ADMIN
7575
target_devices: ext_oneapi_level_zero:gpu;opencl:gpu
7676
reset_gpu: true
7777
install_drivers: ${{ contains(needs.detect_changes.outputs.filters, 'drivers') }}
7878
extra_lit_opts: --param matrix-xmx8=True --param gpu-intel-dg2=True
79-
env: '{"LIT_FILTER":"Matrix/"}'
79+
env: '{"LIT_FILTER":${{ needs.detect_changes.outputs.arc_tests }} }'
8080
uses: ./.github/workflows/sycl-linux-run-tests.yml
8181
with:
8282
name: ${{ matrix.name }}

llvm-spirv/include/LLVMSPIRVOpts.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ class IntrinsicInst;
5454

5555
namespace SPIRV {
5656

57+
/// SPIR-V versions known to translator.
5758
enum class VersionNumber : uint32_t {
5859
// See section 2.3 of SPIR-V spec: Physical Layout of a SPIR_V Module and
5960
// Instruction
@@ -62,10 +63,9 @@ enum class VersionNumber : uint32_t {
6263
SPIRV_1_2 = 0x00010200,
6364
SPIRV_1_3 = 0x00010300,
6465
SPIRV_1_4 = 0x00010400,
65-
// TODO: populate this enum with the latest versions (up to 1.5) once
66-
// translator get support of corresponding features
66+
SPIRV_1_5 = 0x00010500,
6767
MinimumVersion = SPIRV_1_0,
68-
MaximumVersion = SPIRV_1_4
68+
MaximumVersion = SPIRV_1_5
6969
};
7070

7171
inline constexpr std::string_view formatVersionNumber(uint32_t Version) {
@@ -80,6 +80,8 @@ inline constexpr std::string_view formatVersionNumber(uint32_t Version) {
8080
return "1.3";
8181
case static_cast<uint32_t>(VersionNumber::SPIRV_1_4):
8282
return "1.4";
83+
case static_cast<uint32_t>(VersionNumber::SPIRV_1_5):
84+
return "1.5";
8385
}
8486
return "unknown";
8587
}

llvm-spirv/lib/SPIRV/VectorComputeUtil.cpp

100755100644
File mode changed.

llvm-spirv/lib/SPIRV/VectorComputeUtil.h

100755100644
File mode changed.

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ _SPIRV_OP(InvalidInstruction, "Can't translate llvm instruction:\n")
2020
_SPIRV_OP(InvalidWordCount,
2121
"Can't encode instruction with word count greater than 65535:\n")
2222
_SPIRV_OP(Requires1_1, "Feature requires SPIR-V 1.1 or greater:")
23+
_SPIRV_OP(RequiresVersion, "Cannot fulfill SPIR-V version restriction:\n")
2324
_SPIRV_OP(RequiresExtension,
2425
"Feature requires the following SPIR-V extension:\n")
2526
_SPIRV_OP(InvalidMagicNumber,

llvm-spirv/lib/SPIRV/libSPIRV/SPIRVInstruction.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,6 @@ SPIRVInstruction::getOperandTypes(const std::vector<SPIRVValue *> &Ops) {
154154
return Tys;
155155
}
156156

157-
std::vector<SPIRVType *> SPIRVInstruction::getOperandTypes() {
158-
return getOperandTypes(getOperands());
159-
}
160-
161157
void SPIRVImageInstBase::setOpWords(const std::vector<SPIRVWord> &OpsArg) {
162158
std::vector<SPIRVWord> Ops = OpsArg;
163159

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ class SPIRVInstruction : public SPIRVValue {
128128
SPIRVInstruction *getPrevious() const { return BB->getPrevious(this); }
129129
SPIRVInstruction *getNext() const { return BB->getNext(this); }
130130
virtual std::vector<SPIRVValue *> getOperands();
131-
std::vector<SPIRVType *> getOperandTypes();
132131
static std::vector<SPIRVType *>
133132
getOperandTypes(const std::vector<SPIRVValue *> &Ops);
134133

llvm-spirv/lib/SPIRV/libSPIRV/SPIRVModule.cpp

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,18 @@
5858

5959
namespace SPIRV {
6060

61+
namespace {
62+
std::string to_string(uint32_t Version) {
63+
std::string Res(formatVersionNumber(Version));
64+
Res += " (" + std::to_string(Version) + ")";
65+
return Res;
66+
}
67+
68+
std::string to_string(VersionNumber Version) {
69+
return to_string(static_cast<uint32_t>(Version));
70+
}
71+
} // Anonymous namespace
72+
6173
SPIRVModule::SPIRVModule()
6274
: AutoAddCapability(true), ValidateCapability(false), IsValid(true) {}
6375

@@ -173,7 +185,16 @@ class SPIRVModuleImpl : public SPIRVModule {
173185
void insertEntryNoId(SPIRVEntry *Entry) override { EntryNoId.insert(Entry); }
174186

175187
void setSPIRVVersion(SPIRVWord Ver) override {
176-
assert(this->isAllowedToUseVersion(static_cast<VersionNumber>(Ver)));
188+
if (!this->isAllowedToUseVersion(static_cast<VersionNumber>(Ver))) {
189+
std::stringstream SS;
190+
SS << "SPIR-V version was restricted to at most "
191+
<< to_string(getMaximumAllowedSPIRVVersion())
192+
<< " but a construct from the input requires SPIR-V version "
193+
<< to_string(Ver) << " or above\n";
194+
getErrorLog().checkError(false, SPIRVEC_RequiresVersion, SS.str());
195+
setInvalid();
196+
return;
197+
}
177198
SPIRVVersion = Ver;
178199
}
179200

@@ -2098,16 +2119,6 @@ void SPIRVModuleImpl::addUnknownStructField(SPIRVTypeStruct *Struct, unsigned I,
20982119
UnknownStructFieldMap[Struct].push_back(std::make_pair(I, ID));
20992120
}
21002121

2101-
static std::string to_string(uint32_t Version) {
2102-
std::string Res(formatVersionNumber(Version));
2103-
Res += " (" + std::to_string(Version) + ")";
2104-
return Res;
2105-
}
2106-
2107-
static std::string to_string(VersionNumber Version) {
2108-
return to_string(static_cast<uint32_t>(Version));
2109-
}
2110-
21112122
std::istream &operator>>(std::istream &I, SPIRVModule &M) {
21122123
SPIRVDecoder Decoder(I, M);
21132124
SPIRVModuleImpl &MI = *static_cast<SPIRVModuleImpl *>(&M);

llvm-spirv/test/DebugInfo/DebugInfoChecksum.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,4 @@ attributes #0 = { noinline norecurse nounwind optnone "correctly-rounded-divide-
7272
!12 = !DISubroutineType(types: !13)
7373
!13 = !{!14}
7474
!14 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
75-
!15 = !DILocation(line: 2, column: 3, scope: !10)
75+
!15 = !DILocation(line: 2, column: 3, scope: !10)

llvm-spirv/test/DebugInfo/DebugInfoTypeBasic.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,4 @@ attributes #0 = { mustprogress noinline nounwind optnone uwtable "frame-pointer"
5858
!13 = !{!14}
5959
!14 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
6060
!15 = !{}
61-
!16 = !DILocation(line: 1, column: 13, scope: !10)
61+
!16 = !DILocation(line: 1, column: 13, scope: !10)

llvm-spirv/test/DebugInfo/NonSemantic/Shader200/InlineNamespace.ll

100755100644
File mode changed.

llvm-spirv/test/FCmpFalse.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ target triple = "spir64-unknown-unknown"
1313
define spir_func i1 @f(float %0) {
1414
%2 = fcmp false float %0, %0
1515
ret i1 %2
16-
}
16+
}

llvm-spirv/test/builtin-functions.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ define weak_odr dso_local spir_kernel void @foo() {
3131
entry:
3232
%0 = call spir_func i64 @_Z26__spirv_BuiltInWorkgroupIdi(i32 0) #0
3333
ret void
34-
}
34+
}

llvm-spirv/test/builtin-globals.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ define weak_odr dso_local spir_kernel void @foo() {
2929
entry:
3030
%0 = load i64, ptr addrspace(1) @__spirv_BuiltInWorkgroupId, align 32
3131
ret void
32-
}
32+
}

llvm-spirv/test/extensions/INTEL/SPV_INTEL_arithmetic_fence/arithmetic_fence.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ define double @f1(double %a) {
4040
ret double %3
4141
}
4242

43-
declare double @llvm.arithmetic.fence.f64(double)
43+
declare double @llvm.arithmetic.fence.f64(double)

llvm-spirv/test/extensions/INTEL/SPV_INTEL_fpga_loop_controls/FPGALoopMergeInst.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,4 +593,4 @@ attributes #4 = { nounwind }
593593
; CHECK-LLVM: ![[MD_NF]] = distinct !{![[MD_NF]], ![[MD_nofusion:[0-9]+]]}
594594
; CHECK-LLVM: ![[MD_nofusion]] = !{!"llvm.loop.fusion.disable"}
595595
; CHECK-LLVM: ![[MD_MRD]] = distinct !{![[MD_MRD]], ![[MD_max_reinvocation_delay:[0-9]+]]}
596-
; CHECK-LLVM: ![[MD_max_reinvocation_delay]] = !{!"llvm.loop.intel.max_reinvocation_delay.count", i32 2}
596+
; CHECK-LLVM: ![[MD_max_reinvocation_delay]] = !{!"llvm.loop.intel.max_reinvocation_delay.count", i32 2}

llvm-spirv/test/extensions/INTEL/SPV_INTEL_function_pointers/global_ctor_dtor.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,4 @@ attributes #0 = { nounwind sspstrong "correctly-rounded-divide-sqrt-fp-math"="fa
7474
!opencl.compiler.options = !{!1}
7575

7676
!0 = !{i32 1, i32 2}
77-
!1 = !{}
77+
!1 = !{}

llvm-spirv/test/extensions/KHR/SPV_KHR_non_semantic_info/preserve-all-function-attributes.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ attributes #0 = { "foo" }
4040
attributes #1 = { "bar"="baz" }
4141

4242
; CHECK-SPIRV-EXT-DISABLED: RequiresExtension: Feature requires the following SPIR-V extension:
43-
; CHECK-SPIRV-EXT-DISABLED-NEXT: SPV_KHR_non_semantic_info
43+
; CHECK-SPIRV-EXT-DISABLED-NEXT: SPV_KHR_non_semantic_info

llvm-spirv/test/extensions/KHR/SPV_KHR_non_semantic_info/preserve-all-function-metadata.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ ret void
4444
!4 = !{!5, !6}
4545
!5 = !{i32 0, i32 2}
4646
!6 = !{i32 0, i32 8}
47-
!7 = !{!6}
47+
!7 = !{!6}

llvm-spirv/test/llvm-intrinsics/nearbyint.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ attributes #1 = { nounwind readnone speculatable willreturn }
2525
!llvm.ident = !{!1}
2626

2727
!0 = !{i32 1, !"wchar_size", i32 4}
28-
!1 = !{!"clang version 12.0.0 (https://github.com/llvm/llvm-project.git 68e1a8d20795802077987529e1268c184d749564)"}
28+
!1 = !{!"clang version 12.0.0 (https://github.com/llvm/llvm-project.git 68e1a8d20795802077987529e1268c184d749564)"}

llvm-spirv/test/lshr_shl_i1_regularize.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,4 @@ entry:
5454
store <8 x i1> %0, ptr addrspace(1) @G.2, align 1
5555
; CHECK-LLVM: store <8 x i1> [[TRUNC_2]], ptr addrspace(1) @G.2, align 1
5656
ret void
57-
}
57+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
; Check whether the translator reports an error for a module that uses a
2+
; construct only available in a SPIR-V version that's higher than what was
3+
; requested using --spirv-max-version.
4+
5+
; RUN: llvm-as < %s -o %t.bc
6+
; RUN: not llvm-spirv --spirv-max-version=1.0 %t.bc 2>&1 | FileCheck %s
7+
; RUN: not llvm-spirv --spirv-max-version=1.1 %t.bc 2>&1 | FileCheck %s
8+
; RUN: not llvm-spirv --spirv-max-version=1.2 %t.bc 2>&1 | FileCheck %s
9+
; RUN: llvm-spirv --spirv-max-version=1.3 %t.bc -o %t.spv
10+
; RUN: spirv-val %t.spv
11+
12+
; CHECK: RequiresVersion: Cannot fulfill SPIR-V version restriction:
13+
; CHECK-NEXT: SPIR-V version was restricted to at most 1.{{[012]}} ([[#]]) but a construct from the input requires SPIR-V version 1.3 (66304) or above
14+
15+
; ModuleID = 'foo.bc'
16+
target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024"
17+
target triple = "spir64"
18+
19+
; Function Attrs: convergent
20+
declare dso_local spir_func <4 x i32> @_Z16sub_group_balloti(i32) local_unnamed_addr #1
21+
22+
; Function Attrs: nounwind
23+
define dso_local spir_kernel void @testVersionReq() local_unnamed_addr #0 !kernel_arg_addr_space !3 !kernel_arg_access_qual !3 !kernel_arg_type !3 !kernel_arg_base_type !3 !kernel_arg_type_qual !3 {
24+
entry:
25+
%1 = tail call spir_func <4 x i32> @_Z16sub_group_balloti(i32 0) #1
26+
ret void
27+
}
28+
29+
attributes #0 = { nounwind }
30+
attributes #1 = { convergent }
31+
32+
!spirv.MemoryModel = !{!0}
33+
!opencl.enable.FP_CONTRACT = !{}
34+
!spirv.Source = !{!1}
35+
!opencl.spir.version = !{!0}
36+
!opencl.ocl.version = !{!0}
37+
!opencl.used.extensions = !{!2}
38+
!opencl.used.optional.core.features = !{!2}
39+
!spirv.Generator = !{!2}
40+
41+
!0 = !{i32 1, i32 2}
42+
!1 = !{i32 3, i32 102000}
43+
!2 = !{}
44+
!3 = !{}

llvm-spirv/test/negative/spirv-version-controls-1.spt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
119734787 66816 393230 12 0
1+
119734787 67072 393230 12 0
22
2 Capability Addresses
33
2 Capability Kernel
44
5 ExtInstImport 1 "OpenCL.std"
@@ -29,5 +29,4 @@
2929

3030
; RUN: not llvm-spirv %s -to-binary -o - 2>&1 | FileCheck %s --check-prefix=CHECK-ERROR
3131
;
32-
; CHECK-ERROR: Invalid SPIR-V module: unsupported SPIR-V version number 'unknown (66816)'. Range of supported/known SPIR-V versions is 1.0 (65536) - 1.4 (66560)
33-
32+
; CHECK-ERROR: Invalid SPIR-V module: unsupported SPIR-V version number 'unknown (67072)'. Range of supported/known SPIR-V versions is 1.0 (65536) - 1.5 (66816)

llvm-spirv/test/negative/spirv-version-controls-2.spt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,4 @@
2929

3030
; RUN: not llvm-spirv %s -to-binary -o - 2>&1 | FileCheck %s --check-prefix=CHECK-ERROR
3131
;
32-
; CHECK-ERROR: Invalid SPIR-V module: unsupported SPIR-V version number 'unknown (1024)'. Range of supported/known SPIR-V versions is 1.0 (65536) - 1.4 (66560)
33-
34-
32+
; CHECK-ERROR: Invalid SPIR-V module: unsupported SPIR-V version number 'unknown (1024)'. Range of supported/known SPIR-V versions is 1.0 (65536) - 1.5 (66816)

llvm-spirv/test/transcoding/sub_group_extended_types.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1318,4 +1318,4 @@ attributes #6 = { convergent nounwind }
13181318
!12 = !{!"short*"}
13191319
!13 = !{!14, !14, i64 0}
13201320
!14 = !{!"short", !9, i64 0}
1321-
!15 = !{!"ushort*"}
1321+
!15 = !{!"ushort*"}

llvm-spirv/tools/llvm-spirv/llvm-spirv.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,9 @@ static cl::opt<VersionNumber> MaxSPIRVVersion(
111111
clEnumValN(VersionNumber::SPIRV_1_1, "1.1", "SPIR-V 1.1"),
112112
clEnumValN(VersionNumber::SPIRV_1_2, "1.2", "SPIR-V 1.2"),
113113
clEnumValN(VersionNumber::SPIRV_1_3, "1.3", "SPIR-V 1.3"),
114-
clEnumValN(VersionNumber::SPIRV_1_4, "1.4", "SPIR-V 1.4")),
114+
clEnumValN(VersionNumber::SPIRV_1_4, "1.4", "SPIR-V 1.4"),
115+
clEnumValN(VersionNumber::SPIRV_1_5, "1.5",
116+
"SPIR-V 1.5 (experimental)")),
115117
cl::init(VersionNumber::MaximumVersion));
116118

117119
static cl::list<std::string>

llvm/lib/IR/BasicBlock.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ cl::opt<bool>
3434
UseNewDbgInfoFormat("experimental-debuginfo-iterators",
3535
cl::desc("Enable communicating debuginfo positions "
3636
"through iterators, eliminating intrinsics"),
37-
cl::init(false)); // INTEL
37+
cl::init(true));
3838

3939
DPMarker *BasicBlock::createMarker(Instruction *I) {
4040
assert(IsNewDbgInfoFormat &&

0 commit comments

Comments
 (0)