Skip to content

Commit 1bed639

Browse files
committed
Merge from 'sycl' to 'sycl-web' (29 commits)
CONFLICT (content): Merge conflict in .github/workflows/email-check.yaml
2 parents 1583f80 + 9c96556 commit 1bed639

File tree

193 files changed

+7721
-15556
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

193 files changed

+7721
-15556
lines changed

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565
fetch-depth: 1
6666
- name: Get subprojects that have doc changes
6767
id: docs-changed-subprojects
68-
uses: tj-actions/changed-files@v42
68+
uses: tj-actions/changed-files@v44
6969
with:
7070
files_yaml: |
7171
llvm:

.github/workflows/email-check.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ jobs:
2828
2929
- name: Validate author email
3030
if: ${{ endsWith(steps.author.outputs.EMAIL, 'noreply.github.com') }}
31+
uses: actions/github-script@v7
3132
env:
3233
COMMENT: >-
3334
⚠️ We detected that you are using a GitHub private e-mail address to contribute to the repo.<br/>

.github/workflows/issue-write.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
name: workflow-args
2828

2929
- name: 'Comment on PR'
30-
uses: actions/github-script@v3
30+
uses: actions/github-script@v7
3131
with:
3232
github-token: ${{ secrets.GITHUB_TOKEN }}
3333
script: |

.github/workflows/pr-code-format.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626

2727
- name: Get changed files
2828
id: changed-files
29-
uses: tj-actions/changed-files@v42
29+
uses: tj-actions/changed-files@v44
3030
with:
3131
separator: ","
3232
skip_initial_fetch: true

.github/workflows/scorecard.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,6 @@ jobs:
5757

5858
# Upload the results to GitHub's code scanning dashboard.
5959
- name: "Upload to code-scanning"
60-
uses: github/codeql-action/upload-sarif@b7bf0a3ed3ecfa44160715d7c442788f65f0f923 # v3.23.2
60+
uses: github/codeql-action/upload-sarif@1b1aada464948af03b950897e5eb522f92603cc2 # v3.24.9
6161
with:
6262
sarif_file: results.sarif

.github/workflows/sycl-containers.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ jobs:
2828
if: github.repository == 'intel/llvm'
2929
name: Base Ubuntu 22.04 Docker image
3030
runs-on: ubuntu-22.04
31+
permissions:
32+
packages: write
3133
steps:
3234
- name: Checkout
3335
uses: actions/checkout@v4
@@ -47,6 +49,8 @@ jobs:
4749
if: github.repository == 'intel/llvm'
4850
name: Build Ubuntu Docker image
4951
runs-on: ubuntu-22.04
52+
permissions:
53+
packages: write
5054
steps:
5155
- name: Checkout
5256
uses: actions/checkout@v4
@@ -69,6 +73,8 @@ jobs:
6973
if: github.repository == 'intel/llvm'
7074
name: Intel Drivers Ubuntu 22.04 Docker image
7175
runs-on: ubuntu-22.04
76+
permissions:
77+
packages: write
7278
needs: base_image_ubuntu2204
7379
steps:
7480
- name: Checkout
@@ -107,6 +113,8 @@ jobs:
107113
if: github.repository == 'intel/llvm'
108114
name: Intel Drivers (unstable) Ubuntu 22.04 Docker image
109115
runs-on: ubuntu-22.04
116+
permissions:
117+
packages: write
110118
needs: base_image_ubuntu2204
111119
steps:
112120
- name: Checkout

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
filters: ${{ steps.result.outputs.result }}
2121
steps:
2222
- name: Check file changes
23-
uses: dorny/paths-filter@0bc4621a3135347011ad047f9ecf449bf72ce2bd
23+
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36
2424
id: changes
2525
with:
2626
filters: |

.github/workflows/sycl-nightly.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ jobs:
146146
echo "TAG=$(date +'%Y-%m-%d')-${GITHUB_SHA::7}" >> "$GITHUB_OUTPUT"
147147
fi
148148
- name: Upload binaries
149-
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844
149+
uses: softprops/action-gh-release@9d7c94cfd0a1f3ed45544c887983e9fa900f0564
150150
with:
151151
files: |
152152
sycl_linux.tar.gz
@@ -160,6 +160,8 @@ jobs:
160160
ubuntu2204_docker_build_push:
161161
if: github.repository == 'intel/llvm'
162162
runs-on: [Linux, build]
163+
permissions:
164+
packages: write
163165
needs: ubuntu2204_build
164166
steps:
165167
- uses: actions/checkout@v4

clang/lib/CodeGen/CGBuiltin.cpp

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23929,9 +23929,25 @@ CodeGenFunction::EmitIntelSYCLAllocaBuiltin(const CallExpr *E,
2392923929
// an `alloca` or an equivalent construct in later compilation stages.
2393023930
IRBuilderBase::InsertPointGuard IPG(Builder);
2393123931
Builder.SetInsertPoint(AllocaInsertPt);
23932-
return Builder.CreateIntrinsic(
23932+
llvm::CallInst *CI = Builder.CreateIntrinsic(
2393323933
AllocaTy, Intrinsic::sycl_alloca,
2393423934
{UID, SpecConstPtr, RTBufferPtr, EltTyConst, Align}, nullptr, "alloca");
23935+
23936+
// Propagate function used aspects.
23937+
llvm::Function *F = CI->getCalledFunction();
23938+
constexpr llvm::StringLiteral MDName = "sycl_used_aspects";
23939+
if (!F->getMetadata(MDName)) {
23940+
auto *AspectAttr = FD->getAttr<SYCLUsesAspectsAttr>();
23941+
assert(AspectAttr && AspectAttr->aspects_size() == 1 &&
23942+
"Expecting a single aspect");
23943+
llvm::APSInt AspectInt =
23944+
(*AspectAttr->aspects_begin())->EvaluateKnownConstInt(getContext());
23945+
llvm::Type *I32Ty = Builder.getInt32Ty();
23946+
llvm::Constant *C = llvm::Constant::getIntegerValue(I32Ty, AspectInt);
23947+
llvm::Metadata *AspectMD = llvm::ConstantAsMetadata::get(C);
23948+
F->setMetadata(MDName, llvm::MDNode::get(Builder.getContext(), AspectMD));
23949+
}
23950+
return CI;
2393523951
}();
2393623952

2393723953
// Perform AS cast if needed.

clang/lib/Driver/Driver.cpp

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7393,19 +7393,6 @@ void Driver::BuildActions(Compilation &C, DerivedArgList &Args,
73937393
break;
73947394
}
73957395

7396-
// When performing -fsycl based compilations and generating dependency
7397-
// information, perform a specific dependency generation compilation which
7398-
// is not based on the source + footer compilation.
7399-
if (Phase == phases::Preprocess && Args.hasArg(options::OPT_fsycl) &&
7400-
Args.hasArg(options::OPT_M_Group) &&
7401-
!Args.hasArg(options::OPT_fno_sycl_use_footer)) {
7402-
Action *PreprocessAction =
7403-
C.MakeAction<PreprocessJobAction>(Current, types::TY_Dependencies);
7404-
PreprocessAction->propagateHostOffloadInfo(Action::OFK_SYCL,
7405-
/*BoundArch=*/nullptr);
7406-
Actions.push_back(PreprocessAction);
7407-
}
7408-
74097396
if (Phase == phases::Precompile && ExtractAPIAction) {
74107397
ExtractAPIAction->addHeaderInput(Current);
74117398
Current = nullptr;
@@ -8162,9 +8149,6 @@ void Driver::BuildJobs(Compilation &C) const {
81628149
// we are also generating .o files. So we allow more than one output file in
81638150
// this case as well.
81648151
//
8165-
// Preprocessing job performed for -fsycl enabled compilation specifically
8166-
// for dependency generation (TY_Dependencies)
8167-
//
81688152
// OffloadClass of type TY_Nothing: device-only output will place many outputs
81698153
// into a single offloading action. We should count all inputs to the action
81708154
// as outputs. Also ignore device-only outputs if we're compiling with
@@ -8180,10 +8164,7 @@ void Driver::BuildJobs(Compilation &C) const {
81808164
A->getKind() == clang::driver::Action::CompileJobClass &&
81818165
0 == NumIfsOutputs++) ||
81828166
(A->getKind() == Action::BindArchClass && A->getInputs().size() &&
8183-
A->getInputs().front()->getKind() == Action::IfsMergeJobClass) ||
8184-
(A->getKind() == Action::PreprocessJobClass &&
8185-
A->getType() == types::TY_Dependencies &&
8186-
C.getArgs().hasArg(options::OPT_fsycl))))
8167+
A->getInputs().front()->getKind() == Action::IfsMergeJobClass)))
81878168
++NumOutputs;
81888169
else if (A->getKind() == Action::OffloadClass &&
81898170
A->getType() == types::TY_Nothing &&

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,6 +1076,8 @@ void Clang::AddPreprocessingOptions(Compilation &C, const JobAction &JA,
10761076
// Do not add dependency generation information when compiling the source +
10771077
// footer combination. The dependency generation is done in a separate
10781078
// compile step so we can retain original source information.
1079+
// TODO: remove this when/if we can improve the host compilation situation
1080+
// when dealing with the temporary file generated for the footer.
10791081
if (ContainsAppendFooterAction(&JA))
10801082
ArgM = nullptr;
10811083

@@ -1092,12 +1094,6 @@ void Clang::AddPreprocessingOptions(Compilation &C, const JobAction &JA,
10921094
DepFile, Clang::getBaseInputName(Args, Inputs[0]));
10931095
} else if (Output.getType() == types::TY_Dependencies) {
10941096
DepFile = Output.getFilename();
1095-
if (!ContainsAppendFooterAction(&JA) && Args.hasArg(options::OPT_fsycl) &&
1096-
!Args.hasArg(options::OPT_fno_sycl_use_footer) &&
1097-
!JA.isDeviceOffloading(Action::OFK_SYCL))
1098-
// Name the dependency file for the specific dependency generation
1099-
// step created for the integration footer enabled compilation.
1100-
DepFile = getDependencyFileName(Args, Inputs);
11011097
} else if (!ArgMD) {
11021098
DepFile = "-";
11031099
} else if (IsIntelFPGA && JA.isDeviceOffloading(Action::OFK_SYCL)) {

clang/test/CodeGenSYCL/Inputs/private_alloca.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ namespace experimental {
1010

1111
template <typename ElementType, auto &Size, access::decorated DecorateAddress>
1212
__SYCL_BUILTIN_ALIAS(__builtin_intel_sycl_alloca)
13+
[[__sycl_detail__::__uses_aspects__(sycl::aspect::ext_oneapi_private_alloca)]]
1314
multi_ptr<ElementType, access::address_space::private_space,
1415
DecorateAddress> private_alloca(kernel_handler &h);
1516

clang/test/CodeGenSYCL/Inputs/sycl.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ enum class __SYCL_TYPE(aspect) aspect { // #AspectEnum
101101
custom = 4,
102102
fp16 = 5,
103103
fp64 = 6,
104+
ext_oneapi_private_alloca = 7,
104105
};
105106

106107
using access::target;

clang/test/CodeGenSYCL/aspect_enum.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
// Tests for IR of [[__sycl_detail__::sycl_type(aspect)]] enum.
44
#include "sycl.hpp"
55

6-
// CHECK: !sycl_aspects = !{![[HOST:[0-9]+]], ![[CPU:[0-9]+]], ![[GPU:[0-9]+]], ![[ACC:[0-9]+]], ![[CUSTOM:[0-9]+]], ![[FP16:[0-9]+]], ![[FP64:[0-9]+]]}
6+
// CHECK: !sycl_aspects = !{![[HOST:[0-9]+]], ![[CPU:[0-9]+]], ![[GPU:[0-9]+]], ![[ACC:[0-9]+]], ![[CUSTOM:[0-9]+]], ![[FP16:[0-9]+]], ![[FP64:[0-9]+]], ![[PRIVATE_ALLOCA:[0-9]+]]}
77
// CHECK: ![[HOST]] = !{!"host", i32 0}
88
// CHECK: ![[CPU]] = !{!"cpu", i32 1}
99
// CHECK: ![[GPU]] = !{!"gpu", i32 2}
1010
// CHECK: ![[ACC]] = !{!"accelerator", i32 3}
1111
// CHECK: ![[CUSTOM]] = !{!"custom", i32 4}
1212
// CHECK: ![[FP16]] = !{!"fp16", i32 5}
1313
// CHECK: ![[FP64]] = !{!"fp64", i32 6}
14+
// CHECK: ![[PRIVATE_ALLOCA]] = !{!"ext_oneapi_private_alloca", i32 7}

clang/test/CodeGenSYCL/builtin-alloca.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,12 @@ SYCL_EXTERNAL void test(sycl::kernel_handler &kh) {
4646
auto ptr1 = sycl::ext::oneapi::experimental::private_alloca<int, intSize, sycl::access::decorated::legacy>(kh);
4747
auto ptr2 = sycl::ext::oneapi::experimental::private_alloca<myStruct, intSize, sycl::access::decorated::no>(kh);
4848
}
49+
50+
// CHECK: declare !sycl_used_aspects ![[#USED_ASPECTS:]] ptr @llvm.sycl.alloca.p0.p4.p4.p4.f64
51+
52+
// CHECK: declare !sycl_used_aspects ![[#USED_ASPECTS]] ptr @llvm.sycl.alloca.p0.p4.p4.p4.i32
53+
54+
// CHECK: declare !sycl_used_aspects ![[#USED_ASPECTS]] ptr @llvm.sycl.alloca.p0.p4.p4.p4.s_struct.myStructs
55+
56+
// CHECK-DAG: ![[#USED_ASPECTS]] = !{i32 [[#PRIVATE_ALLOCA_ASPECT:]]}
57+
// CHECK-DAG: !{!"ext_oneapi_private_alloca", i32 [[#PRIVATE_ALLOCA_ASPECT]]}

clang/test/Driver/sycl-int-footer.cpp

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@
7676
/// Check behaviors for dependency generation
7777
// RUN: %clangxx -fsycl -MD -c %s -### 2>&1 \
7878
// RUN: | FileCheck -check-prefix DEP_GEN %s
79-
// DEP_GEN: clang{{.*}} "-fsycl-is-host"
80-
// DEP_GEN-SAME: "-Eonly"
79+
// DEP_GEN: clang{{.*}} "-fsycl-is-device"
8180
// DEP_GEN-SAME: "-dependency-file"
8281
// DEP_GEN-SAME: "-MT"
8382
// DEP_GEN-SAME: "-internal-isystem" "{{.*}}{{[/\\]+}}include{{[/\\]+}}sycl"
@@ -88,19 +87,18 @@
8887
/// Dependency generation phases
8988
// RUN: %clangxx -target x86_64-unknown-linux-gnu -fsycl -MD -c %s -ccc-print-phases 2>&1 \
9089
// RUN: | FileCheck -check-prefix DEP_GEN_PHASES %s
91-
// DEP_GEN_PHASES: 0: input, "[[INPUTFILE:.+\.cpp]]", c++, (host-sycl)
92-
// DEP_GEN_PHASES: 1: preprocessor, {0}, dependencies
93-
// DEP_GEN_PHASES: 2: input, "[[INPUTFILE]]", c++, (device-sycl)
94-
// DEP_GEN_PHASES: 3: preprocessor, {2}, c++-cpp-output, (device-sycl)
95-
// DEP_GEN_PHASES: 4: compiler, {3}, ir, (device-sycl)
96-
// DEP_GEN_PHASES: 5: offload, "device-sycl (spir64-unknown-unknown)" {4}, ir
97-
// DEP_GEN_PHASES: 6: append-footer, {0}, c++, (host-sycl)
98-
// DEP_GEN_PHASES: 7: preprocessor, {6}, c++-cpp-output, (host-sycl)
99-
// DEP_GEN_PHASES: 8: offload, "host-sycl (x86_64-unknown-linux-gnu)" {7}, "device-sycl (spir64-unknown-unknown)" {4}, c++-cpp-output
100-
// DEP_GEN_PHASES: 9: compiler, {8}, ir, (host-sycl)
101-
// DEP_GEN_PHASES: 10: backend, {9}, assembler, (host-sycl)
102-
// DEP_GEN_PHASES: 11: assembler, {10}, object, (host-sycl)
103-
// DEP_GEN_PHASES: 12: clang-offload-bundler, {5, 11}, object, (host-sycl)
90+
// DEP_GEN_PHASES: 0: input, "[[INPUTFILE:.+\.cpp]]", c++, (device-sycl)
91+
// DEP_GEN_PHASES: 1: preprocessor, {0}, c++-cpp-output, (device-sycl)
92+
// DEP_GEN_PHASES: 2: compiler, {1}, ir, (device-sycl)
93+
// DEP_GEN_PHASES: 3: offload, "device-sycl (spir64-unknown-unknown)" {2}, ir
94+
// DEP_GEN_PHASES: 4: input, "[[INPUTFILE]]", c++, (host-sycl)
95+
// DEP_GEN_PHASES: 5: append-footer, {4}, c++, (host-sycl)
96+
// DEP_GEN_PHASES: 6: preprocessor, {5}, c++-cpp-output, (host-sycl)
97+
// DEP_GEN_PHASES: 7: offload, "host-sycl (x86_64-unknown-linux-gnu)" {6}, "device-sycl (spir64-unknown-unknown)" {2}, c++-cpp-output
98+
// DEP_GEN_PHASES: 8: compiler, {7}, ir, (host-sycl)
99+
// DEP_GEN_PHASES: 9: backend, {8}, assembler, (host-sycl)
100+
// DEP_GEN_PHASES: 10: assembler, {9}, object, (host-sycl)
101+
// DEP_GEN_PHASES: 11: clang-offload-bundler, {3, 10}, object, (host-sycl)
104102

105103
/// Allow for -o and preprocessing
106104
// RUN: %clangxx -fsycl -MD -c %s -o dummy -### 2>&1 \

llvm/include/llvm/SYCLLowerIR/DeviceConfigFile.td

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ def AspectExt_oneapi_is_component : Aspect<"ext_oneapi_is_component">;
7272
def AspectExt_oneapi_graph : Aspect<"ext_oneapi_graph">;
7373
def AspectExt_intel_fpga_task_sequence : Aspect<"ext_intel_fpga_task_sequence">;
7474
def AspectExt_oneapi_limited_graph : Aspect<"ext_oneapi_limited_graph">;
75+
def AspectExt_oneapi_private_alloca : Aspect<"ext_oneapi_private_alloca">;
7576
// Deprecated aspects
7677
def AspectInt64_base_atomics : Aspect<"int64_base_atomics">;
7778
def AspectInt64_extended_atomics : Aspect<"int64_extended_atomics">;
@@ -123,7 +124,8 @@ def : TargetInfo<"__TestAspectList",
123124
AspectExt_oneapi_mipmap, AspectExt_oneapi_mipmap_anisotropy, AspectExt_oneapi_mipmap_level_reference, AspectExt_intel_esimd,
124125
AspectExt_oneapi_ballot_group, AspectExt_oneapi_fixed_size_group, AspectExt_oneapi_opportunistic_group,
125126
AspectExt_oneapi_tangle_group, AspectExt_intel_matrix, AspectExt_oneapi_is_composite, AspectExt_oneapi_is_component,
126-
AspectExt_oneapi_graph, AspectExt_intel_fpga_task_sequence, AspectExt_oneapi_limited_graph],
127+
AspectExt_oneapi_graph, AspectExt_intel_fpga_task_sequence, AspectExt_oneapi_limited_graph,
128+
AspectExt_oneapi_private_alloca],
127129
[]>;
128130
// This definition serves the only purpose of testing whether the deprecated aspect list defined in here and in SYCL RT
129131
// match.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
; RUN: sycl-post-link -spec-const=emulation %s 2>&1 | FileCheck %s
2+
3+
; This test checks the `-spec-const` pass on SPIR-V targets and emulation mode,
4+
; i.e., on AOT SPIR-V targets. In this scenario, 'llvm.sycl.alloca' intrinsics
5+
; must be left unmodified.
6+
7+
; Note that coming from clang this case should never be reached.
8+
9+
; CHECK: sycl-post-link NOTE: no modifications to the input LLVM IR have been made
10+
11+
target triple = "spir64_x86_64"
12+
13+
%"class.sycl::_V1::specialization_id" = type { i64 }
14+
15+
@size_i64 = addrspace(1) constant %"class.sycl::_V1::specialization_id" { i64 10 }, align 8
16+
17+
@size_i64_stable_name = private unnamed_addr constant [36 x i8] c"_ZTS14name_generatorIL_Z8size_i64EE\00", align 1
18+
19+
define dso_local void @private_alloca() {
20+
call ptr @llvm.sycl.alloca.p0.p4.p4.p4.f64(ptr addrspace(4) addrspacecast (ptr @size_i64_stable_name to ptr addrspace(4)), ptr addrspace(4) addrspacecast (ptr addrspace(1) @size_i64 to ptr addrspace(4)), ptr addrspace(4) null, double 0.000000e+00, i64 8)
21+
ret void
22+
}
23+
24+
declare ptr @llvm.sycl.alloca.p0.p4.p4.p4.f32(ptr addrspace(4), ptr addrspace(4), ptr addrspace(4), float, i64)

llvm/test/tools/sycl-post-link/spec-constants/SYCL-alloca.ll

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
; RUN: sycl-post-link -spec-const=native < %s -S -o %t.table
2-
; RUN: FileCheck %s -check-prefixes=CHECK-RT < %t_0.ll
2+
; RUN: FileCheck %s -check-prefixes=CHECK,CHECK-RT < %t_0.ll
33
; RUN: FileCheck %s --check-prefixes=CHECK-PROPS < %t_0.prop
44

5+
; RUN: sycl-post-link -spec-const=emulation < %s -S -o %t.table
6+
; RUN: FileCheck %s -check-prefixes=CHECK,CHECK-EMULATION < %t_0.ll
7+
58
; This test checks that the post link tool is able to correctly transform
69
; SYCL alloca intrinsics in SPIR-V devices.
710

@@ -10,9 +13,9 @@
1013
%"class.sycl::_V1::specialization_id.1" = type { i16 }
1114
%my_range = type { ptr addrspace(4), ptr addrspace(4) }
1215

13-
@size_i64 = internal addrspace(1) constant %"class.sycl::_V1::specialization_id" { i64 10 }, align 8
14-
@size_i32 = internal addrspace(1) constant %"class.sycl::_V1::specialization_id.0" { i32 120 }, align 4
15-
@size_i16 = internal addrspace(1) constant %"class.sycl::_V1::specialization_id.1" { i16 1 }, align 2
16+
@size_i64 = addrspace(1) constant %"class.sycl::_V1::specialization_id" { i64 10 }, align 8
17+
@size_i32 = addrspace(1) constant %"class.sycl::_V1::specialization_id.0" { i32 120 }, align 4
18+
@size_i16 = addrspace(1) constant %"class.sycl::_V1::specialization_id.1" { i16 1 }, align 2
1619

1720
; Check that the following globals are preserved: even though they are not used
1821
; in the module anymore, they could still be referenced by debug info metadata
@@ -30,10 +33,19 @@
3033
define dso_local void @private_alloca() {
3134
; CHECK-RT: [[LENGTH:%.*]] = call i32 @_Z20__spirv_SpecConstantii(i32 1, i32 120)
3235
; CHECK-RT: {{.*}} = alloca double, i32 [[LENGTH]], align 8
36+
37+
; CHECK-EMULATION: alloca double, i32 120, align 8
3338
call ptr @llvm.sycl.alloca.p0.p4.p4.p4.f64(ptr addrspace(4) addrspacecast (ptr @size_i32_stable_name to ptr addrspace(4)), ptr addrspace(4) addrspacecast (ptr addrspace(1) @size_i32 to ptr addrspace(4)), ptr addrspace(4) null, double 0.000000e+00, i64 8)
3439
; CHECK-RT: [[LENGTH:%.*]] = call i64 @_Z20__spirv_SpecConstantix(i32 0, i64 10)
3540
; CHECK-RT: {{.*}} = alloca float, i64 [[LENGTH]], align 8
41+
42+
; CHECK-EMULATION: alloca float, i64 10, align 8
3643
call ptr @llvm.sycl.alloca.p0.p4.p4.p4.f32(ptr addrspace(4) addrspacecast (ptr @size_i64_stable_name to ptr addrspace(4)), ptr addrspace(4) addrspacecast (ptr addrspace(1) @size_i64 to ptr addrspace(4)), ptr addrspace(4) null, float 0.000000e+00, i64 8)
44+
45+
; CHECK-RT: %[[LENGTH:.*]] = call i16 @_Z20__spirv_SpecConstantis(i32 2, i16 1)
46+
; CHECK-RT: {{.*}} = alloca %my_range, i16 %[[LENGTH]], align 64
47+
48+
; CHECK-EMULATION: alloca %my_range, i16 1, align 64
3749
call ptr @llvm.sycl.alloca.p0.p4.p4.p4.s_my_range(ptr addrspace(4) addrspacecast (ptr @size_i16_stable_name to ptr addrspace(4)), ptr addrspace(4) addrspacecast (ptr addrspace(1) @size_i16 to ptr addrspace(4)), ptr addrspace(4) null, %my_range zeroinitializer, i64 64)
3850
ret void
3951
}

0 commit comments

Comments
 (0)