[clang] [CIR] Upstream support for record packing and padding (PR #136036)

2025-04-18 Thread Bruno Cardoso Lopes via cfe-commits
@@ -225,17 +235,108 @@ void RecordType::complete(ArrayRef members, bool packed, bool padded) { //===--===// llvm::TypeSize -RecordType::getTypeSizeInBits(const ::mlir::DataLayout &dataLayout, -

[clang] [CIR] Upstream support for record packing and padding (PR #136036)

2025-04-18 Thread Bruno Cardoso Lopes via cfe-commits
@@ -502,6 +502,15 @@ def CIR_RecordType : CIR_Type<"Record", "record", void complete(llvm::ArrayRef members, bool packed, bool isPadded); + + // Utilities for lazily computing and cacheing data layout info. + // FIXME: currently opaque because there's a

[clang] [CIR] Upstream support for record packing and padding (PR #136036)

2025-04-18 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor closed https://github.com/llvm/llvm-project/pull/136036 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream support for record packing and padding (PR #136036)

2025-04-18 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/136036 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream support for record packing and padding (PR #136036)

2025-04-18 Thread Andy Kaylor via cfe-commits
andykaylor wrote: @xlauko Are you happy with this after the latest update? https://github.com/llvm/llvm-project/pull/136036 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream support for record packing and padding (PR #136036)

2025-04-18 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko edited https://github.com/llvm/llvm-project/pull/136036 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream support for record packing and padding (PR #136036)

2025-04-17 Thread Andy Kaylor via cfe-commits
@@ -502,6 +502,15 @@ def CIR_RecordType : CIR_Type<"Record", "record", void complete(llvm::ArrayRef members, bool packed, bool isPadded); + + // Utilities for lazily computing and cacheing data layout info. + // FIXME: currently opaque because there's a

[clang] [CIR] Upstream support for record packing and padding (PR #136036)

2025-04-17 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor edited https://github.com/llvm/llvm-project/pull/136036 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream support for record packing and padding (PR #136036)

2025-04-17 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor updated https://github.com/llvm/llvm-project/pull/136036 >From fbe118b75d5edf8077b46d2a4fdbf94b6f2395c6 Mon Sep 17 00:00:00 2001 From: Andy Kaylor Date: Wed, 16 Apr 2025 13:44:04 -0700 Subject: [PATCH 1/3] [CIR] Upstream support for record packing and padding This

[clang] [CIR] Upstream support for record packing and padding (PR #136036)

2025-04-17 Thread Andy Kaylor via cfe-commits
@@ -225,17 +235,88 @@ void RecordType::complete(ArrayRef members, bool packed, bool padded) { //===--===// llvm::TypeSize -RecordType::getTypeSizeInBits(const ::mlir::DataLayout &dataLayout, -

[clang] [CIR] Upstream support for record packing and padding (PR #136036)

2025-04-17 Thread Andy Kaylor via cfe-commits
@@ -225,17 +235,88 @@ void RecordType::complete(ArrayRef members, bool packed, bool padded) { //===--===// llvm::TypeSize -RecordType::getTypeSizeInBits(const ::mlir::DataLayout &dataLayout, -

[clang] [CIR] Upstream support for record packing and padding (PR #136036)

2025-04-17 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor updated https://github.com/llvm/llvm-project/pull/136036 >From fbe118b75d5edf8077b46d2a4fdbf94b6f2395c6 Mon Sep 17 00:00:00 2001 From: Andy Kaylor Date: Wed, 16 Apr 2025 13:44:04 -0700 Subject: [PATCH 1/2] [CIR] Upstream support for record packing and padding This

[clang] [CIR] Upstream support for record packing and padding (PR #136036)

2025-04-17 Thread Andy Kaylor via cfe-commits
@@ -502,6 +502,15 @@ def CIR_RecordType : CIR_Type<"Record", "record", void complete(llvm::ArrayRef members, bool packed, bool isPadded); + + // Utilities for lazily computing and cacheing data layout info. + // FIXME: currently opaque because there's a

[clang] [CIR] Upstream support for record packing and padding (PR #136036)

2025-04-17 Thread Andy Kaylor via cfe-commits
@@ -225,17 +235,108 @@ void RecordType::complete(ArrayRef members, bool packed, bool padded) { //===--===// llvm::TypeSize -RecordType::getTypeSizeInBits(const ::mlir::DataLayout &dataLayout, -

[clang] [CIR] Upstream support for record packing and padding (PR #136036)

2025-04-17 Thread Henrich Lauko via cfe-commits
@@ -502,6 +502,15 @@ def CIR_RecordType : CIR_Type<"Record", "record", void complete(llvm::ArrayRef members, bool packed, bool isPadded); + + // Utilities for lazily computing and cacheing data layout info. + // FIXME: currently opaque because there's a

[clang] [CIR] Upstream support for record packing and padding (PR #136036)

2025-04-17 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko edited https://github.com/llvm/llvm-project/pull/136036 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream support for record packing and padding (PR #136036)

2025-04-17 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko edited https://github.com/llvm/llvm-project/pull/136036 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream support for record packing and padding (PR #136036)

2025-04-17 Thread Bruno Cardoso Lopes via cfe-commits
@@ -229,4 +229,32 @@ def ConstPtrAttr : CIR_Attr<"ConstPtr", "ptr", [TypedAttrInterface]> { }]; } +//===--===// +// RecordLayoutAttr +//===---

[clang] [CIR] Upstream support for record packing and padding (PR #136036)

2025-04-17 Thread Henrich Lauko via cfe-commits
@@ -502,6 +502,15 @@ def CIR_RecordType : CIR_Type<"Record", "record", void complete(llvm::ArrayRef members, bool packed, bool isPadded); + + // Utilities for lazily computing and cacheing data layout info. + // FIXME: currently opaque because there's a

[clang] [CIR] Upstream support for record packing and padding (PR #136036)

2025-04-17 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes edited https://github.com/llvm/llvm-project/pull/136036 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream support for record packing and padding (PR #136036)

2025-04-17 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes approved this pull request. LGTM once @xlauko is happy https://github.com/llvm/llvm-project/pull/136036 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream support for record packing and padding (PR #136036)

2025-04-17 Thread Bruno Cardoso Lopes via cfe-commits
@@ -225,17 +235,108 @@ void RecordType::complete(ArrayRef members, bool packed, bool padded) { //===--===// llvm::TypeSize -RecordType::getTypeSizeInBits(const ::mlir::DataLayout &dataLayout, -

[clang] [CIR] Upstream support for record packing and padding (PR #136036)

2025-04-17 Thread Bruno Cardoso Lopes via cfe-commits
@@ -502,6 +502,15 @@ def CIR_RecordType : CIR_Type<"Record", "record", void complete(llvm::ArrayRef members, bool packed, bool isPadded); + + // Utilities for lazily computing and cacheing data layout info. + // FIXME: currently opaque because there's a

[clang] [CIR] Upstream support for record packing and padding (PR #136036)

2025-04-17 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko edited https://github.com/llvm/llvm-project/pull/136036 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream support for record packing and padding (PR #136036)

2025-04-17 Thread Henrich Lauko via cfe-commits
@@ -229,4 +229,32 @@ def ConstPtrAttr : CIR_Attr<"ConstPtr", "ptr", [TypedAttrInterface]> { }]; } +//===--===// +// RecordLayoutAttr +//===---

[clang] [CIR] Upstream support for record packing and padding (PR #136036)

2025-04-17 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko edited https://github.com/llvm/llvm-project/pull/136036 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream support for record packing and padding (PR #136036)

2025-04-17 Thread Henrich Lauko via cfe-commits
@@ -225,17 +235,108 @@ void RecordType::complete(ArrayRef members, bool packed, bool padded) { //===--===// llvm::TypeSize -RecordType::getTypeSizeInBits(const ::mlir::DataLayout &dataLayout, -

[clang] [CIR] Upstream support for record packing and padding (PR #136036)

2025-04-17 Thread Henrich Lauko via cfe-commits
@@ -502,6 +502,15 @@ def CIR_RecordType : CIR_Type<"Record", "record", void complete(llvm::ArrayRef members, bool packed, bool isPadded); + + // Utilities for lazily computing and cacheing data layout info. + // FIXME: currently opaque because there's a

[clang] [CIR] Upstream support for record packing and padding (PR #136036)

2025-04-17 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko edited https://github.com/llvm/llvm-project/pull/136036 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream support for record packing and padding (PR #136036)

2025-04-17 Thread Henrich Lauko via cfe-commits
@@ -502,6 +502,15 @@ def CIR_RecordType : CIR_Type<"Record", "record", void complete(llvm::ArrayRef members, bool packed, bool isPadded); + + // Utilities for lazily computing and cacheing data layout info. + // FIXME: currently opaque because there's a

[clang] [CIR] Upstream support for record packing and padding (PR #136036)

2025-04-17 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. I'm not sure I did a great job reviewing all the layout code, but didn't see anything of concern. I'm somewhat fearful that we're pulling in existing "scary" code from Classic-CodeGen that is a 'thar be dragons' though. At the same tim

[clang] [CIR] Upstream support for record packing and padding (PR #136036)

2025-04-16 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Andy Kaylor (andykaylor) Changes This change adds support for packing and padding record types in ClangIR and introduces some infrastructure needed for this computation. Although union support has not been upstreamed yet, there is no good

[clang] [CIR] Upstream support for record packing and padding (PR #136036)

2025-04-16 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor created https://github.com/llvm/llvm-project/pull/136036 This change adds support for packing and padding record types in ClangIR and introduces some infrastructure needed for this computation. Although union support has not been upstreamed yet, there is no good w