fhahn wrote:
This breaks building on some platforms. Should be fixed with
da116bd82c0a78d2022c34b56e45cf6e4f91eaed
https://github.com/llvm/llvm-project/pull/90338
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://github.com/koachan closed
https://github.com/llvm/llvm-project/pull/90338
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/s-barannikov approved this pull request.
https://github.com/llvm/llvm-project/pull/90338
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -21,6 +21,12 @@ char f_int_4(char x) { return x; }
// CHECK-LABEL: define{{.*}} fp128 @f_ld(fp128 noundef %x)
long double f_ld(long double x) { return x; }
+// Empty struct is lowered as a placeholder word parameter.
+struct empty {};
+
+// CHECK-LABEL: define{{.*}} i64
@@ -21,6 +21,12 @@ char f_int_4(char x) { return x; }
// CHECK-LABEL: define{{.*}} fp128 @f_ld(fp128 noundef %x)
long double f_ld(long double x) { return x; }
+// Empty struct is lowered as a placeholder word parameter.
+struct empty {};
+
+// CHECK-LABEL: define{{.*}} i64
https://github.com/koachan updated
https://github.com/llvm/llvm-project/pull/90338
>From 5935e661941fd681b2bf6b3d915e97fe0d73fcd8 Mon Sep 17 00:00:00 2001
From: Koakuma
Date: Thu, 25 Apr 2024 22:37:03 +0700
Subject: [PATCH 1/3] [clang][SPARC] Treat empty structs as if it's a one-bit
type in
@@ -21,6 +21,12 @@ char f_int_4(char x) { return x; }
// CHECK-LABEL: define{{.*}} fp128 @f_ld(fp128 noundef %x)
long double f_ld(long double x) { return x; }
+// Empty struct is lowered as a placeholder word parameter.
+struct empty {};
+
+// CHECK-LABEL: define{{.*}} i64
https://github.com/koachan updated
https://github.com/llvm/llvm-project/pull/90338
>From 5935e661941fd681b2bf6b3d915e97fe0d73fcd8 Mon Sep 17 00:00:00 2001
From: Koakuma
Date: Thu, 25 Apr 2024 22:37:03 +0700
Subject: [PATCH 1/2] [clang][SPARC] Treat empty structs as if it's a one-bit
type in
@@ -21,6 +21,12 @@ char f_int_4(char x) { return x; }
// CHECK-LABEL: define{{.*}} fp128 @f_ld(fp128 noundef %x)
long double f_ld(long double x) { return x; }
+// Empty struct is lowered as a placeholder word parameter.
+struct empty {};
+
+// CHECK-LABEL: define{{.*}} i64
@@ -263,7 +263,10 @@ SparcV9ABIInfo::classifyType(QualType Ty, unsigned
SizeLimit) const {
CoerceBuilder CB(getVMContext(), getDataLayout());
CB.addStruct(0, StrTy);
- CB.pad(llvm::alignTo(CB.DL.getTypeSizeInBits(StrTy), 64));
+ // All structs, even empty ones, should
@@ -263,7 +263,10 @@ SparcV9ABIInfo::classifyType(QualType Ty, unsigned
SizeLimit) const {
CoerceBuilder CB(getVMContext(), getDataLayout());
CB.addStruct(0, StrTy);
- CB.pad(llvm::alignTo(CB.DL.getTypeSizeInBits(StrTy), 64));
+ // All structs, even empty ones, should
@@ -21,6 +21,12 @@ char f_int_4(char x) { return x; }
// CHECK-LABEL: define{{.*}} fp128 @f_ld(fp128 noundef %x)
long double f_ld(long double x) { return x; }
+// Empty struct is lowered as a placeholder word parameter.
+struct empty {};
+
+// CHECK-LABEL: define{{.*}} i64
llvmbot wrote:
@llvm/pr-subscribers-backend-sparc
@llvm/pr-subscribers-clang-codegen
Author: Koakuma (koachan)
Changes
Make sure that empty structs are treated as if it has a size of one bit in
function parameters and return types so that it occupies a full argument and/or
return
https://github.com/koachan created
https://github.com/llvm/llvm-project/pull/90338
Make sure that empty structs are treated as if it has a size of one bit in
function parameters and return types so that it occupies a full argument and/or
return register slot.
This fixes crashes and
14 matches
Mail list logo