[clang] [CIR] Add if statement support (PR #134333)

2025-04-04 Thread Andy Kaylor via cfe-commits
@@ -442,6 +457,25 @@ class CIRGenFunction : public CIRGenTypeCache { mlir::LogicalResult emitDeclStmt(const clang::DeclStmt &s); LValue emitDeclRefLValue(const clang::DeclRefExpr *e); + /// Emit an if on a boolean condition to the specified blocks. + /// FIXME: Based on

[clang] [CIR] Add if statement support (PR #134333)

2025-04-04 Thread Andy Kaylor via cfe-commits
@@ -316,6 +316,106 @@ void CIRGenFunction::emitIgnoredExpr(const Expr *e) { emitLValue(e); } +/// Emit an `if` on a boolean condition, filling `then` and `else` into +/// appropriated regions. +mlir::LogicalResult CIRGenFunction::emitIfOnBoolExpr(const Expr *cond, +

[clang] [CIR] Add if statement support (PR #134333)

2025-04-04 Thread Andy Kaylor via cfe-commits
@@ -263,6 +264,72 @@ static void terminateBody(CIRGenBuilderTy &builder, mlir::Region &r, b->erase(); } +mlir::LogicalResult CIRGenFunction::emitIfStmt(const IfStmt &s) { + mlir::LogicalResult res = mlir::success(); + // The else branch of a consteval if statement is al

[clang] [CIR] Add if statement support (PR #134333)

2025-04-04 Thread Andy Kaylor via cfe-commits
@@ -263,6 +264,72 @@ static void terminateBody(CIRGenBuilderTy &builder, mlir::Region &r, b->erase(); } +mlir::LogicalResult CIRGenFunction::emitIfStmt(const IfStmt &s) { + mlir::LogicalResult res = mlir::success(); + // The else branch of a consteval if statement is al

[clang] [CIR] Add if statement support (PR #134333)

2025-04-04 Thread Andy Kaylor via cfe-commits
@@ -316,6 +316,106 @@ void CIRGenFunction::emitIgnoredExpr(const Expr *e) { emitLValue(e); } +/// Emit an `if` on a boolean condition, filling `then` and `else` into +/// appropriated regions. +mlir::LogicalResult CIRGenFunction::emitIfOnBoolExpr(const Expr *cond, +

[clang] [CIR] Add if statement support (PR #134333)

2025-04-04 Thread Andy Kaylor via cfe-commits
@@ -316,6 +316,106 @@ void CIRGenFunction::emitIgnoredExpr(const Expr *e) { emitLValue(e); } +/// Emit an `if` on a boolean condition, filling `then` and `else` into +/// appropriated regions. +mlir::LogicalResult CIRGenFunction::emitIfOnBoolExpr(const Expr *cond, +

[clang] [CIR] Add if statement support (PR #134333)

2025-04-04 Thread Andy Kaylor via cfe-commits
@@ -316,6 +316,106 @@ void CIRGenFunction::emitIgnoredExpr(const Expr *e) { emitLValue(e); } +/// Emit an `if` on a boolean condition, filling `then` and `else` into +/// appropriated regions. +mlir::LogicalResult CIRGenFunction::emitIfOnBoolExpr(const Expr *cond, +

[clang] [CIR] Upstream support for break and continue statements (PR #134181)

2025-04-04 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor updated https://github.com/llvm/llvm-project/pull/134181 >From 54454e4d52570f29c493c41fc9bf95cbaf9e0886 Mon Sep 17 00:00:00 2001 From: Andy Kaylor Date: Fri, 21 Mar 2025 09:46:27 -0700 Subject: [PATCH 1/4] [CIR] Upstream support for break and continue statements T

[clang] [CIR] Upstream support for logical not operations (PR #133966)

2025-04-04 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor updated https://github.com/llvm/llvm-project/pull/133966 >From 4c71a107d174b24b4515554c4be57a2a318f5fb9 Mon Sep 17 00:00:00 2001 From: Andy Kaylor Date: Tue, 1 Apr 2025 11:47:49 -0700 Subject: [PATCH] [CIR] Upstream support for logical not operations When unary op

[clang] [CIR] Upstream support for cir.get_global (PR #135095)

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

[clang] [CIR] Upstream minimal support for structure types (PR #135105)

2025-04-10 Thread Andy Kaylor via cfe-commits
@@ -37,6 +50,32 @@ class CIRGenBuilderTy : public cir::CIRBaseBuilderTy { llvm_unreachable("Unsupported format for long double"); } + /// Get a CIR record kind from a AST declaration tag. + cir::StructType::RecordKind getRecordKind(const clang::TagTypeKind kind) { +

[clang] [CIR] Upstream support for cir.get_global (PR #135095)

2025-04-10 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor updated https://github.com/llvm/llvm-project/pull/135095 >From 43f2d5e73037559055dcbe65d8871c05c532d9f0 Mon Sep 17 00:00:00 2001 From: Andy Kaylor Date: Wed, 9 Apr 2025 14:25:35 -0700 Subject: [PATCH 1/2] [CIR] Upstream support for cir.get_global This adds basic s

[clang] [CIR] Upstream support for cir.get_global (PR #135095)

2025-04-10 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor updated https://github.com/llvm/llvm-project/pull/135095 >From dc3365a4f3154af3c748274edbf3968d4b9e2783 Mon Sep 17 00:00:00 2001 From: Andy Kaylor Date: Wed, 9 Apr 2025 14:25:35 -0700 Subject: [PATCH 1/2] [CIR] Upstream support for cir.get_global This adds basic s

[clang] [CIR] Upstream ArraySubscriptExpr for fixed size array (PR #134536)

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

[clang] [CIR] Upstream ArraySubscriptExpr for fixed size array (PR #134536)

2025-04-10 Thread Andy Kaylor via cfe-commits
@@ -1,141 +1,368 @@ -// RUN: %clang_cc1 -std=c++20 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir %s -o - 2>&1 | FileCheck %s +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -Wno-unused-value -fclangir -emit-cir %s -o %t.cir +// RUN: FileCheck --input-file=%t.cir %s -

[clang] [CIR] Upstream ArraySubscriptExpr for fixed size array (PR #134536)

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

[clang] [CIR] Add if statement support (PR #134333)

2025-04-10 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor commented: I have just a few minor requests. Otherwise, this looks good to me. https://github.com/llvm/llvm-project/pull/134333 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman

[clang] [CIR] cir.call with scalar return type (PR #135552)

2025-04-14 Thread Andy Kaylor via cfe-commits
@@ -0,0 +1,89 @@ +//==-- ABIArgInfo.h - Abstract info regarding ABI-specific arguments ---==// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang] [CIR] cir.call with scalar return type (PR #135552)

2025-04-14 Thread Andy Kaylor via cfe-commits
@@ -205,13 +205,15 @@ class CIRBaseBuilderTy : public mlir::OpBuilder { // Call operators //======// - cir::CallOp createCallOp(mlir::Location loc, mlir::SymbolRefAttr callee) { -auto op = create(loc

[clang] [CIR] Upstream minimal support for structure types (PR #135105)

2025-04-14 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor updated https://github.com/llvm/llvm-project/pull/135105 >From 3b19527073c656b631a990397a00030487b3f595 Mon Sep 17 00:00:00 2001 From: Andy Kaylor Date: Wed, 9 Apr 2025 12:45:57 -0700 Subject: [PATCH 1/8] [CIR] Upstream minimal support for structure types This cha

[clang] [CIR] Upstream ArraySubscriptExpr from function parameter with pointer base (PR #135493)

2025-04-14 Thread Andy Kaylor via cfe-commits
@@ -350,20 +350,87 @@ void func7() { // OGCG: %[[ARR:.*]] = alloca [1 x ptr], align 8 // OGCG: call void @llvm.memset.p0.i64(ptr align 8 %[[ARR]], i8 0, i64 8, i1 false) -void func8(int p[10]) {} -// CIR: cir.func @func8(%arg0: !cir.ptr -// CIR: cir.alloca !cir.ptr, !cir.ptr>

[clang] [CIR] Upstream ArraySubscriptExpr from function parameter with pointer base (PR #135493)

2025-04-14 Thread Andy Kaylor via cfe-commits
@@ -570,9 +570,17 @@ CIRGenFunction::emitArraySubscriptExpr(const clang::ArraySubscriptExpr *e) { } // The base must be a pointer; emit it with an estimate of its alignment. - cgm.errorNYI(e->getSourceRange(), - "emitArraySubscriptExpr: The base must be a p

[clang] [CIR] Upstream ArraySubscriptExpr from function parameter with pointer base (PR #135493)

2025-04-14 Thread Andy Kaylor via cfe-commits
@@ -570,9 +570,17 @@ CIRGenFunction::emitArraySubscriptExpr(const clang::ArraySubscriptExpr *e) { } // The base must be a pointer; emit it with an estimate of its alignment. - cgm.errorNYI(e->getSourceRange(), - "emitArraySubscriptExpr: The base must be a p

[clang] [CIR] Upstream minimal support for structure types (PR #135105)

2025-04-14 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor updated https://github.com/llvm/llvm-project/pull/135105 >From 3b19527073c656b631a990397a00030487b3f595 Mon Sep 17 00:00:00 2001 From: Andy Kaylor Date: Wed, 9 Apr 2025 12:45:57 -0700 Subject: [PATCH 1/7] [CIR] Upstream minimal support for structure types This cha

[clang] [CIR] Upstream minimal support for structure types (PR #135105)

2025-04-14 Thread Andy Kaylor via cfe-commits
@@ -67,6 +72,166 @@ void CIRDialect::printType(Type type, DialectAsmPrinter &os) const { llvm::report_fatal_error("printer is missing a handler for this type"); } +//===--===// +// RecordType Definitions +/

[clang] [clang][NFC] Refactor CodeGen's hasBooleanRepresentation (PR #134159)

2025-04-16 Thread Andy Kaylor via cfe-commits
andykaylor wrote: > Given that there are already similar functions in the `Type` class -- e.g. > `has{Signed,Unsigned,}IntegerRepresentation`, `hasFloatingRepresentation` -- > it seems a bit inconsistent the definition of `hasBooleanRepresentation`. I > would expect that "vector of booleans" t

[clang] [CIR] Upstream initial support for complete record types (PR #135844)

2025-04-16 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor updated https://github.com/llvm/llvm-project/pull/135844 >From 6ffd93ef63e068b73f451af0a05cc471d5cca9fb Mon Sep 17 00:00:00 2001 From: Andy Kaylor Date: Tue, 15 Apr 2025 12:08:37 -0700 Subject: [PATCH 1/4] [CIR] Upstream initial support for complete record types T

[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

[clang] [clang] Rework `hasBooleanRepresentation`. (PR #136038)

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

[clang] [clang] Rework `hasBooleanRepresentation`. (PR #136038)

2025-04-16 Thread Andy Kaylor via cfe-commits
@@ -2088,13 +2085,22 @@ llvm::Value *CodeGenFunction::EmitToMemory(llvm::Value *Value, QualType Ty) { Value = Builder.CreateBitCast(Value, StoreTy); } + if (Ty->hasBooleanRepresentation() || Ty->isBitIntType()) { andykaylor wrote: Is `isExtVectorBoolT

[clang] [clang] Rework `hasBooleanRepresentation`. (PR #136038)

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

[clang] [CIR] Upstream initial support for complete record types (PR #135844)

2025-04-15 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor created https://github.com/llvm/llvm-project/pull/135844 This adds basic support for populating record types. In order to keep the change small, everything non-essential was deferred to a later change set. Only non-recursive structures are handled. Structures padd

[clang] [CIR] cir.call with scalar return type (PR #135552)

2025-04-15 Thread Andy Kaylor via cfe-commits
@@ -0,0 +1,89 @@ +//==-- ABIArgInfo.h - Abstract info regarding ABI-specific arguments ---==// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang] [CIR][NFC] Upstream LValueBaseInfo handling (PR #134928)

2025-04-10 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor created https://github.com/llvm/llvm-project/pull/134928 Previous implementations that used the cir::LValue class omitted hanling of the LValueBaseInfo class, which tracks information about the basis for the LValue's alignment. As more code was upstreamed from the

[clang] [CIR] Handle NullStmt (PR #134889)

2025-04-10 Thread Andy Kaylor via cfe-commits
@@ -90,3 +90,18 @@ int f3(void) { // OGCG-NEXT: store i32 3, ptr %[[I_PTR]], align 4 // OGCG-NEXT: %[[I:.*]] = load i32, ptr %[[I_PTR]], align 4 // OGCG-NEXT: ret i32 %[[I]] + +// Verify null statement handling. +void f4(void) { + ; andykaylor wrote: Th

[clang] [CIR] Upstream ArraySubscriptExpr for fixed size array (PR #134536)

2025-04-10 Thread Andy Kaylor via cfe-commits
@@ -232,6 +233,152 @@ LValue CIRGenFunction::emitUnaryOpLValue(const UnaryOperator *e) { llvm_unreachable("Unknown unary operator kind!"); } +/// If the specified expr is a simple decay from an array to pointer, +/// return the array subexpression. +/// FIXME: this could be

[clang] [CIR] Upstream ArraySubscriptExpr for fixed size array (PR #134536)

2025-04-10 Thread Andy Kaylor via cfe-commits
@@ -232,6 +233,161 @@ LValue CIRGenFunction::emitUnaryOpLValue(const UnaryOperator *e) { llvm_unreachable("Unknown unary operator kind!"); } +/// If the specified expr is a simple decay from an array to pointer, +/// return the array subexpression. +/// FIXME: this could be

[clang] [CIR] Upstream minimal support for structure types (PR #135105)

2025-04-10 Thread Andy Kaylor via cfe-commits
@@ -400,13 +400,126 @@ def VoidPtr : Type< "cir::VoidType::get($_builder.getContext()))"> { } +//===--===// +// StructType +// +// The base type for all RecordDecls. +//===---

[clang] [CIR] Upstream binary assignments and comma (PR #135115)

2025-04-10 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor approved this pull request. This looks good to me. I have a few comments, but nothing that needs to be changed immediately. https://github.com/llvm/llvm-project/pull/135115 ___ cfe-commits mailing list cfe-commits@lists.l

[clang] [CIR] Upstream binary assignments and comma (PR #135115)

2025-04-10 Thread Andy Kaylor via cfe-commits
@@ -807,6 +808,65 @@ class ScalarExprEmitter : public StmtVisitor { VISITCOMP(EQ) VISITCOMP(NE) #undef VISITCOMP + + mlir::Value VisitBinAssign(const BinaryOperator *e) { +const bool ignore = std::exchange(ignoreResultAssign, false); + +mlir::Value rhs; +LValu

[clang] [CIR] Upstream binary assignments and comma (PR #135115)

2025-04-10 Thread Andy Kaylor via cfe-commits
@@ -807,6 +808,65 @@ class ScalarExprEmitter : public StmtVisitor { VISITCOMP(EQ) VISITCOMP(NE) #undef VISITCOMP + + mlir::Value VisitBinAssign(const BinaryOperator *e) { +const bool ignore = std::exchange(ignoreResultAssign, false); + +mlir::Value rhs; +LValu

[clang] [CIR] Upstream binary assignments and comma (PR #135115)

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

[clang] [CIR] Upstream binary assignments and comma (PR #135115)

2025-04-10 Thread Andy Kaylor via cfe-commits
@@ -219,6 +219,13 @@ void CIRGenFunction::emitStoreOfScalar(mlir::Value value, Address addr, assert(!cir::MissingFeatures::opTBAA()); } +void CIRGenFunction::emitStoreThroughBitfieldLValue(RValue src, LValue dst, +mlir::Va

[clang] [CIR] Upstream binary assignments and comma (PR #135115)

2025-04-10 Thread Andy Kaylor via cfe-commits
@@ -572,6 +575,11 @@ class CIRGenFunction : public CIRGenTypeCache { mlir::LogicalResult emitWhileStmt(const clang::WhileStmt &s); + /// Given an assignment `*lhs = rhs`, emit a test that checks if \p rhs is + /// nonnull, if 1\p LHS is marked _Nonnull. + void emitNullab

[clang] [CIR] Upstream ArraySubscriptExpr from function parameter with pointer base (PR #135493)

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

[clang] [CIR] Upstream ArraySubscriptExpr from function parameter with pointer base (PR #135493)

2025-04-15 Thread Andy Kaylor via cfe-commits
@@ -350,20 +350,87 @@ void func7() { // OGCG: %[[ARR:.*]] = alloca [1 x ptr], align 8 // OGCG: call void @llvm.memset.p0.i64(ptr align 8 %[[ARR]], i8 0, i64 8, i1 false) -void func8(int p[10]) {} -// CIR: cir.func @func8(%arg0: !cir.ptr -// CIR: cir.alloca !cir.ptr, !cir.ptr>

[clang] [CIR] cir.call with scalar return type (PR #135552)

2025-04-15 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor approved this pull request. Looks good to me if Erich is satisfied. https://github.com/llvm/llvm-project/pull/135552 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/c

[clang] [CIR] Upstream initial support for complete record types (PR #135844)

2025-04-15 Thread Andy Kaylor via cfe-commits
@@ -0,0 +1,212 @@ +//===--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang] [CIR] Upstream initial support for complete record types (PR #135844)

2025-04-15 Thread Andy Kaylor via cfe-commits
@@ -0,0 +1,212 @@ +//===--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang] [CIR] Upstream initial support for complete record types (PR #135844)

2025-04-15 Thread Andy Kaylor via cfe-commits
@@ -0,0 +1,212 @@ +//===--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang] [CIR] Upstream initial support for complete record types (PR #135844)

2025-04-15 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor updated https://github.com/llvm/llvm-project/pull/135844 >From 6ffd93ef63e068b73f451af0a05cc471d5cca9fb Mon Sep 17 00:00:00 2001 From: Andy Kaylor Date: Tue, 15 Apr 2025 12:08:37 -0700 Subject: [PATCH 1/2] [CIR] Upstream initial support for complete record types T

[clang] [OpenACC][CIR] Implement 'self' lowering on compute constructs (PR #135851)

2025-04-15 Thread Andy Kaylor via cfe-commits
@@ -32,46 +32,52 @@ constexpr bool isOneOfTypes = template constexpr bool isOneOfTypes = std::is_same_v; +template class OpenACCClauseCIREmitter final -: public OpenACCClauseVisitor { - CIRGenModule &cgm; +: public OpenACCClauseVisitor> { + OpTy &operation; + CIR

[clang] [OpenACC][CIR] Implement 'self' lowering on compute constructs (PR #135851)

2025-04-15 Thread Andy Kaylor via cfe-commits
@@ -32,46 +32,52 @@ constexpr bool isOneOfTypes = template constexpr bool isOneOfTypes = std::is_same_v; +template class OpenACCClauseCIREmitter final -: public OpenACCClauseVisitor { - CIRGenModule &cgm; +: public OpenACCClauseVisitor> { + OpTy &operation; + CIR

[clang] [OpenACC][CIR] Implement 'self' lowering on compute constructs (PR #135851)

2025-04-15 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor approved this pull request. lgtm -- just a couple of very minor suggestions https://github.com/llvm/llvm-project/pull/135851 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/li

[clang] [OpenACC][CIR] Implement 'self' lowering on compute constructs (PR #135851)

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

[clang] [CIR] Upstream initial support for complete record types (PR #135844)

2025-04-15 Thread Andy Kaylor via cfe-commits
andykaylor wrote: > Still OK, see the request on line 46 of CIRGenRecordLayoutBuilder.cpp for the > comment request previously mentioned. Thanks. I missed that somehow. https://github.com/llvm/llvm-project/pull/135844 ___ cfe-commits mailing list cfe

[clang] [CIR] cir.call with scalar return type (PR #135552)

2025-04-15 Thread Andy Kaylor via cfe-commits
@@ -18,9 +18,12 @@ using namespace clang; using namespace clang::CIRGen; -CIRGenFunctionInfo *CIRGenFunctionInfo::create() { - // For now we just create an empty CIRGenFunctionInfo. - CIRGenFunctionInfo *fi = new CIRGenFunctionInfo(); +CIRGenFunctionInfo *CIRGenFunctionInfo:

[clang] [CIR] cir.call with scalar return type (PR #135552)

2025-04-15 Thread Andy Kaylor via cfe-commits
@@ -18,9 +18,12 @@ using namespace clang; using namespace clang::CIRGen; -CIRGenFunctionInfo *CIRGenFunctionInfo::create() { - // For now we just create an empty CIRGenFunctionInfo. - CIRGenFunctionInfo *fi = new CIRGenFunctionInfo(); +CIRGenFunctionInfo *CIRGenFunctionInfo:

[clang] [CIR] Upstream initial support for complete record types (PR #135844)

2025-04-15 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor updated https://github.com/llvm/llvm-project/pull/135844 >From 6ffd93ef63e068b73f451af0a05cc471d5cca9fb Mon Sep 17 00:00:00 2001 From: Andy Kaylor Date: Tue, 15 Apr 2025 12:08:37 -0700 Subject: [PATCH 1/3] [CIR] Upstream initial support for complete record types T

[clang] [CIR] Upstream initial support for complete record types (PR #135844)

2025-04-15 Thread Andy Kaylor via cfe-commits
@@ -126,6 +130,12 @@ void CIRRecordLowering::lower() { return; } + if (isa(recordDecl)) { +cirGenTypes.getCGModule().errorNYI(recordDecl->getSourceRange(), andykaylor wrote: Eventually, yes. We aren't handling CXXRecordDecl in the code that gets he

[clang] [CIR] Upstream initial support for complete record types (PR #135844)

2025-04-15 Thread Andy Kaylor via cfe-commits
andykaylor wrote: > still 1 comment request, else LGTM. Comment request? Am I still missing something? https://github.com/llvm/llvm-project/pull/135844 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/list

[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,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 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 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
@@ -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] [clang] Rework `hasBooleanRepresentation`. (PR #136038)

2025-04-17 Thread Andy Kaylor via cfe-commits
@@ -2336,16 +2336,9 @@ bool Type::isArithmeticType() const { } bool Type::hasBooleanRepresentation() const { - if (isBooleanType()) -return true; - - if (const EnumType *ET = getAs()) -return ET->getDecl()->getIntegerType()->isBooleanType(); - - if (const AtomicType

[clang] [CIR] cir.call with scalar return type (PR #135552)

2025-04-14 Thread Andy Kaylor via cfe-commits
@@ -0,0 +1,89 @@ +//==-- ABIArgInfo.h - Abstract info regarding ABI-specific arguments ---==// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang] [CIR] Upstream minimal support for structure types (PR #135105)

2025-04-14 Thread Andy Kaylor via cfe-commits
andykaylor wrote: @erichkeane Are you happy with this in its current state? I will make changes to change the polarity of complete/incomplete and to merge RecordKind::class and RecordKind::struct in the incubator and then merge them upstream if no issues are found. https://github.com/llvm/llv

[clang] [CIR] Upstream minimal support for structure types (PR #135105)

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

[clang] [CIR] Initial implementation of lowering CIR to MLIR (PR #127835)

2025-04-17 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor converted_to_draft https://github.com/llvm/llvm-project/pull/127835 ___ 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 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] Initial implementation of lowering CIR to MLIR (PR #127835)

2025-04-17 Thread Andy Kaylor via cfe-commits
andykaylor wrote: I marked this as "draft" to indicate that we don't intend to merge it at this time. https://github.com/llvm/llvm-project/pull/127835 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listi

[clang] [CIR] Introduce type aliases for records (PR #136387)

2025-04-18 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor created https://github.com/llvm/llvm-project/pull/136387 This introduces MLIR aliases for ClangIR record types. These are used in the incubator and having skipped over them upstream is causing the tests to diverge. >From a8543dc4fd59e2bb3891e93afe2aff46b8cbe698 Mo

[clang] [CIR] Infer MLIR context in type builders when possible (PR #136362)

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

[clang] [CIR] Upstream initial support for complete record types (PR #135844)

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

[clang] [CIR] Upstream support for typedef and type aliases (PR #136335)

2025-04-18 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor created https://github.com/llvm/llvm-project/pull/136335 Nothing is actually needed in ClangIR to support typedef and type aliases, but the Decl kinds need to be explicitly ignored in the emitDecl handlers to avoid hitting the default NYI errors. This change does

[clang] [CIR] Upstream limited support for nested structures (PR #136331)

2025-04-18 Thread Andy Kaylor via cfe-commits
@@ -116,16 +116,93 @@ std::string CIRGenTypes::getRecordTypeName(const clang::RecordDecl *recordDecl, return builder.getUniqueRecordName(std::string(typeName)); } +/// Return true if the specified type is already completely laid out. +bool CIRGenTypes::isRecordLayoutComplet

[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][NFC] Simplify BoolAttr builders (PR #136366)

2025-04-18 Thread Andy Kaylor via cfe-commits
@@ -456,9 +456,7 @@ mlir::LogicalResult CIRGenFunction::emitForStmt(const ForStmt &s) { // scalar type. condVal = evaluateExprAsBool(s.getCond()); } else { -cir::BoolType boolTy = cir::BoolType::get(b.getContext()); -co

[clang] [CIR][NFC] Simplify BoolAttr builders (PR #136366)

2025-04-18 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor approved this pull request. This looks good. Thanks for the improvements! I just have a couple of questions. https://github.com/llvm/llvm-project/pull/136366 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://

[clang] [CIR][NFC] Simplify BoolAttr builders (PR #136366)

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

[clang] [CIR][NFC] Simplify BoolAttr builders (PR #136366)

2025-04-18 Thread Andy Kaylor via cfe-commits
@@ -692,9 +692,7 @@ mlir::LogicalResult CIRToLLVMConstantOpLowering::matchAndRewrite( // during a pass as long as they don't live past the end of the pass. attr = op.getValue(); } else if (mlir::isa(op.getType())) { -int value = (op.getValue() == -

[clang] [CIR] Upstream support for accessing structure members (PR #136383)

2025-04-18 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor created https://github.com/llvm/llvm-project/pull/136383 This adds ClangIR support for accessing structure members. Access to union members is deferred to a later change. >From 17800eddb70a74cf3966d64ab7bc5ad5508f8bb0 Mon Sep 17 00:00:00 2001 From: Andy Kaylor Da

[clang] [CIR] Upstream support for accessing structure members (PR #136383)

2025-04-22 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor updated https://github.com/llvm/llvm-project/pull/136383 >From 5f83632c07d59df162d79e73d361bea1aa64e117 Mon Sep 17 00:00:00 2001 From: Andy Kaylor Date: Fri, 18 Apr 2025 15:02:22 -0700 Subject: [PATCH 1/3] [CIR] Upstream support for accessing structure members Thi

[clang] [CIR] Infer MLIRContext in attr builders when possible (PR #136741)

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

[clang] [CIR] Upstream scalar support for ParenExpr (PR #136332)

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

[clang] [CIR] Upstream limited support for nested structures (PR #136331)

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

[clang] [CIR] Upstream support for typedef and type aliases (PR #136335)

2025-04-18 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor updated https://github.com/llvm/llvm-project/pull/136335 >From 10d4b413f0fcc1eb9ea4901b575d853d3838b761 Mon Sep 17 00:00:00 2001 From: Andy Kaylor Date: Tue, 15 Apr 2025 16:07:31 -0700 Subject: [PATCH] [CIR] Upstream support for typedef and type aliases Nothing is

[clang] [CIR] Upstream support for typedef and type aliases (PR #136335)

2025-04-18 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor closed https://github.com/llvm/llvm-project/pull/136335 ___ 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
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 limited support for nested structures (PR #136331)

2025-04-18 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor created https://github.com/llvm/llvm-project/pull/136331 Previously when we checked to see if it was safe to create CIR for a structure type, we were conservatively saying no if any structure was in the process of being converted. That prevented handling nested st

[clang] [CIR] Upstream scalar support for ParenExpr (PR #136332)

2025-04-18 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor created https://github.com/llvm/llvm-project/pull/136332 This change adds support for handling ParenExpr in scalar expressions. A few more places will need to be updated after structure assignment and complex type support is in place. >From 15a892df17d7d2fcd32322

[clang] [CIR] Make ZeroAttr use AttrBuilderWithInferredContext (PR #136604)

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

[clang] [CIR] Upstream support for accessing structure members (PR #136383)

2025-04-21 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor updated https://github.com/llvm/llvm-project/pull/136383 >From 17800eddb70a74cf3966d64ab7bc5ad5508f8bb0 Mon Sep 17 00:00:00 2001 From: Andy Kaylor Date: Fri, 18 Apr 2025 15:02:22 -0700 Subject: [PATCH 1/2] [CIR] Upstream support for accessing structure members Thi

[clang] [CIR] Upstream support for accessing structure members (PR #136383)

2025-04-21 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor updated https://github.com/llvm/llvm-project/pull/136383 >From 17800eddb70a74cf3966d64ab7bc5ad5508f8bb0 Mon Sep 17 00:00:00 2001 From: Andy Kaylor Date: Fri, 18 Apr 2025 15:02:22 -0700 Subject: [PATCH 1/3] [CIR] Upstream support for accessing structure members Thi

[clang] [OpenACC][CIR] Lower 'num_workers' for parallel/kernels (PR #136578)

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

[clang] [OpenACC][CIR] Lower 'num_workers' for parallel/kernels (PR #136578)

2025-04-21 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor approved this pull request. This looks good. I had one question about something that made me nervous but is probably OK, and a nit that isn't really related to this PR. https://github.com/llvm/llvm-project/pull/136578 ___

<    3   4   5   6   7   8   9   10   11   >