Skip to content

Commit 3e315e0

Browse files
committed
Fix some clang failures
Signed-off-by: Larsen, Steffen <[email protected]>
1 parent 3663a75 commit 3e315e0

File tree

2 files changed

+18
-23
lines changed

2 files changed

+18
-23
lines changed

clang/test/Driver/clang-offload-wrapper.c

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,10 @@
66

77
// RUN: clang-offload-wrapper --help | FileCheck %s --check-prefix CHECK-HELP
88
// CHECK-HELP: OVERVIEW: A tool to create a wrapper bitcode for offload target binaries.
9-
// CHECK-HELP: Takes offload target binaries and optional manifest files as input
9+
// CHECK-HELP: Takes offload target binaries as input
1010
// CHECK-HELP: and produces bitcode file containing target binaries packaged as data
1111
// CHECK-HELP: and initialization code which registers target binaries in the offload
12-
// CHECK-HELP: runtime. Manifest files format and contents are not restricted and are
13-
// CHECK-HELP: a subject of agreement between the device compiler and the native
14-
// CHECK-HELP: runtime for that device. When present, manifest file name should
15-
// CHECK-HELP: immediately follow the corresponding device image filename on the
16-
// CHECK-HELP: command line. Options annotating a device binary have effect on all
12+
// CHECK-HELP: runtime. Options annotating a device binary have effect on all
1713
// CHECK-HELP: subsequent input, until redefined.
1814
// CHECK-HELP: For example:
1915
// CHECK-HELP: clang-offload-wrapper \
@@ -26,25 +22,23 @@
2622
// CHECK-HELP: -entries=sym.txt \
2723
// CHECK-HELP: -properties=props.txt \
2824
// CHECK-HELP: a.spv \
29-
// CHECK-HELP: a_mf.txt \
3025
// CHECK-HELP: -target=xxx \
3126
// CHECK-HELP: -format=native \
3227
// CHECK-HELP: -compile-opts="" \
3328
// CHECK-HELP: -link-opts="" \
3429
// CHECK-HELP: -entries="" \
3530
// CHECK-HELP: -properties="" \
3631
// CHECK-HELP: b.bin \
37-
// CHECK-HELP: b_mf.txt \
3832
// CHECK-HELP: -kind=openmp \
3933
// CHECK-HELP: c.bin\n
4034
// CHECK-HELP: This command generates an x86 wrapper object (.bc) enclosing the
4135
// CHECK-HELP: following tuples describing a single device binary each:
42-
// CHECK-HELP: |offload|target|data |data |manifest|compile|entries|properties|...|
43-
// CHECK-HELP: | kind | |format| | |options| | |...|
44-
// CHECK-HELP: |-------|------|------|-----|--------|-------|-------|----------|---|
45-
// CHECK-HELP: |sycl |spir64|spirv |a.spv|a_mf.txt| -g |sym.txt|props.txt |...|
46-
// CHECK-HELP: |sycl |xxx |native|b.bin|b_mf.txt| | | |...|
47-
// CHECK-HELP: |openmp |xxx |native|c.bin| | | | |...|
36+
// CHECK-HELP: |offload|target|data |data |compile|entries|properties|...|
37+
// CHECK-HELP: | kind | |format| |options| | |...|
38+
// CHECK-HELP: |-------|------|------|-----|-------|-------|----------|---|
39+
// CHECK-HELP: |sycl |spir64|spirv |a.spv| -g |sym.txt|props.txt |...|
40+
// CHECK-HELP: |sycl |xxx |native|b.bin| | | |...|
41+
// CHECK-HELP: |openmp |xxx |native|c.bin| | | |...|
4842
// CHECK-HELP: |...| link |
4943
// CHECK-HELP: |...| options |
5044
// CHECK-HELP: |---|--------------------|
@@ -62,8 +56,8 @@
6256
// CHECK-HELP: Table files consist of a table of filenames that provide
6357
// CHECK-HELP: Code, Symbols, Properties, etc.
6458
// CHECK-HELP: Example input table file in batch mode:
65-
// CHECK-HELP: [Code|Symbols|Properties|Manifest]
66-
// CHECK-HELP: a_0.bc|a_0.sym|a_0.props|a_0.mnf
59+
// CHECK-HELP: [Code|Symbols|Properties]
60+
// CHECK-HELP: a_0.bc|a_0.sym|a_0.props
6761
// CHECK-HELP: a_1.bin|||
6862
// CHECK-HELP: Example usage:
6963
// CHECK-HELP: clang-offload-wrapper -batch -host=x86_64-unknown-linux-gnu
@@ -99,14 +93,13 @@
9993
// RUN: echo 'Content of device file1' > %t1.tgt
10094
// RUN: echo 'Content of device file2' > %t2.tgt
10195
// RUN: echo 'Content of device file3' > %t3.tgt
102-
// RUN: echo 'Content of manifest file1' > %t1_mf.txt
10396
//
10497
// -------
10598
// Check bitcode produced by the wrapper tool.
10699
//
107100
// RUN: clang-offload-wrapper -add-omp-offload-notes \
108101
// RUN: -host=x86_64-pc-linux-gnu \
109-
// RUN: -kind=openmp -target=tg2 -format=native %t3.tgt %t1_mf.txt \
102+
// RUN: -kind=openmp -target=tg2 -format=native %t3.tgt \
110103
// RUN: -kind=sycl -target=tg1 -compile-opts=-g -link-opts=-cl-denorms-are-zero \
111104
// RUN: -format spirv %t1.tgt \
112105
// RUN: -target=tg2 -compile-opts= -link-opts= \
@@ -123,7 +116,7 @@
123116
// CHECK-IR-DAG: [[DESCTY:%.+]] = type { i32, ptr, ptr, ptr }
124117

125118
// --- SYCL device binary image descriptor structure
126-
// CHECK-IR-DAG: [[SYCL_IMAGETY:%.+]] = type { i16, i8, i8, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
119+
// CHECK-IR-DAG: [[SYCL_IMAGETY:%.+]] = type { i16, i8, i8, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
127120
// CHECK-IR-DAG: [[SYCL_DESCTY:%.+]] = type { i16, i16, ptr, ptr, ptr }
128121

129122
// CHECK-IR: [[ENTBEGIN:@.+]] = external hidden constant [[ENTTY]]
@@ -150,7 +143,9 @@
150143
// CHECK-IR: [[SYCL_BIN1:@.+]] = internal unnamed_addr constant [[SYCL_BIN1TY:\[[0-9]+ x i8\]]] c"Content of device file2{{.+}}"
151144
// CHECK-IR: [[SYCL_INFO1:@.+]] = internal local_unnamed_addr constant [2 x i64] [i64 ptrtoint (ptr [[SYCL_BIN1]] to i64), i64 24], section ".tgtimg", align 16
152145

153-
// CHECK-IR: [[SYCL_IMAGES:@.+]] = internal unnamed_addr constant [2 x [[SYCL_IMAGETY]]] [{{.*}} { i16 2, i8 4, i8 2, ptr [[SYCL_TGT0]], ptr [[SYCL_COMPILE_OPTS0]], ptr [[SYCL_LINK_OPTS0]], ptr null, ptr null, ptr [[SYCL_BIN0]], ptr getelementptr ([[SYCL_BIN0TY]], ptr [[SYCL_BIN0]], i64 0, i64 24), ptr null, ptr null, ptr null, ptr null }, [[SYCL_IMAGETY]] { i16 2, i8 4, i8 1, ptr [[SYCL_TGT1]], ptr [[SYCL_COMPILE_OPTS1]], ptr [[SYCL_LINK_OPTS1]], ptr null, ptr null, ptr [[SYCL_BIN1]], ptr getelementptr ([[SYCL_BIN1TY]], ptr [[SYCL_BIN1]], i64 0, i64 24), ptr null, ptr null, ptr null, ptr null }]
146+
// CHECK-IR: @llvm.used = appending global [3 x ptr] [ptr [[OMP_INFO]], ptr [[SYCL_INFO]], ptr [[SYCL_INFO1]]]
147+
148+
// CHECK-IR: [[SYCL_IMAGES:@.+]] = internal unnamed_addr constant [2 x [[SYCL_IMAGETY]]] [{{.*}} { i16 3, i8 4, i8 2, ptr [[SYCL_TGT0]], ptr [[SYCL_COMPILE_OPTS0]], ptr [[SYCL_LINK_OPTS0]], ptr [[SYCL_BIN0]], ptr getelementptr ([24 x i8], ptr [[SYCL_BIN0]], i64 0, i64 24), ptr null, ptr null, ptr null, ptr null }, [[SYCL_IMAGETY]] { i16 3, i8 4, i8 1, ptr [[SYCL_TGT1]], ptr [[SYCL_COMPILE_OPTS1]], ptr [[SYCL_LINK_OPTS1]], ptr [[SYCL_BIN1]], ptr getelementptr ([24 x i8], ptr [[SYCL_BIN1]], i64 0, i64 24), ptr null, ptr null, ptr null, ptr null }]
154149

155150
// CHECK-IR: [[SYCL_DESC:@.+]] = internal constant [[SYCL_DESCTY]] { i16 1, i16 2, ptr [[SYCL_IMAGES]], ptr null, ptr null }
156151

@@ -189,7 +184,7 @@
189184
//
190185
// RUN: clang-offload-wrapper -kind sycl -host=x86_64-pc-linux-gnu -emit-reg-funcs=0 -desc-name=lalala -o - %t.tgt | llvm-dis | FileCheck %s --check-prefix CHECK-IR1
191186
// CHECK-IR1: source_filename = "offload.wrapper.object"
192-
// CHECK-IR1: [[IMAGETY:%.+]] = type { i16, i8, i8, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
187+
// CHECK-IR1: [[IMAGETY:%.+]] = type { i16, i8, i8, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
193188
// CHECK-IR1: [[DESCTY:%.+]] = type { i16, i16, ptr, ptr, ptr }
194189
// CHECK-IR1-NOT: @llvm.global_ctors
195190
// CHECK-IR1-NOT: @llvm.global_dtors

clang/test/Driver/sycl-linker-wrapper-image.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ int main() {
3838
// CHECK-DAG: %_pi_device_binary_property_struct = type { ptr, ptr, i32, i64 }
3939
// CHECK-DAG: %_pi_device_binary_property_set_struct = type { ptr, ptr, ptr }
4040
// CHECK-DAG: %struct.__tgt_offload_entry = type { i64, i16, i16, i32, ptr, ptr, i64, i64, ptr }
41-
// CHECK-DAG: %__sycl.tgt_device_image = type { i16, i8, i8, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
41+
// CHECK-DAG: %__sycl.tgt_device_image = type { i16, i8, i8, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
4242
// CHECK-DAG: %__sycl.tgt_bin_desc = type { i16, i16, ptr, ptr, ptr }
4343

4444
// CHECK-DAG: @.sycl_offloading.target.0 = internal unnamed_addr constant [7 x i8] c"spir64\00"
@@ -58,7 +58,7 @@ int main() {
5858
// CHECK-DAG: @__sycl_offload_entries_arr = internal constant [1 x %struct.__tgt_offload_entry] [%struct.__tgt_offload_entry { i64 0, i16 1, i16 8, i32 0, ptr null, ptr @__sycl_offload_entry_name, i64 0, i64 0, ptr null }]
5959
// CHECK-DAG: @.sycl_offloading.0.info = internal local_unnamed_addr constant [2 x i64] [i64 ptrtoint (ptr @.sycl_offloading.0.data to i64), i64 912], section ".tgtimg", align 16
6060
// CHECK-DAG: @llvm.used = appending global [1 x ptr] [ptr @.sycl_offloading.0.info], section "llvm.metadata"
61-
// CHECK-DAG: @.sycl_offloading.device_images = internal unnamed_addr constant [1 x %__sycl.tgt_device_image] [%__sycl.tgt_device_image { i16 2, i8 4, i8 0, ptr @.sycl_offloading.target.0, ptr @.sycl_offloading.opts.compile.0, ptr @.sycl_offloading.opts.link.0, ptr null, ptr null, ptr @.sycl_offloading.0.data, ptr getelementptr ([912 x i8], ptr @.sycl_offloading.0.data, i64 0, i64 912), ptr @__sycl_offload_entries_arr, ptr getelementptr ([1 x %struct.__tgt_offload_entry], ptr @__sycl_offload_entries_arr, i64 0, i64 1), ptr @__sycl_offload_prop_sets_arr.5, ptr getelementptr ([3 x %_pi_device_binary_property_set_struct], ptr @__sycl_offload_prop_sets_arr.5, i64 0, i64 3) }]
61+
// CHECK-DAG: @.sycl_offloading.device_images = internal unnamed_addr constant [1 x %__sycl.tgt_device_image] [%__sycl.tgt_device_image { i16 3, i8 4, i8 0, ptr @.sycl_offloading.target.0, ptr @.sycl_offloading.opts.compile.0, ptr @.sycl_offloading.opts.link.0, ptr @.sycl_offloading.0.data, ptr getelementptr ([912 x i8], ptr @.sycl_offloading.0.data, i64 0, i64 912), ptr @__sycl_offload_entries_arr, ptr getelementptr ([1 x %struct.__tgt_offload_entry], ptr @__sycl_offload_entries_arr, i64 0, i64 1), ptr @__sycl_offload_prop_sets_arr.5, ptr getelementptr ([3 x %_pi_device_binary_property_set_struct], ptr @__sycl_offload_prop_sets_arr.5, i64 0, i64 3) }]
6262
// CHECK-DAG: @.sycl_offloading.descriptor = internal constant %__sycl.tgt_bin_desc { i16 1, i16 1, ptr @.sycl_offloading.device_images, ptr null, ptr null }
6363
// CHECK-DAG: @llvm.global_ctors = {{.*}} { i32 1, ptr @sycl.descriptor_reg, ptr null }]
6464
// CHECK-DAG: @llvm.global_dtors = {{.*}} { i32 1, ptr @sycl.descriptor_unreg, ptr null }]

0 commit comments

Comments
 (0)