Skip to content

Commit 63e2b19

Browse files
Melanie Blowerbader
authored andcommitted
[SYCL] Fix pointer width on Win64 (#630)
Pointer width should be 64 not 32. Signed-off-by: Melanie Blower <[email protected]>
1 parent 6edca52 commit 63e2b19

18 files changed

+19
-30
lines changed

clang/lib/Basic/Targets/SPIR.h

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -189,11 +189,6 @@ class LLVM_LIBRARY_VISIBILITY WindowsX86_32SPIRTargetInfo
189189
: WindowsTargetInfo<SPIR32SYCLDeviceTargetInfo>(Triple, Opts) {
190190
DoubleAlign = LongLongAlign = 64;
191191
WCharType = UnsignedShort;
192-
bool IsWinCOFF =
193-
getTriple().isOSWindows() && getTriple().isOSBinFormatCOFF();
194-
resetDataLayout(IsWinCOFF
195-
? "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
196-
: "e-m:e-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32");
197192
}
198193

199194
BuiltinVaListKind getBuiltinVaListKind() const override {
@@ -218,6 +213,7 @@ class LLVM_LIBRARY_VISIBILITY MicrosoftX86_32SPIRTargetInfo
218213
: WindowsX86_32SPIRTargetInfo(Triple, Opts) {
219214
LongDoubleWidth = LongDoubleAlign = 64;
220215
LongDoubleFormat = &llvm::APFloat::IEEEdouble();
216+
assert(DataLayout->getPointerSizeInBits() == 32);
221217
}
222218

223219
void getTargetDefines(const LangOptions &Opts,
@@ -245,11 +241,6 @@ class LLVM_LIBRARY_VISIBILITY WindowsX86_64_SPIR64TargetInfo
245241
PtrDiffType = SignedLongLong;
246242
IntPtrType = SignedLongLong;
247243
WCharType = UnsignedShort;
248-
bool IsWinCOFF =
249-
getTriple().isOSWindows() && getTriple().isOSBinFormatCOFF();
250-
resetDataLayout(IsWinCOFF
251-
? "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
252-
: "e-m:e-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32");
253244
}
254245

255246
BuiltinVaListKind getBuiltinVaListKind() const override {
@@ -274,6 +265,7 @@ class LLVM_LIBRARY_VISIBILITY MicrosoftX86_64_SPIR64TargetInfo
274265
: WindowsX86_64_SPIR64TargetInfo(Triple, Opts) {
275266
LongDoubleWidth = LongDoubleAlign = 64;
276267
LongDoubleFormat = &llvm::APFloat::IEEEdouble();
268+
assert(DataLayout->getPointerSizeInBits() == 64);
277269
}
278270

279271
void getTargetDefines(const LangOptions &Opts,

sycl/test/hier_par/hier_par_basic.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// RUN: %clangxx -fsycl %s -o %t.out
1010
// RUN: env SYCL_DEVICE_TYPE=HOST %t.out
1111
// TODO: SYCL specific fail - analyze and enable on Windows
12-
// RUN: %CPU_RUN_ON_LINUX_PLACEHOLDER %t.out
12+
// RUN: %CPU_RUN_PLACEHOLDER %t.out
1313
// RUN: %GPU_RUN_ON_LINUX_PLACEHOLDER %t.out
1414
// RUN: %ACC_RUN_PLACEHOLDER %t.out
1515

sycl/test/hier_par/hier_par_wgscope.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// RUN: %clangxx -fsycl %s -o %t.out
1010
// RUN: env SYCL_DEVICE_TYPE=HOST %t.out
1111
// TODO: SYCL specific fail - analyze and enable on Windows
12-
// RUN: %CPU_RUN_ON_LINUX_PLACEHOLDER %t.out
12+
// RUN: %CPU_RUN_PLACEHOLDER %t.out
1313
// RUN: %GPU_RUN_ON_LINUX_PLACEHOLDER %t.out
1414
// RUN: %ACC_RUN_PLACEHOLDER %t.out
1515

sycl/test/usm/allocator_vector.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// RUN: %clangxx -fsycl %s -o %t1.out
22
// RUN: %CPU_RUN_PLACEHOLDER %t1.out
3+
// RUN: %GPU_RUN_PLACEHOLDER %t1.out
34
//==---- allocator_vector.cpp - Allocator Container test -------------------==//
45
//
56
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

sycl/test/usm/allocator_vector_fail.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// RUN: %clangxx -fsycl %s -o %t1.out
22
// RUN: %CPU_RUN_PLACEHOLDER %t1.out
3+
// RUN: %GPU_RUN_PLACEHOLDER %t1.out
34

45
//==-- allocator_vector_fail.cpp - Device Memory Allocator fail test -------==//
56
//

sycl/test/usm/allocatorll.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// RUN: %clangxx -fsycl %s -o %t1.out
22
// RUN: %CPU_RUN_PLACEHOLDER %t1.out
3-
// TODO: SYCL specific fail - analyze and enable
4-
// XFAIL: windows
3+
// RUN: %GPU_RUN_PLACEHOLDER %t1.out
54

65
//==---- allocatorll.cpp - Device Memory Linked List Allocator test --------==//
76
//

sycl/test/usm/depends_on.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// RUN: %clangxx -fsycl %s -o %t1.out
22
// RUN: %CPU_RUN_PLACEHOLDER %t1.out
3+
// RUN: %GPU_RUN_PLACEHOLDER %t1.out
34
//==----------------- depends_on.cpp - depends_on test ---------------------==//
45
//
56
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

sycl/test/usm/dmemll.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// RUN: %clangxx -fsycl %s -o %t1.out
22
// RUN: %CPU_RUN_PLACEHOLDER %t1.out
3-
// TODO: SYCL specific fail - analyze and enable
4-
// XFAIL: windows
3+
// RUN: %GPU_RUN_PLACEHOLDER %t1.out
54

65
//==------------------- dmemll.cpp - Device Memory Linked List test --------==//
76
//

sycl/test/usm/dmemllaligned.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// RUN: %clangxx -fsycl %s -o %t1.out
22
// RUN: %CPU_RUN_PLACEHOLDER %t1.out
3-
// TODO: SYCL specific fail - analyze and enable
4-
// XFAIL: windows
3+
// RUN: %GPU_RUN_PLACEHOLDER %t1.out
54

65
//==---- dmemllaligned.cpp - Aligned Device Memory Linked List test --------==//
76
//

sycl/test/usm/hmemll.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// RUN: %clangxx -fsycl %s -o %t1.out
22
// RUN: %CPU_RUN_PLACEHOLDER %t1.out
3-
// TODO: SYCL specific fail - analyze and enable
4-
// XFAIL: windows
3+
// RUN: %GPU_RUN_PLACEHOLDER %t1.out
54

65
//==------------------- hmemll.cpp - Host Memory Linked List test ----------==//
76
//

sycl/test/usm/hmemllaligned.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
// RUN: %clangxx -fsycl %s -o %t1.out
22
// RUN: %CPU_RUN_PLACEHOLDER %t1.out
3+
// RUN: %GPU_RUN_PLACEHOLDER %t1.out
34

4-
// TODO: SYCL specific fail - analyze and enable
5-
// XFAIL: windows
65
//==---- hmemllaligned.cpp - Aligned Host Memory Linked List test ----------==//
76
//
87
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

sycl/test/usm/memadvise.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// RUN: %clangxx -fsycl %s -o %t1.out
22
// RUN: %CPU_RUN_PLACEHOLDER %t1.out
3-
// TODO: SYCL specific fail - analyze and enable
4-
// XFAIL: windows
3+
// RUN: %GPU_RUN_PLACEHOLDER %t1.out
54

65
//==---------------- memadvise.cpp - Shared Memory Linked List test --------==//
76
//

sycl/test/usm/memcpy.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
//===----------------------------------------------------------------------===//
88
// RUN: %clangxx -fsycl %s -o %t1.out
99
// RUN: %CPU_RUN_PLACEHOLDER %t1.out
10+
// RUN: %GPU_RUN_PLACEHOLDER %t1.out
1011

1112
#include <CL/sycl.hpp>
1213

sycl/test/usm/memset.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
//===----------------------------------------------------------------------===//
88
// RUN: %clangxx -fsycl %s -o %t1.out
99
// RUN: %CPU_RUN_PLACEHOLDER %t1.out
10+
// RUN: %GPU_RUN_PLACEHOLDER %t1.out
1011

1112
#include <CL/sycl.hpp>
1213

sycl/test/usm/mixed.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// RUN: %clangxx -fsycl %s -o %t1.out
22
// RUN: %CPU_RUN_PLACEHOLDER %t1.out
3+
// RUN: %GPU_RUN_PLACEHOLDER %t1.out
34
//==------------------- mixed.cpp - Mixed Memory test ---------------------==//
45
//
56
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

sycl/test/usm/ordered_dmemll.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// RUN: %clangxx -fsycl %s -o %t1.out -lOpenCL
22
// RUN: %CPU_RUN_PLACEHOLDER %t1.out
3-
// TODO: SYCL specific fail - analyze and enable
4-
// XFAIL: windows
3+
// RUN: %GPU_RUN_PLACEHOLDER %t1.out
54

65
//==----------- ordered_dmemll.cpp - Device Memory Linked List test --------==//
76
// It uses an ordered queue where explicit waiting is not necessary between

sycl/test/usm/smemll.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// RUN: %clangxx -fsycl %s -o %t1.out
22
// RUN: %CPU_RUN_PLACEHOLDER %t1.out
3-
// TODO: SYCL specific fail - analyze and enable
4-
// XFAIL: windows
3+
// RUN: %GPU_RUN_PLACEHOLDER %t1.out
54

65
//==------------------- smemll.cpp - Shared Memory Linked List test --------==//
76
//

sycl/test/usm/smemllaligned.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// RUN: %clangxx -fsycl %s -o %t1.out
22
// RUN: %CPU_RUN_PLACEHOLDER %t1.out
3-
// TODO: SYCL specific fail - analyze and enable
4-
// XFAIL: windows
3+
// RUN: %GPU_RUN_PLACEHOLDER %t1.out
54

65
//==---- smemllaligned.cpp - Aligned Shared Memory Linked List test --------==//
76
//

0 commit comments

Comments
 (0)