[clang] [clang][SPARC] Treat empty structs as if it's a one-bit type in the CC (PR #90338)

2024-05-15 Thread Florian Hahn via cfe-commits
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

[clang] [clang][SPARC] Treat empty structs as if it's a one-bit type in the CC (PR #90338)

2024-05-15 Thread via cfe-commits
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

[clang] [clang][SPARC] Treat empty structs as if it's a one-bit type in the CC (PR #90338)

2024-05-13 Thread Sergei Barannikov via 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

[clang] [clang][SPARC] Treat empty structs as if it's a one-bit type in the CC (PR #90338)

2024-05-13 Thread Sergei Barannikov via 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

[clang] [clang][SPARC] Treat empty structs as if it's a one-bit type in the CC (PR #90338)

2024-05-13 Thread via 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

[clang] [clang][SPARC] Treat empty structs as if it's a one-bit type in the CC (PR #90338)

2024-05-13 Thread via cfe-commits
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

[clang] [clang][SPARC] Treat empty structs as if it's a one-bit type in the CC (PR #90338)

2024-05-07 Thread Sergei Barannikov via 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

[clang] [clang][SPARC] Treat empty structs as if it's a one-bit type in the CC (PR #90338)

2024-05-01 Thread via cfe-commits
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

[clang] [clang][SPARC] Treat empty structs as if it's a one-bit type in the CC (PR #90338)

2024-05-01 Thread via 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

[clang] [clang][SPARC] Treat empty structs as if it's a one-bit type in the CC (PR #90338)

2024-05-01 Thread via cfe-commits
@@ -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

[clang] [clang][SPARC] Treat empty structs as if it's a one-bit type in the CC (PR #90338)

2024-04-29 Thread Sergei Barannikov via cfe-commits
@@ -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

[clang] [clang][SPARC] Treat empty structs as if it's a one-bit type in the CC (PR #90338)

2024-04-29 Thread Sergei Barannikov via 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

[clang] [clang][SPARC] Treat empty structs as if it's a one-bit type in the CC (PR #90338)

2024-04-27 Thread via cfe-commits
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

[clang] [clang][SPARC] Treat empty structs as if it's a one-bit type in the CC (PR #90338)

2024-04-27 Thread via cfe-commits
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