Skip to content

Commit c9f2727

Browse files
authored
[clang][aarch64] Add support for the MSVC qualifiers __ptr32, __ptr64, __sptr, __uptr for AArch64 (#111879)
MSVC has a set of qualifiers to allow using 32-bit signed/unsigned pointers when building 64-bit targets. This is useful for WoW code (i.e., the part of Windows that handles running 32-bit application on a 64-bit OS). Currently this is supported on x64 using the 270, 271 and 272 address spaces, but does not work for AArch64 at all. This change adds the same 270, 271 and 272 address spaces to AArch64 and adjusts the data layout string accordingly. Clang will generate the correct address space casts, but these will currently be ignored until the AArch64 backend is updated to handle them. Partially fixes #62536 This is a resurrected version of <https://reviews.llvm.org/D158857> (originally created by @a_vorobev) - I've cleaned it up a little, fixed the rest of the tests and added to auto-upgrade for the data layout.
1 parent 867e042 commit c9f2727

File tree

9 files changed

+112
-27
lines changed

9 files changed

+112
-27
lines changed

clang/lib/Basic/Targets/AArch64.cpp

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,8 @@ AArch64TargetInfo::AArch64TargetInfo(const llvm::Triple &Triple,
143143
IntMaxType = SignedLong;
144144
}
145145

146+
AddrSpaceMap = &ARM64AddrSpaceMap;
147+
146148
// All AArch64 implementations support ARMv8 FP, which makes half a legal type.
147149
HasLegalHalfType = true;
148150
HalfArgsAndReturns = true;
@@ -1533,11 +1535,16 @@ AArch64leTargetInfo::AArch64leTargetInfo(const llvm::Triple &Triple,
15331535
void AArch64leTargetInfo::setDataLayout() {
15341536
if (getTriple().isOSBinFormatMachO()) {
15351537
if(getTriple().isArch32Bit())
1536-
resetDataLayout("e-m:o-p:32:32-i64:64-i128:128-n32:64-S128-Fn32", "_");
1538+
resetDataLayout("e-m:o-p:32:32-p270:32:32-p271:32:32-p272:64:64-i64:64-"
1539+
"i128:128-n32:64-S128-Fn32",
1540+
"_");
15371541
else
1538-
resetDataLayout("e-m:o-i64:64-i128:128-n32:64-S128-Fn32", "_");
1542+
resetDataLayout("e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-"
1543+
"n32:64-S128-Fn32",
1544+
"_");
15391545
} else
1540-
resetDataLayout("e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32");
1546+
resetDataLayout("e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-"
1547+
"i64:64-i128:128-n32:64-S128-Fn32");
15411548
}
15421549

15431550
void AArch64leTargetInfo::getTargetDefines(const LangOptions &Opts,
@@ -1560,7 +1567,8 @@ void AArch64beTargetInfo::getTargetDefines(const LangOptions &Opts,
15601567

15611568
void AArch64beTargetInfo::setDataLayout() {
15621569
assert(!getTriple().isOSBinFormatMachO());
1563-
resetDataLayout("E-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32");
1570+
resetDataLayout("E-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-"
1571+
"i64:64-i128:128-n32:64-S128-Fn32");
15641572
}
15651573

15661574
WindowsARM64TargetInfo::WindowsARM64TargetInfo(const llvm::Triple &Triple,
@@ -1583,8 +1591,10 @@ WindowsARM64TargetInfo::WindowsARM64TargetInfo(const llvm::Triple &Triple,
15831591

15841592
void WindowsARM64TargetInfo::setDataLayout() {
15851593
resetDataLayout(Triple.isOSBinFormatMachO()
1586-
? "e-m:o-i64:64-i128:128-n32:64-S128-Fn32"
1587-
: "e-m:w-p:64:64-i32:32-i64:64-i128:128-n32:64-S128-Fn32",
1594+
? "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:"
1595+
"128-n32:64-S128-Fn32"
1596+
: "e-m:w-p270:32:32-p271:32:32-p272:64:64-p:64:64-i32:32-"
1597+
"i64:64-i128:128-n32:64-S128-Fn32",
15881598
Triple.isOSBinFormatMachO() ? "_" : "");
15891599
}
15901600

clang/lib/Basic/Targets/AArch64.h

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,34 @@
2121
namespace clang {
2222
namespace targets {
2323

24+
enum AArch64AddrSpace { ptr32_sptr = 270, ptr32_uptr = 271, ptr64 = 272 };
25+
26+
static const unsigned ARM64AddrSpaceMap[] = {
27+
0, // Default
28+
0, // opencl_global
29+
0, // opencl_local
30+
0, // opencl_constant
31+
0, // opencl_private
32+
0, // opencl_generic
33+
0, // opencl_global_device
34+
0, // opencl_global_host
35+
0, // cuda_device
36+
0, // cuda_constant
37+
0, // cuda_shared
38+
0, // sycl_global
39+
0, // sycl_global_device
40+
0, // sycl_global_host
41+
0, // sycl_local
42+
0, // sycl_private
43+
static_cast<unsigned>(AArch64AddrSpace::ptr32_sptr),
44+
static_cast<unsigned>(AArch64AddrSpace::ptr32_uptr),
45+
static_cast<unsigned>(AArch64AddrSpace::ptr64),
46+
0, // hlsl_groupshared
47+
// Wasm address space values for this target are dummy values,
48+
// as it is only enabled for Wasm targets.
49+
20, // wasm_funcref
50+
};
51+
2452
class LLVM_LIBRARY_VISIBILITY AArch64TargetInfo : public TargetInfo {
2553
virtual void setDataLayout() = 0;
2654
static const TargetInfo::GCCRegAlias GCCRegAliases[];
@@ -207,6 +235,18 @@ class LLVM_LIBRARY_VISIBILITY AArch64TargetInfo : public TargetInfo {
207235

208236
bool validateGlobalRegisterVariable(StringRef RegName, unsigned RegSize,
209237
bool &HasSizeMismatch) const override;
238+
239+
uint64_t getPointerWidthV(LangAS AddrSpace) const override {
240+
if (AddrSpace == LangAS::ptr32_sptr || AddrSpace == LangAS::ptr32_uptr)
241+
return 32;
242+
if (AddrSpace == LangAS::ptr64)
243+
return 64;
244+
return PointerWidth;
245+
}
246+
247+
uint64_t getPointerAlignV(LangAS AddrSpace) const override {
248+
return getPointerWidthV(AddrSpace);
249+
}
210250
};
211251

212252
class LLVM_LIBRARY_VISIBILITY AArch64leTargetInfo : public AArch64TargetInfo {

clang/test/CodeGen/aarch64-type-sizes.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: %clang_cc1 -triple aarch64_be-none-linux-gnu -emit-llvm -w -o - %s | FileCheck %s
22
// char by definition has size 1
33

4-
// CHECK: target datalayout = "E-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32"
4+
// CHECK: target datalayout = "E-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32"
55

66
int check_short(void) {
77
return sizeof(short);

clang/test/CodeGen/coff-aarch64-type-sizes.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: %clang_cc1 -triple aarch64-windows -emit-llvm -w -o - %s | FileCheck %s
22

3-
// CHECK: target datalayout = "e-m:w-p:64:64-i32:32-i64:64-i128:128-n32:64-S128-Fn32"
3+
// CHECK: target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-p:64:64-i32:32-i64:64-i128:128-n32:64-S128-Fn32"
44
// CHECK: target triple = "aarch64-unknown-windows-msvc"
55

66
int check_short(void) {

clang/test/CodeGen/ms-mixed-ptr-sizes.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// RUN: %clang_cc1 -triple x86_64-windows-msvc -fms-extensions -emit-llvm -O2 < %s | FileCheck %s --check-prefixes=X64,ALL
22
// RUN: %clang_cc1 -triple i386-pc-win32 -fms-extensions -emit-llvm -O2 < %s | FileCheck %s --check-prefixes=X86,ALL
3+
// RUN: %clang_cc1 -triple aarch64-windows-msvc -fms-extensions -emit-llvm -O2 < %s | FileCheck %s --check-prefixes=AARCH64,ALL
34

45
struct Foo {
56
int * __ptr32 p32;
@@ -9,41 +10,51 @@ void use_foo(struct Foo *f);
910
void test_sign_ext(struct Foo *f, int * __ptr32 __sptr i) {
1011
// X64-LABEL: define dso_local void @test_sign_ext({{.*}}ptr addrspace(270) noundef %i)
1112
// X86-LABEL: define dso_local void @test_sign_ext(ptr noundef %f, ptr noundef %i)
13+
// AARCH64-LABEL: define dso_local void @test_sign_ext({{.*}}ptr addrspace(270) noundef %i) local_unnamed_addr #0
1214
// X64: %{{.+}} = addrspacecast ptr addrspace(270) %i to ptr
1315
// X86: %{{.+}} = addrspacecast ptr %i to ptr addrspace(272)
16+
// AARCH64: %{{.+}} = addrspacecast ptr addrspace(270) %i to ptr
1417
f->p64 = i;
1518
use_foo(f);
1619
}
1720
void test_zero_ext(struct Foo *f, int * __ptr32 __uptr i) {
1821
// X64-LABEL: define dso_local void @test_zero_ext({{.*}}ptr addrspace(271) noundef %i)
1922
// X86-LABEL: define dso_local void @test_zero_ext({{.*}}ptr addrspace(271) noundef %i)
23+
// AARCH64-LABEL: define dso_local void @test_zero_ext({{.*}}ptr addrspace(271) noundef %i) local_unnamed_addr #0
2024
// X64: %{{.+}} = addrspacecast ptr addrspace(271) %i to ptr
2125
// X86: %{{.+}} = addrspacecast ptr addrspace(271) %i to ptr addrspace(272)
26+
// AARCH64: %{{.+}} = addrspacecast ptr addrspace(271) %i to ptr
2227
f->p64 = i;
2328
use_foo(f);
2429
}
2530
void test_trunc(struct Foo *f, int * __ptr64 i) {
2631
// X64-LABEL: define dso_local void @test_trunc(ptr noundef %f, ptr noundef %i)
2732
// X86-LABEL: define dso_local void @test_trunc({{.*}}ptr addrspace(272) noundef %i)
33+
// AARCH64-LABEL: define dso_local void @test_trunc(ptr noundef %f, ptr noundef %i) local_unnamed_addr #0
2834
// X64: %{{.+}} = addrspacecast ptr %i to ptr addrspace(270)
2935
// X86: %{{.+}} = addrspacecast ptr addrspace(272) %i to ptr
36+
// AARCH64: %{{.+}} = addrspacecast ptr %i to ptr addrspace(270)
3037
f->p32 = i;
3138
use_foo(f);
3239
}
3340
void test_noop(struct Foo *f, int * __ptr32 i) {
3441
// X64-LABEL: define dso_local void @test_noop({{.*}}ptr addrspace(270) noundef %i)
3542
// X86-LABEL: define dso_local void @test_noop({{.*}}ptr noundef %i)
43+
// AARCH64-LABEL: define dso_local void @test_noop({{.*}}ptr addrspace(270) noundef %i) local_unnamed_addr #0
3644
// X64-NOT: addrspacecast
3745
// X86-NOT: addrspacecast
46+
// AARCH64-NOT: addrspacecast
3847
f->p32 = i;
3948
use_foo(f);
4049
}
4150

4251
void test_other(struct Foo *f, __attribute__((address_space(10))) int *i) {
4352
// X64-LABEL: define dso_local void @test_other({{.*}}ptr addrspace(10) noundef %i)
4453
// X86-LABEL: define dso_local void @test_other({{.*}}ptr addrspace(10) noundef %i)
54+
// AARCH64-LABEL: define dso_local void @test_other({{.*}}ptr addrspace(10) noundef %i) local_unnamed_addr #0
4555
// X64: %{{.+}} = addrspacecast ptr addrspace(10) %i to ptr addrspace(270)
4656
// X86: %{{.+}} = addrspacecast ptr addrspace(10) %i to ptr
57+
// AARCH64: %{{.+}} = addrspacecast ptr addrspace(10) %i to ptr addrspace(270)
4758
f->p32 = (int * __ptr32)i;
4859
use_foo(f);
4960
}
@@ -54,6 +65,8 @@ int test_compare1(int *__ptr32 __uptr i, int *__ptr64 j) {
5465
// X64: %cmp = icmp eq ptr addrspace(271) %i, %{{.+}}
5566
// X86: %{{.+}} = addrspacecast ptr addrspace(272) %j to ptr addrspace(271)
5667
// X86: %cmp = icmp eq ptr addrspace(271) %i, %{{.+}}
68+
// AARCH64: %{{.+}} = addrspacecast ptr %j to ptr addrspace(271)
69+
// AARCH64: %cmp = icmp eq ptr addrspace(271) %i, %{{.+}}
5770
return (i == j);
5871
}
5972

@@ -63,6 +76,8 @@ int test_compare2(int *__ptr32 __sptr i, int *__ptr64 j) {
6376
// X64: %cmp = icmp eq ptr addrspace(270) %i, %{{.+}}
6477
// X86: %{{.+}} = addrspacecast ptr addrspace(272) %j to ptr
6578
// X86: %cmp = icmp eq ptr %i, %{{.+}}
79+
// AARCH64: %{{.+}} = addrspacecast ptr %j to ptr addrspace(270)
80+
// AARCH64: %cmp = icmp eq ptr addrspace(270) %i, %{{.+}}
6681
return (i == j);
6782
}
6883

@@ -72,6 +87,8 @@ int test_compare3(int *__ptr32 __uptr i, int *__ptr64 j) {
7287
// X64: %cmp = icmp eq ptr %j, %{{.+}}
7388
// X86: %{{.+}} = addrspacecast ptr addrspace(271) %i to ptr addrspace(272)
7489
// X86: %cmp = icmp eq ptr addrspace(272) %j, %{{.+}}
90+
// AARCH64: %{{.+}} = addrspacecast ptr addrspace(271) %i to ptr
91+
// AARCH64: %cmp = icmp eq ptr %j, %{{.+}}
7592
return (j == i);
7693
}
7794

@@ -81,5 +98,7 @@ int test_compare4(int *__ptr32 __sptr i, int *__ptr64 j) {
8198
// X64: %cmp = icmp eq ptr %j, %{{.+}}
8299
// X86: %{{.+}} = addrspacecast ptr %i to ptr addrspace(272)
83100
// X86: %cmp = icmp eq ptr addrspace(272) %j, %{{.+}}
101+
// AARCH64: %{{.+}} = addrspacecast ptr addrspace(270) %i to ptr
102+
// AARCH64: %cmp = icmp eq ptr %j, %{{.+}}
84103
return (j == i);
85104
}

clang/test/CodeGen/target-data.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,15 +185,15 @@
185185

186186
// RUN: %clang_cc1 -triple arm64-unknown -o - -emit-llvm %s | \
187187
// RUN: FileCheck %s -check-prefix=AARCH64
188-
// AARCH64: target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32"
188+
// AARCH64: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32"
189189

190190
// RUN: %clang_cc1 -triple arm64_32-apple-ios7.0 -o - -emit-llvm %s | \
191191
// RUN: FileCheck %s -check-prefix=AARCH64-ILP32
192-
// AARCH64-ILP32: target datalayout = "e-m:o-p:32:32-i64:64-i128:128-n32:64-S128-Fn32"
192+
// AARCH64-ILP32: target datalayout = "e-m:o-p:32:32-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32:64-S128-Fn32"
193193

194194
// RUN: %clang_cc1 -triple arm64-pc-win32-macho -o - -emit-llvm %s | \
195195
// RUN: FileCheck %s -check-prefix=AARCH64-WIN32-MACHO
196-
// AARCH64-WIN32-MACHO: target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128-Fn32"
196+
// AARCH64-WIN32-MACHO: target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32:64-S128-Fn32"
197197

198198
// RUN: %clang_cc1 -triple thumb-unknown-gnueabi -o - -emit-llvm %s | \
199199
// RUN: FileCheck %s -check-prefix=THUMB

llvm/lib/IR/AutoUpgrade.cpp

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5577,11 +5577,24 @@ std::string llvm::UpgradeDataLayoutString(StringRef DL, StringRef TT) {
55775577
return Res;
55785578
}
55795579

5580+
auto AddPtr32Ptr64AddrSpaces = [&DL, &Res]() {
5581+
// If the datalayout matches the expected format, add pointer size address
5582+
// spaces to the datalayout.
5583+
StringRef AddrSpaces{"-p270:32:32-p271:32:32-p272:64:64"};
5584+
if (!DL.contains(AddrSpaces)) {
5585+
SmallVector<StringRef, 4> Groups;
5586+
Regex R("^([Ee]-m:[a-z](-p:32:32)?)(-.*)$");
5587+
if (R.match(Res, &Groups))
5588+
Res = (Groups[1] + AddrSpaces + Groups[3]).str();
5589+
}
5590+
};
5591+
55805592
// AArch64 data layout upgrades.
55815593
if (T.isAArch64()) {
55825594
// Add "-Fn32"
55835595
if (!DL.empty() && !DL.contains("-Fn32"))
55845596
Res.append("-Fn32");
5597+
AddPtr32Ptr64AddrSpaces();
55855598
return Res;
55865599
}
55875600

@@ -5600,15 +5613,7 @@ std::string llvm::UpgradeDataLayoutString(StringRef DL, StringRef TT) {
56005613
if (!T.isX86())
56015614
return Res;
56025615

5603-
// If the datalayout matches the expected format, add pointer size address
5604-
// spaces to the datalayout.
5605-
std::string AddrSpaces = "-p270:32:32-p271:32:32-p272:64:64";
5606-
if (StringRef Ref = Res; !Ref.contains(AddrSpaces)) {
5607-
SmallVector<StringRef, 4> Groups;
5608-
Regex R("(e-m:[a-z](-p:32:32)?)(-[if]64:.*$)");
5609-
if (R.match(Res, &Groups))
5610-
Res = (Groups[1] + AddrSpaces + Groups[3]).str();
5611-
}
5616+
AddPtr32Ptr64AddrSpaces();
56125617

56135618
// i128 values need to be 16-byte-aligned. LLVM already called into libgcc
56145619
// for i128 operations prior to this being reflected in the data layout, and

llvm/lib/Target/AArch64/AArch64TargetMachine.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -290,15 +290,19 @@ static std::string computeDataLayout(const Triple &TT,
290290
bool LittleEndian) {
291291
if (TT.isOSBinFormatMachO()) {
292292
if (TT.getArch() == Triple::aarch64_32)
293-
return "e-m:o-p:32:32-i64:64-i128:128-n32:64-S128-Fn32";
294-
return "e-m:o-i64:64-i128:128-n32:64-S128-Fn32";
293+
return "e-m:o-p:32:32-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-"
294+
"n32:64-S128-Fn32";
295+
return "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32:64-S128-"
296+
"Fn32";
295297
}
296298
if (TT.isOSBinFormatCOFF())
297-
return "e-m:w-p:64:64-i32:32-i64:64-i128:128-n32:64-S128-Fn32";
299+
return "e-m:w-p270:32:32-p271:32:32-p272:64:64-p:64:64-i32:32-i64:64-i128:"
300+
"128-n32:64-S128-Fn32";
298301
std::string Endian = LittleEndian ? "e" : "E";
299302
std::string Ptr32 = TT.getEnvironment() == Triple::GNUILP32 ? "-p:32:32" : "";
300303
return Endian + "-m:e" + Ptr32 +
301-
"-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32";
304+
"-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-"
305+
"n32:64-S128-Fn32";
302306
}
303307

304308
static StringRef computeDefaultCPU(const Triple &TT, StringRef CPU) {

llvm/unittests/Bitcode/DataLayoutUpgradeTest.cpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ TEST(DataLayoutUpgradeTest, ValidDataLayoutUpgrade) {
2323
"e-m:o-i64:64-f80:128-n8:16:32:64-S128", "x86_64-apple-macosx");
2424
std::string DL4 =
2525
UpgradeDataLayoutString("e-m:o-i64:64-i128:128-n32:64-S128", "aarch64--");
26+
std::string DL5 = UpgradeDataLayoutString(
27+
"e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128", "aarch64--");
2628
EXPECT_EQ(DL1,
2729
"e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128"
2830
"-f80:128-n8:16:32:64-S128");
@@ -31,7 +33,10 @@ TEST(DataLayoutUpgradeTest, ValidDataLayoutUpgrade) {
3133
"-f80:128-n8:16:32-S32");
3234
EXPECT_EQ(DL3, "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:"
3335
"128-n8:16:32:64-S128");
34-
EXPECT_EQ(DL4, "e-m:o-i64:64-i128:128-n32:64-S128-Fn32");
36+
EXPECT_EQ(DL4, "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32:"
37+
"64-S128-Fn32");
38+
EXPECT_EQ(DL5, "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:"
39+
"64-i128:128-n32:64-S128-Fn32");
3540

3641
// Check that AMDGPU targets add -G1 if it's not present.
3742
EXPECT_EQ(UpgradeDataLayoutString("e-p:32:32", "r600"), "e-p:32:32-G1");
@@ -94,14 +99,16 @@ TEST(DataLayoutUpgradeTest, NoDataLayoutUpgrade) {
9499
std::string DL2 = UpgradeDataLayoutString("e-m:e-i64:64-n32:64",
95100
"powerpc64le-unknown-linux-gnu");
96101
std::string DL3 = UpgradeDataLayoutString(
97-
"e-m:o-i64:64-i128:128-n32:64-S128-Fn32", "aarch64--");
102+
"e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32:64-S128-Fn32",
103+
"aarch64--");
98104
EXPECT_EQ(
99105
DL1,
100106
"e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-i128:128:128"
101107
"-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64"
102108
"-f80:128:128-n8:16:32:64-S128");
103109
EXPECT_EQ(DL2, "e-m:e-i64:64-n32:64");
104-
EXPECT_EQ(DL3, "e-m:o-i64:64-i128:128-n32:64-S128-Fn32");
110+
EXPECT_EQ(DL3, "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32:"
111+
"64-S128-Fn32");
105112

106113
// Check that AMDGPU targets don't add -G1 if there is already a -G flag.
107114
EXPECT_EQ(UpgradeDataLayoutString("e-p:32:32-G2", "r600"), "e-p:32:32-G2");

0 commit comments

Comments
 (0)