[clang] [CIR] Add support for discrete bit-field (PR #156085)

2025-08-29 Thread Andy Kaylor via cfe-commits
@@ -306,7 +316,45 @@ void CIRRecordLowering::fillOutputFields() { RecordDecl::field_iterator CIRRecordLowering::accumulateBitFields(RecordDecl::field_iterator field, RecordDecl::field_iterator fieldEnd) { - assert(!cir::MissingFeatures::i

[clang] [CIR] Add support for discrete bit-field (PR #156085)

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

[clang] [CIR] Add support for discrete bit-field (PR #156085)

2025-08-29 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor commented: Looks good, with just a couple of test requests. https://github.com/llvm/llvm-project/pull/156085 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commi

[clang] [CIR] Add support for discrete bit-field (PR #156085)

2025-08-29 Thread Andy Kaylor via cfe-commits
@@ -0,0 +1,65 @@ +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -mms-bitfields -fclangir -emit-cir %s -o %t.cir +// RUN: FileCheck --input-file=%t.cir %s --check-prefix=CIR +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -mms-bitfields -fclangir -emit-llvm %s -o %t-ci

[clang] [OpenACC] 'reduction' 'one-init' lowering, */&& operators. (PR #156122)

2025-08-29 Thread Andy Kaylor via cfe-commits
@@ -2589,6 +2589,59 @@ SemaOpenACC::ActOnOpenACCAsteriskSizeExpr(SourceLocation AsteriskLoc) { return BuildOpenACCAsteriskSizeExpr(AsteriskLoc); } +/// Loops through a type and generates an appropriate InitListExpr to generate +/// type initialization. +static Expr *Generat

[clang] [OpenACC] 'reduction' 'one-init' lowering, */&& operators. (PR #156122)

2025-08-29 Thread Andy Kaylor via cfe-commits
@@ -2589,6 +2589,59 @@ SemaOpenACC::ActOnOpenACCAsteriskSizeExpr(SourceLocation AsteriskLoc) { return BuildOpenACCAsteriskSizeExpr(AsteriskLoc); } +/// Loops through a type and generates an appropriate InitListExpr to generate +/// type initialization. +static Expr *Generat

[clang] [OpenACC] 'reduction' 'one-init' lowering, */&& operators. (PR #156122)

2025-08-29 Thread Andy Kaylor via cfe-commits
@@ -2589,6 +2589,59 @@ SemaOpenACC::ActOnOpenACCAsteriskSizeExpr(SourceLocation AsteriskLoc) { return BuildOpenACCAsteriskSizeExpr(AsteriskLoc); } +/// Loops through a type and generates an appropriate InitListExpr to generate +/// type initialization. +static Expr *Generat

[clang] [OpenACC] 'reduction' 'one-init' lowering, */&& operators. (PR #156122)

2025-08-29 Thread Andy Kaylor via cfe-commits
@@ -2589,6 +2589,59 @@ SemaOpenACC::ActOnOpenACCAsteriskSizeExpr(SourceLocation AsteriskLoc) { return BuildOpenACCAsteriskSizeExpr(AsteriskLoc); } +/// Loops through a type and generates an appropriate InitListExpr to generate +/// type initialization. +static Expr *Generat

[clang] [OpenACC] 'reduction' 'one-init' lowering, */&& operators. (PR #156122)

2025-08-29 Thread Andy Kaylor via cfe-commits
@@ -2733,14 +2786,33 @@ SemaOpenACC::CreateInitRecipe(OpenACCClauseKind CK, // are used for code generation, we can just ignore/not bother doing any // initialization here. break; - case OpenACCReductionOperator::Multiplication: case OpenACC

[clang] [OpenACC] 'reduction' 'one-init' lowering, */&& operators. (PR #156122)

2025-08-29 Thread Andy Kaylor via cfe-commits
@@ -2589,6 +2589,59 @@ SemaOpenACC::ActOnOpenACCAsteriskSizeExpr(SourceLocation AsteriskLoc) { return BuildOpenACCAsteriskSizeExpr(AsteriskLoc); } +/// Loops through a type and generates an appropriate InitListExpr to generate +/// type initialization. +static Expr *Generat

[clang] [OpenACC] 'reduction' 'one-init' lowering, */&& operators. (PR #156122)

2025-08-29 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor commented: This looks good, but I have some questions and a couple of suggestions. https://github.com/llvm/llvm-project/pull/156122 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mai

[clang] [OpenACC] 'reduction' 'one-init' lowering, */&& operators. (PR #156122)

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

[clang] [CIR] Add handling for volatile loads and stores (PR #156124)

2025-08-29 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor created https://github.com/llvm/llvm-project/pull/156124 This fills in the missing pieces to handle volatile loads and stores in CIR. This addresses https://github.com/llvm/llvm-project/issues/153280 >From 99df40768de131846d6b58ac876cafd6dcddc2c0 Mon Sep 17 00:00:

[clang] [OpenACC] 'reduction' init lowering for +, |, ^, || (PR #155924)

2025-08-29 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor approved this pull request. lgtm https://github.com/llvm/llvm-project/pull/155924 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Implement VAArgExpr for ComplexType (PR #156092)

2025-08-29 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor approved this pull request. https://github.com/llvm/llvm-project/pull/156092 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Implement VAArgExpr for ComplexType (PR #156092)

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

[clang] [CIR] Implement VAArgExpr for ComplexType (PR #156092)

2025-08-29 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor commented: Looks good, but without calling convention lowering it's not very useful. https://github.com/llvm/llvm-project/pull/156092 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/m

[clang] [CIR] Implement VAArgExpr for ComplexType (PR #156092)

2025-08-29 Thread Andy Kaylor via cfe-commits
@@ -853,3 +853,56 @@ void foo32() { // OGCG: %[[REAL_ADDR:.*]] = alloca i32, align 4 // OGCG: %[[REAL:.*]] = load i32, ptr @_ZN9Container1cE, align 4 // OGCG: store i32 %[[REAL]], ptr %[[REAL_ADDR]], align 4 + +void foo33(__builtin_va_list a) { + float _Complex b = __builtin_v

[clang] [CIR] Add value initialization for scalar types (PR #156036)

2025-08-29 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor approved this pull request. lgtm https://github.com/llvm/llvm-project/pull/156036 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Complex Unary plus and minus with promoted type (PR #155486)

2025-08-29 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor approved this pull request. lgtm https://github.com/llvm/llvm-project/pull/155486 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][driver] Improve warning message for complex range overrides (PR #154899)

2025-08-29 Thread Andy Kaylor via cfe-commits
@@ -2730,17 +2730,38 @@ static void CollectArgsForIntegratedAssembler(Compilation &C, } } -static std::string ComplexArithmeticStr(LangOptions::ComplexRangeKind Range) { - return (Range == LangOptions::ComplexRangeKind::CX_None) - ? "" - : "-fcomple

[clang] [clang][driver] Improve warning message for complex range overrides (PR #154899)

2025-08-29 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor approved this pull request. This looks good to me. https://github.com/llvm/llvm-project/pull/154899 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][driver] Improve warning message for complex range overrides (PR #154899)

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

[clang] [OpenACC] 'reduction' init lowering for +, |, ^, || (PR #155924)

2025-08-28 Thread Andy Kaylor via cfe-commits
@@ -3,9 +3,32 @@ // CHECK: acc.reduction.recipe @reduction_lor__ZTSA5_f : !cir.ptr> reduction_operator init { // CHECK-NEXT: ^bb0(%[[ARG:.*]]: !cir.ptr>{{.*}}) -// CHECK-NEXT: cir.alloca !cir.array, !cir.ptr>, ["openacc.reduction.init"] -// TODO OpenACC: Expecting an initia

[clang] [OpenACC] 'reduction' init lowering for +, |, ^, || (PR #155924)

2025-08-28 Thread Andy Kaylor via cfe-commits
@@ -425,6 +425,7 @@ class OpenACCClauseCIREmitter final &recipe.getCopyRegion(), recipe.getCopyRegion().end(), {mainOp.getType(), mainOp.getType()}, {loc, loc}); builder.setInsertionPointToEnd(&recipe.getCopyRegion().back()); +CIRGenFunction::LexicalScop

[clang] [CIR] Add constant record ILE support (PR #155663)

2025-08-28 Thread Andy Kaylor via cfe-commits
@@ -21,20 +20,526 @@ #include "clang/AST/APValue.h" #include "clang/AST/ASTContext.h" #include "clang/AST/Attr.h" +#include "clang/AST/CharUnits.h" #include "clang/AST/OperationKinds.h" #include "clang/AST/RecordLayout.h" #include "clang/AST/StmtVisitor.h" #include "clang/B

[clang] [CIR] Add constant record ILE support (PR #155663)

2025-08-28 Thread Andy Kaylor via cfe-commits
@@ -21,20 +20,526 @@ #include "clang/AST/APValue.h" #include "clang/AST/ASTContext.h" #include "clang/AST/Attr.h" +#include "clang/AST/CharUnits.h" #include "clang/AST/OperationKinds.h" #include "clang/AST/RecordLayout.h" #include "clang/AST/StmtVisitor.h" #include "clang/B

[clang] [CIR] Add constant record ILE support (PR #155663)

2025-08-28 Thread Andy Kaylor via cfe-commits
@@ -21,20 +20,526 @@ #include "clang/AST/APValue.h" #include "clang/AST/ASTContext.h" #include "clang/AST/Attr.h" +#include "clang/AST/CharUnits.h" #include "clang/AST/OperationKinds.h" #include "clang/AST/RecordLayout.h" #include "clang/AST/StmtVisitor.h" #include "clang/B

[clang] [CIR] Add constant record ILE support (PR #155663)

2025-08-28 Thread Andy Kaylor via cfe-commits
@@ -21,20 +20,526 @@ #include "clang/AST/APValue.h" #include "clang/AST/ASTContext.h" #include "clang/AST/Attr.h" +#include "clang/AST/CharUnits.h" #include "clang/AST/OperationKinds.h" #include "clang/AST/RecordLayout.h" #include "clang/AST/StmtVisitor.h" #include "clang/B

[clang] [CIR] Add constant record ILE support (PR #155663)

2025-08-28 Thread Andy Kaylor via cfe-commits
@@ -21,20 +20,526 @@ #include "clang/AST/APValue.h" #include "clang/AST/ASTContext.h" #include "clang/AST/Attr.h" +#include "clang/AST/CharUnits.h" #include "clang/AST/OperationKinds.h" #include "clang/AST/RecordLayout.h" #include "clang/AST/StmtVisitor.h" #include "clang/B

[clang] [CIR] Add constant record ILE support (PR #155663)

2025-08-28 Thread Andy Kaylor via cfe-commits
@@ -21,20 +20,526 @@ #include "clang/AST/APValue.h" #include "clang/AST/ASTContext.h" #include "clang/AST/Attr.h" +#include "clang/AST/CharUnits.h" #include "clang/AST/OperationKinds.h" #include "clang/AST/RecordLayout.h" #include "clang/AST/StmtVisitor.h" #include "clang/B

[clang] [CIR] Add constant record ILE support (PR #155663)

2025-08-28 Thread Andy Kaylor via cfe-commits
@@ -21,20 +20,526 @@ #include "clang/AST/APValue.h" #include "clang/AST/ASTContext.h" #include "clang/AST/Attr.h" +#include "clang/AST/CharUnits.h" #include "clang/AST/OperationKinds.h" #include "clang/AST/RecordLayout.h" #include "clang/AST/StmtVisitor.h" #include "clang/B

[clang] [CIR] Add constant record ILE support (PR #155663)

2025-08-28 Thread Andy Kaylor via cfe-commits
@@ -30,7 +30,8 @@ llvm::Align CIRDataLayout::getAlignment(mlir::Type ty, bool useABIAlign) const { return llvm::Align(1); // Get the layout annotation... which is lazily created on demand. -llvm_unreachable("getAlignment()) for record type is not implemented");

[clang] [CIR] Add constant record ILE support (PR #155663)

2025-08-28 Thread Andy Kaylor via cfe-commits
@@ -21,20 +20,526 @@ #include "clang/AST/APValue.h" #include "clang/AST/ASTContext.h" #include "clang/AST/Attr.h" +#include "clang/AST/CharUnits.h" #include "clang/AST/OperationKinds.h" #include "clang/AST/RecordLayout.h" #include "clang/AST/StmtVisitor.h" #include "clang/B

[clang] [CIR] Add constant record ILE support (PR #155663)

2025-08-28 Thread Andy Kaylor via cfe-commits
@@ -21,20 +20,526 @@ #include "clang/AST/APValue.h" #include "clang/AST/ASTContext.h" #include "clang/AST/Attr.h" +#include "clang/AST/CharUnits.h" #include "clang/AST/OperationKinds.h" #include "clang/AST/RecordLayout.h" #include "clang/AST/StmtVisitor.h" #include "clang/B

[clang] [CIR] Add constant record ILE support (PR #155663)

2025-08-28 Thread Andy Kaylor via cfe-commits
@@ -21,20 +20,526 @@ #include "clang/AST/APValue.h" #include "clang/AST/ASTContext.h" #include "clang/AST/Attr.h" +#include "clang/AST/CharUnits.h" #include "clang/AST/OperationKinds.h" #include "clang/AST/RecordLayout.h" #include "clang/AST/StmtVisitor.h" #include "clang/B

[clang] [CIR] Add constant record ILE support (PR #155663)

2025-08-28 Thread Andy Kaylor via cfe-commits
@@ -21,20 +20,526 @@ #include "clang/AST/APValue.h" #include "clang/AST/ASTContext.h" #include "clang/AST/Attr.h" +#include "clang/AST/CharUnits.h" #include "clang/AST/OperationKinds.h" #include "clang/AST/RecordLayout.h" #include "clang/AST/StmtVisitor.h" #include "clang/B

[clang] [CIR] Add constant record ILE support (PR #155663)

2025-08-28 Thread Andy Kaylor via cfe-commits
@@ -21,20 +20,526 @@ #include "clang/AST/APValue.h" #include "clang/AST/ASTContext.h" #include "clang/AST/Attr.h" +#include "clang/AST/CharUnits.h" #include "clang/AST/OperationKinds.h" #include "clang/AST/RecordLayout.h" #include "clang/AST/StmtVisitor.h" #include "clang/B

[clang] [CIR] Add constant record ILE support (PR #155663)

2025-08-28 Thread Andy Kaylor via cfe-commits
@@ -21,20 +20,526 @@ #include "clang/AST/APValue.h" #include "clang/AST/ASTContext.h" #include "clang/AST/Attr.h" +#include "clang/AST/CharUnits.h" #include "clang/AST/OperationKinds.h" #include "clang/AST/RecordLayout.h" #include "clang/AST/StmtVisitor.h" #include "clang/B

[clang] [CIR] Add constant record ILE support (PR #155663)

2025-08-28 Thread Andy Kaylor via cfe-commits
@@ -21,20 +20,526 @@ #include "clang/AST/APValue.h" #include "clang/AST/ASTContext.h" #include "clang/AST/Attr.h" +#include "clang/AST/CharUnits.h" #include "clang/AST/OperationKinds.h" #include "clang/AST/RecordLayout.h" #include "clang/AST/StmtVisitor.h" #include "clang/B

[clang] [CIR] Add constant record ILE support (PR #155663)

2025-08-28 Thread Andy Kaylor via cfe-commits
@@ -21,20 +20,526 @@ #include "clang/AST/APValue.h" #include "clang/AST/ASTContext.h" #include "clang/AST/Attr.h" +#include "clang/AST/CharUnits.h" #include "clang/AST/OperationKinds.h" #include "clang/AST/RecordLayout.h" #include "clang/AST/StmtVisitor.h" #include "clang/B

[clang] [CIR] Add constant record ILE support (PR #155663)

2025-08-28 Thread Andy Kaylor via cfe-commits
@@ -21,20 +20,526 @@ #include "clang/AST/APValue.h" #include "clang/AST/ASTContext.h" #include "clang/AST/Attr.h" +#include "clang/AST/CharUnits.h" #include "clang/AST/OperationKinds.h" #include "clang/AST/RecordLayout.h" #include "clang/AST/StmtVisitor.h" #include "clang/B

[clang] [CIR] Upstream Re-Throw with no return (PR #154994)

2025-08-28 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor approved this pull request. This looks good. I have a lot of suggestions for updating the op description, but feel free to merge after updating those. https://github.com/llvm/llvm-project/pull/154994 ___ cfe-commits maili

[clang] [CIR] Upstream Re-Throw with no return (PR #154994)

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

[clang] [CIR] DivOp & CompoundAssignmentDiv between ComplexType and ScalarType (PR #155167)

2025-08-28 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor approved this pull request. lgtm https://github.com/llvm/llvm-project/pull/155167 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream Re-Throw with no return (PR #154994)

2025-08-28 Thread Andy Kaylor via cfe-commits
@@ -3864,4 +3864,63 @@ def CIR_VAArgOp : CIR_Op<"va_arg"> { }]; } +//===--===// +// ThrowOp +//===--===// + +def CIR_ThrowOp : CIR_Op<"thro

[clang] [CIR] Upstream Re-Throw with no return (PR #154994)

2025-08-28 Thread Andy Kaylor via cfe-commits
@@ -3864,4 +3864,63 @@ def CIR_VAArgOp : CIR_Op<"va_arg"> { }]; } +//===--===// +// ThrowOp +//===--===// + +def CIR_ThrowOp : CIR_Op<"thro

[clang] [CIR] Upstream Re-Throw with no return (PR #154994)

2025-08-28 Thread Andy Kaylor via cfe-commits
@@ -3864,4 +3864,63 @@ def CIR_VAArgOp : CIR_Op<"va_arg"> { }]; } +//===--===// +// ThrowOp +//===--===// + +def CIR_ThrowOp : CIR_Op<"thro

[clang] [CIR] Upstream Re-Throw with no return (PR #154994)

2025-08-28 Thread Andy Kaylor via cfe-commits
@@ -3864,4 +3864,63 @@ def CIR_VAArgOp : CIR_Op<"va_arg"> { }]; } +//===--===// +// ThrowOp +//===--===// + +def CIR_ThrowOp : CIR_Op<"thro

[clang] [CIR] Upstream Re-Throw with no return (PR #154994)

2025-08-28 Thread Andy Kaylor via cfe-commits
@@ -3864,4 +3864,63 @@ def CIR_VAArgOp : CIR_Op<"va_arg"> { }]; } +//===--===// +// ThrowOp +//===--===// + +def CIR_ThrowOp : CIR_Op<"thro

[clang] [Clang][CodeGen]NFC] Modernize loops in EmitCtorPrologue (PR #155668)

2025-08-28 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor updated https://github.com/llvm/llvm-project/pull/155668 >From 7a3f59c3f250f9730dc3479f2b5e1b28ec2f2354 Mon Sep 17 00:00:00 2001 From: Andy Kaylor Date: Wed, 27 Aug 2025 10:28:55 -0700 Subject: [PATCH 1/2] [Clang][CodeGen]NFC] Modernize loops in EmitCtorPrologue T

[clang] [CIR] Add constant record ILE support (PR #155663)

2025-08-27 Thread Andy Kaylor via cfe-commits
@@ -130,6 +132,44 @@ void CIRGenBuilderTy::computeGlobalViewIndicesFromFlatOffset( computeGlobalViewIndicesFromFlatOffset(offset, subType, layout, indices); } +static mlir::Type getAttributeType(mlir::Attribute attr) { + return mlir::cast(attr).getType(); +} + +cir::Record

[clang] [CIR] Add constant record ILE support (PR #155663)

2025-08-27 Thread Andy Kaylor via cfe-commits
@@ -21,20 +20,571 @@ #include "clang/AST/APValue.h" #include "clang/AST/ASTContext.h" #include "clang/AST/Attr.h" +#include "clang/AST/CharUnits.h" #include "clang/AST/OperationKinds.h" #include "clang/AST/RecordLayout.h" #include "clang/AST/StmtVisitor.h" #include "clang/B

[clang] [CIR] Add constant record ILE support (PR #155663)

2025-08-27 Thread Andy Kaylor via cfe-commits
@@ -130,6 +132,44 @@ void CIRGenBuilderTy::computeGlobalViewIndicesFromFlatOffset( computeGlobalViewIndicesFromFlatOffset(offset, subType, layout, indices); } +static mlir::Type getAttributeType(mlir::Attribute attr) { + return mlir::cast(attr).getType(); +} + +cir::Record

[clang] [CIR] Add constant record ILE support (PR #155663)

2025-08-27 Thread Andy Kaylor via cfe-commits
@@ -130,6 +132,44 @@ void CIRGenBuilderTy::computeGlobalViewIndicesFromFlatOffset( computeGlobalViewIndicesFromFlatOffset(offset, subType, layout, indices); } +static mlir::Type getAttributeType(mlir::Attribute attr) { + return mlir::cast(attr).getType(); +} + +cir::Record

[clang] [CIR] Add constant record ILE support (PR #155663)

2025-08-27 Thread Andy Kaylor via cfe-commits
@@ -283,6 +283,16 @@ Type RecordType::getLargestMember(const ::mlir::DataLayout &dataLayout) const { }); } +bool RecordType::isLayoutIdentical(const RecordType &other) { + if (getImpl() == other.getImpl()) +return true; + + if (getPacked() != other.getPacked()) +

[clang] [CIR] Add constant record ILE support (PR #155663)

2025-08-27 Thread Andy Kaylor via cfe-commits
@@ -130,6 +132,44 @@ void CIRGenBuilderTy::computeGlobalViewIndicesFromFlatOffset( computeGlobalViewIndicesFromFlatOffset(offset, subType, layout, indices); } +static mlir::Type getAttributeType(mlir::Attribute attr) { + return mlir::cast(attr).getType(); +} + +cir::Record

[clang] [CIR] Add initial support for virtual base classes (PR #155534)

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

[clang] [CIR] Add initial support for virtual base classes (PR #155534)

2025-08-27 Thread Andy Kaylor via cfe-commits
@@ -238,31 +238,44 @@ void CIRGenFunction::emitCtorPrologue(const CXXConstructorDecl *cd, bool constructVBases = ctorType != Ctor_Base && classDecl->getNumVBases() != 0 && !classDecl->isAbstract(); - if (constructVBases) { -

[clang] [OpenACC] Partial Reduction recipe Lowering (PR #155635)

2025-08-27 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor approved this pull request. lgtm, but some of the tests are going to fail after https://github.com/llvm/llvm-project/pull/155697 so we need to coordinate the merge order for these. https://github.com/llvm/llvm-project/pull/155635 __

[clang] [CIR] Add initial support for virtual base classes (PR #155534)

2025-08-27 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor updated https://github.com/llvm/llvm-project/pull/155534 >From dc7ae0c41669c04d1288a882929058ec08501042 Mon Sep 17 00:00:00 2001 From: Andy Kaylor Date: Fri, 11 Jul 2025 13:18:29 -0700 Subject: [PATCH 1/4] [CIR] Add initial support for virtual base classes This ad

[clang] [CIR] Add initial support for virtual base classes (PR #155534)

2025-08-27 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor updated https://github.com/llvm/llvm-project/pull/155534 >From dc7ae0c41669c04d1288a882929058ec08501042 Mon Sep 17 00:00:00 2001 From: Andy Kaylor Date: Fri, 11 Jul 2025 13:18:29 -0700 Subject: [PATCH 1/3] [CIR] Add initial support for virtual base classes This ad

[clang] [CIR] Add initial support for virtual base classes (PR #155534)

2025-08-27 Thread Andy Kaylor via cfe-commits
@@ -180,7 +180,11 @@ CharUnits CodeGenModule::computeNonVirtualBaseClassOffset( // Get the layout. const ASTRecordLayout &Layout = Context.getASTRecordLayout(RD); -const auto *BaseDecl = Base->getType()->castAsCXXRecordDecl(); +const auto *BaseDecl = --

[clang] [CIR] Add initial support for virtual base classes (PR #155534)

2025-08-27 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor updated https://github.com/llvm/llvm-project/pull/155534 >From dc7ae0c41669c04d1288a882929058ec08501042 Mon Sep 17 00:00:00 2001 From: Andy Kaylor Date: Fri, 11 Jul 2025 13:18:29 -0700 Subject: [PATCH 1/2] [CIR] Add initial support for virtual base classes This ad

[clang] [CIR] Add initial support for virtual base classes (PR #155534)

2025-08-27 Thread Andy Kaylor via cfe-commits
@@ -899,6 +933,52 @@ void CIRRecordLowering::accumulateBases(const CXXRecordDecl *cxxRecordDecl) { } } +void CIRRecordLowering::accumulateVBases() { andykaylor wrote: Yes, we should definitely update to the newer code structure. Thanks for catching that!

[clang] [CIR] Emit copy for aggregate initialization (PR #155697)

2025-08-27 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor created https://github.com/llvm/llvm-project/pull/155697 This adds the implementation of aggEmitFinalDestCopy for the case where the destination value is not ignored. This requires adding the cir.copy operation and associated interface code. >From 36b02a82c306c31

[clang] [CIR][NFC] Add errors for unhandled AggExprEmitter visitors (PR #155469)

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

[clang] [CIR][NFC] Add errors for unhandled AggExprEmitter visitors (PR #155469)

2025-08-27 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor updated https://github.com/llvm/llvm-project/pull/155469 >From 711aee40c93a964cf8c731e1eb2aea4b1a055783 Mon Sep 17 00:00:00 2001 From: Andy Kaylor Date: Tue, 26 Aug 2025 09:36:52 -0700 Subject: [PATCH 1/2] [CIR][NFC] Add errors for unhandled AggExprEmitter visitor

[clang] [Clang][CodeGen]NFC] Modernize loops in EmitCtorPrologue (PR #155668)

2025-08-27 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor created https://github.com/llvm/llvm-project/pull/155668 This patch updates the loops in EmitCtorPrologue to use range-based for loops rather than looping over a single iterator which was being shared between three loops. Setting up three separate ranges adds a ve

[clang] [CIR] Add initial support for virtual base classes (PR #155534)

2025-08-27 Thread Andy Kaylor via cfe-commits
@@ -37,6 +37,12 @@ class CIRGenCXXABI { void setCXXABIThisValue(CIRGenFunction &cgf, mlir::Value thisPtr); + /// Emit the code to initialize hidden members required to handle virtual + /// inheritance, if needed by the ABI. + virtual void + initializeHiddenVirtualInheri

[clang] [CIR] Add initial support for virtual base classes (PR #155534)

2025-08-27 Thread Andy Kaylor via cfe-commits
@@ -238,31 +238,44 @@ void CIRGenFunction::emitCtorPrologue(const CXXConstructorDecl *cd, bool constructVBases = ctorType != Ctor_Base && classDecl->getNumVBases() != 0 && !classDecl->isAbstract(); - if (constructVBases) { -

[clang] [CIR] More atomic load and store (PR #155168)

2025-08-26 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor approved this pull request. I have no additional comments beyond what @bcardosolopes has already said. https://github.com/llvm/llvm-project/pull/155168 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.

[clang] [CIR] Fix element type and alignment handling in emitDestroy for arrays (PR #155333)

2025-08-26 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor commented: Doesn't this have an effect on any of the existing tests? I'm not sure this is what we want. I know the parameter for emitArrayDestroy is named `elementType` but the current output looks correct. https://github.com/llvm/llvm-project/pull/155333

[clang] [CIR] Add support for initializing classes with multiple vtables (PR #155275)

2025-08-26 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor updated https://github.com/llvm/llvm-project/pull/155275 >From 5b6ce122b2298484dbeae63c4fc8151a312a Mon Sep 17 00:00:00 2001 From: Andy Kaylor Date: Thu, 21 Aug 2025 09:24:43 -0700 Subject: [PATCH 1/3] [CIR] Add support for initializing classes with multiple v

[clang] [CIR] Add support for initializing classes with multiple vtables (PR #155275)

2025-08-25 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor updated https://github.com/llvm/llvm-project/pull/155275 >From 37816ad3f4470032843080d71bd9b4425d1bc243 Mon Sep 17 00:00:00 2001 From: Andy Kaylor Date: Thu, 21 Aug 2025 09:24:43 -0700 Subject: [PATCH 1/2] [CIR] Add support for initializing classes with multiple v

[clang] [CIR] Add VTTAddrPointOp (PR #155048)

2025-08-25 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor updated https://github.com/llvm/llvm-project/pull/155048 >From 5442c29e2d0960843da83e944b61e8155ce0ff1f Mon Sep 17 00:00:00 2001 From: Andy Kaylor Date: Fri, 22 Aug 2025 13:26:30 -0700 Subject: [PATCH 1/2] [CIR] Add VTTAddrPointOp This adds the definition, verific

[clang] [CIR] Add support for initializing classes with multiple vtables (PR #155275)

2025-08-25 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor created https://github.com/llvm/llvm-project/pull/155275 This adds support for initializing the vptr members in a class that requires multiple vtables because of multiple inheritence. This still does not handle virtual bases. >From 37816ad3f4470032843080d71bd9b44

[clang] [CIR] Add support for emitting multi-vtables (PR #155027)

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

[clang] [CIR] Add support for emitting multi-vtables (PR #155027)

2025-08-25 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor updated https://github.com/llvm/llvm-project/pull/155027 >From 6d89819044ba3f2500af4dfa07f8f93bba00aeb9 Mon Sep 17 00:00:00 2001 From: Andy Kaylor Date: Wed, 20 Aug 2025 14:44:32 -0700 Subject: [PATCH 1/3] [CIR] Add support for emitting multi-vtables This change a

[clang] [CIR] Add support for emitting multi-vtables (PR #155027)

2025-08-25 Thread Andy Kaylor via cfe-commits
@@ -144,33 +144,29 @@ void CIRGenVTables::createVTableInitializer(cir::GlobalOp &vtableOp, layout.getAddressPointIndices(); unsigned nextVTableThunkIndex = 0; - if (layout.getNumVTables() > 1) -cgm.errorNYI("emitVTableDefinitions: multiple vtables"); - - // We'l

[clang] [CIR] Add VTTAddrPointOp (PR #155048)

2025-08-22 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor created https://github.com/llvm/llvm-project/pull/155048 This adds the definition, verification, and lowering for CIR's VTTAddrPointOp. This is a bit ahead of the current codegen implementation, which doesn't yet have support for emitting VTT definitions, but sinc

[clang] [CIR] Add verifier for vtable initializer (PR #155031)

2025-08-22 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor updated https://github.com/llvm/llvm-project/pull/155031 >From fd0bd309c13adba6966cfafbc884cb378e0212c4 Mon Sep 17 00:00:00 2001 From: Andy Kaylor Date: Fri, 22 Aug 2025 14:23:50 -0700 Subject: [PATCH 1/2] [CIR] Add verifier for vtable initializer This adds verifi

[clang] [CIR] Add verifier for vtable initializer (PR #155031)

2025-08-22 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor created https://github.com/llvm/llvm-project/pull/155031 This adds verification for the initializer, if present, of any global passed to the `cir.vtable.address_point` op. >From fd0bd309c13adba6966cfafbc884cb378e0212c4 Mon Sep 17 00:00:00 2001 From: Andy Kaylor D

[clang] [CIR][NFC] Fix build warning in getCIRSourceLanguage (PR #155029)

2025-08-22 Thread Andy Kaylor via cfe-commits
andykaylor wrote: @seven-mile This fixes a warning introduced in https://github.com/llvm/llvm-project/pull/152511 https://github.com/llvm/llvm-project/pull/155029 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/m

[clang] [CIR][NFC] Fix build warning in getCIRSourceLanguage (PR #155029)

2025-08-22 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor created https://github.com/llvm/llvm-project/pull/155029 The getCIRSourceLanguage wasn't returning a value if the source language was anything other than C or C++. This change updates that function to return a std::optional value and only adds the source language

[clang] [CIR] Add support for emitting multi-vtables (PR #155027)

2025-08-22 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor created https://github.com/llvm/llvm-project/pull/155027 This change adds support for emitting multiple tables in a global vtable object to handle the case of multiple-inheritence. >From 6d89819044ba3f2500af4dfa07f8f93bba00aeb9 Mon Sep 17 00:00:00 2001 From: Andy

[clang] [CIR] Upstream DivOp for ComplexType (PR #153796)

2025-08-22 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor approved this pull request. https://github.com/llvm/llvm-project/pull/153796 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream DivOp for ComplexType (PR #153796)

2025-08-22 Thread Andy Kaylor via cfe-commits
@@ -3013,6 +3013,47 @@ def CIR_ComplexMulOp : CIR_Op<"complex.mul", [ }]; } +def CIR_ComplexDivOp : CIR_Op<"complex.div", [ + Pure, SameOperandsAndResultType +]> { + let summary = "Complex division"; + let description = [{ +The `cir.complex.div` operation takes two co

[clang] [CIR] Add support for emitting vtables (PR #154808)

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

[clang] [CIR] Add support for emitting vtables (PR #154808)

2025-08-22 Thread Andy Kaylor via cfe-commits
@@ -33,13 +35,215 @@ mlir::Type CIRGenVTables::getVTableComponentType() { return cgm.getVTableComponentType(); } -mlir::Type CIRGenVTables::getVTableType(const VTableLayout &layout) { +cir::RecordType CIRGenVTables::getVTableType(const VTableLayout &layout) { SmallVector

[clang] [CIR] Add support for emitting vtables (PR #154808)

2025-08-22 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor updated https://github.com/llvm/llvm-project/pull/154808 >From bedcef440bc14e523d3145b7683ce8a5cdfe4661 Mon Sep 17 00:00:00 2001 From: Andy Kaylor Date: Thu, 31 Jul 2025 09:47:08 -0700 Subject: [PATCH 1/3] [CIR] Add support for emitting vtables This adds a simplif

[clang] [CIR][Dialect] Add SourceLangAttr (PR #152511)

2025-08-22 Thread Andy Kaylor via cfe-commits
@@ -495,6 +498,23 @@ void CIRGenModule::setNonAliasAttributes(GlobalDecl gd, mlir::Operation *op) { assert(!cir::MissingFeatures::setTargetAttributes()); } +cir::SourceLanguage CIRGenModule::getCIRSourceLanguage() const { + using ClangStd = clang::LangStandard; + using CI

[clang] [CIR] Upstream DivOp for ComplexType (PR #153796)

2025-08-22 Thread Andy Kaylor via cfe-commits
@@ -3013,6 +3013,47 @@ def CIR_ComplexMulOp : CIR_Op<"complex.mul", [ }]; } +def CIR_ComplexDivOp : CIR_Op<"complex.div", [ + Pure, SameOperandsAndResultType +]> { + let summary = "Complex division"; + let description = [{ +The `cir.complex.div` operation takes two co

[clang] [CIR] Upstream DivOp for ComplexType (PR #153796)

2025-08-22 Thread Andy Kaylor via cfe-commits
@@ -3013,6 +3014,47 @@ def CIR_ComplexMulOp : CIR_Op<"complex.mul", [ }]; } +def CIR_ComplexDivOp : CIR_Op<"complex.div", [ + Pure, SameOperandsAndResultType +]> { + let summary = "Complex division"; + let description = [{ +The `cir.complex.div` operation takes two co

[clang] [CIR] Upstream Re-Throw with no return (PR #154994)

2025-08-22 Thread Andy Kaylor via cfe-commits
@@ -405,17 +405,37 @@ void LoweringPreparePass::lowerArrayCtor(cir::ArrayCtor op) { true); } +void LoweringPreparePass::lowerThrowOp(ThrowOp op) { andykaylor wrote: Why does this happen here rather than in LowerToLLVM? https://g

[clang] [CIR] Upstream Re-Throw with no return (PR #154994)

2025-08-22 Thread Andy Kaylor via cfe-commits
@@ -2646,6 +2646,24 @@ ParseResult cir::InlineAsmOp::parse(OpAsmParser &parser, return mlir::success(); } +//===--===// +// ThrowOp +//===-

[clang] [CIR] Upstream Re-Throw with no return (PR #154994)

2025-08-22 Thread Andy Kaylor via cfe-commits
@@ -657,6 +657,11 @@ class ScalarExprEmitter : public StmtVisitor { return cgf.emitCXXNewExpr(e); } + mlir::Value VisitCXXThrowExpr(const CXXThrowExpr *e) { +cgf.emitCXXThrowExpr(e); +return nullptr; andykaylor wrote: ```suggestion return

[clang] [CIR] Upstream Re-Throw with no return (PR #154994)

2025-08-22 Thread Andy Kaylor via cfe-commits
@@ -289,6 +291,52 @@ void CIRGenItaniumCXXABI::emitDestructorCall( vttTy, nullptr); } +// The idea here is creating a separate block for the throw with an +// `UnreachableOp` as the terminator. So, we branch from the current block +// to the throw b

[clang] [CIR] Upstream Re-Throw with no return (PR #154994)

2025-08-22 Thread Andy Kaylor via cfe-commits
@@ -2646,6 +2646,24 @@ ParseResult cir::InlineAsmOp::parse(OpAsmParser &parser, return mlir::success(); } +//===--===// +// ThrowOp +//===-

[clang] [CIR] Upstream Re-Throw with no return (PR #154994)

2025-08-22 Thread Andy Kaylor via cfe-commits
@@ -3757,4 +3757,58 @@ def CIR_VAArgOp : CIR_Op<"va_arg"> { }]; } +//===--===// +// ThrowOp +//===--===// + +def CIR_ThrowOp : CIR_Op<"thro

  1   2   3   4   5   6   7   8   9   10   >