[clang] [CIR] Upstream CastOp and scalar conversions (PR #130690)

2025-03-11 Thread Morris Hafner via cfe-commits
@@ -36,6 +36,18 @@ class ScalarExprEmitter : public StmtVisitor { bool ira = false) : cgf(cgf), builder(builder), ignoreResultAssign(ira) {} + //======// + //

[clang] [CIR] Upstream CastOp and scalar conversions (PR #130690)

2025-03-12 Thread Morris Hafner via cfe-commits
https://github.com/mmha updated https://github.com/llvm/llvm-project/pull/130690 >From a945e21869e5276c66ac979acd893d9bd9afe2cc Mon Sep 17 00:00:00 2001 From: Morris Hafner Date: Mon, 10 Mar 2025 16:18:34 -0700 Subject: [PATCH 1/5] [CIR] Upstream CastOp and scalar conversions This patch upstrea

[clang] [CIR] Add binary operators (PR #132420)

2025-03-24 Thread Morris Hafner via cfe-commits
https://github.com/mmha updated https://github.com/llvm/llvm-project/pull/132420 >From 594005c964b5c1e6605dc8ac170f1b43aa018bea Mon Sep 17 00:00:00 2001 From: Morris Hafner Date: Fri, 21 Mar 2025 17:55:00 +0100 Subject: [PATCH 1/5] [CIR] Add binary operators This patch adds upstreams support fo

[clang] [CIR] Add binary operators (PR #132420)

2025-03-24 Thread Morris Hafner via cfe-commits
https://github.com/mmha updated https://github.com/llvm/llvm-project/pull/132420 >From 594005c964b5c1e6605dc8ac170f1b43aa018bea Mon Sep 17 00:00:00 2001 From: Morris Hafner Date: Fri, 21 Mar 2025 17:55:00 +0100 Subject: [PATCH 1/6] [CIR] Add binary operators This patch adds upstreams support fo

[clang] [CIR] Emit allocas into the proper lexical scope (PR #132468)

2025-03-24 Thread Morris Hafner via cfe-commits
https://github.com/mmha approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/132468 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Emit allocas into the proper lexical scope (PR #132468)

2025-03-24 Thread Morris Hafner via cfe-commits
@@ -44,3 +44,100 @@ void l0() { // OGCG: br label %[[FOR_COND:.*]] // OGCG: [[FOR_COND]]: // OGCG: br label %[[FOR_COND]] + +void l1() { + for (int i = 0; ; ) { + } +} + +// CIR: cir.func @l1 +// CIR-NEXT: cir.scope { +// CIR-NEXT: %[[I:.*]] = cir.alloca !s32i,

[clang] [CIR] Emit allocas into the proper lexical scope (PR #132468)

2025-03-24 Thread Morris Hafner via cfe-commits
@@ -293,7 +294,8 @@ void CIRGenFunction::startFunction(GlobalDecl gd, QualType returnType, mlir::Value addrVal = emitAlloca(cast(paramVar)->getName(), - convertType(paramVar->getType()), paramLoc, alignment); + convertType(param

[clang] [CIR] Emit allocas into the proper lexical scope (PR #132468)

2025-03-24 Thread Morris Hafner via cfe-commits
@@ -0,0 +1,81 @@ +//===--===// +// +// 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: Apac

[clang] [CIR] Emit allocas into the proper lexical scope (PR #132468)

2025-03-24 Thread Morris Hafner via cfe-commits
https://github.com/mmha edited https://github.com/llvm/llvm-project/pull/132468 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Add binary operators (PR #132420)

2025-03-24 Thread Morris Hafner via cfe-commits
https://github.com/mmha updated https://github.com/llvm/llvm-project/pull/132420 >From 594005c964b5c1e6605dc8ac170f1b43aa018bea Mon Sep 17 00:00:00 2001 From: Morris Hafner Date: Fri, 21 Mar 2025 17:55:00 +0100 Subject: [PATCH 1/2] [CIR] Add binary operators This patch adds upstreams support fo

[clang] [CIR] Add binary operators (PR #132420)

2025-03-24 Thread Morris Hafner via cfe-commits
https://github.com/mmha updated https://github.com/llvm/llvm-project/pull/132420 >From 594005c964b5c1e6605dc8ac170f1b43aa018bea Mon Sep 17 00:00:00 2001 From: Morris Hafner Date: Fri, 21 Mar 2025 17:55:00 +0100 Subject: [PATCH 1/3] [CIR] Add binary operators This patch adds upstreams support fo

[clang] [CIR] Add binary operators (PR #132420)

2025-03-24 Thread Morris Hafner via cfe-commits
https://github.com/mmha updated https://github.com/llvm/llvm-project/pull/132420 >From 594005c964b5c1e6605dc8ac170f1b43aa018bea Mon Sep 17 00:00:00 2001 From: Morris Hafner Date: Fri, 21 Mar 2025 17:55:00 +0100 Subject: [PATCH 1/4] [CIR] Add binary operators This patch adds upstreams support fo

[clang] [CIR] Emit allocas into the proper lexical scope (PR #132468)

2025-03-25 Thread Morris Hafner via cfe-commits
@@ -0,0 +1,81 @@ +//===--===// +// +// 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: Apac

[clang] [CIR] Upstream SelectOp and ShiftOp (PR #133405)

2025-03-28 Thread Morris Hafner via cfe-commits
https://github.com/mmha created https://github.com/llvm/llvm-project/pull/133405 Since SelectOp will only generated by a future pass that transforms a TernaryOp this only includes the lowering bits. This patch also improves the testing of the existing binary operators. >From fc549133df0092c9c2

[clang] [CIR] Upstream SelectOp and ShiftOp (PR #133405)

2025-03-28 Thread Morris Hafner via cfe-commits
mmha wrote: cc @andykaylor @erichkeane @dkolsen-pgi https://github.com/llvm/llvm-project/pull/133405 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Add binary operators (PR #132420)

2025-03-25 Thread Morris Hafner via cfe-commits
@@ -143,6 +147,114 @@ class CIRBaseBuilderTy : public mlir::OpBuilder { return createCast(loc, cir::CastKind::bitcast, src, newTy); } + mlir::Value createBinop(mlir::Value lhs, cir::BinOpKind kind, + const llvm::APInt &rhs) { +return create(

[clang] [CIR] Add binary operators (PR #132420)

2025-03-25 Thread Morris Hafner via cfe-commits
https://github.com/mmha edited https://github.com/llvm/llvm-project/pull/132420 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Add cir-simplify pass (PR #138317)

2025-05-07 Thread Morris Hafner via cfe-commits
https://github.com/mmha closed https://github.com/llvm/llvm-project/pull/138317 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Add cir-simplify pass (PR #138317)

2025-05-06 Thread Morris Hafner via cfe-commits
mmha wrote: @bcardosolopes Adding a test for C++ -> CIR depends on #138003 which adds lowering for `?:`, `&&` and `||`. Since this one's ready to be merged apart from your remark IMO I'd add that test in #138003 https://github.com/llvm/llvm-project/pull/138317 _

[clang] [CIR] Upstream lowering of conditional operators to TernaryOp (PR #138156)

2025-05-20 Thread Morris Hafner via cfe-commits
@@ -1658,6 +1828,170 @@ mlir::Value ScalarExprEmitter::VisitUnaryExprOrTypeTraitExpr( cgf.cgm.UInt64Ty, e->EvaluateKnownConstInt(cgf.getContext(; } +/// Return true if the specified expression is cheap enough and side-effect-free +/// enough to evaluate un

[clang] [CIR] Upstream lowering of conditional operators to TernaryOp (PR #138156)

2025-05-19 Thread Morris Hafner via cfe-commits
@@ -948,6 +950,165 @@ void CIRGenFunction::emitIgnoredExpr(const Expr *e) { emitLValue(e); } +// Handle the case where the condition is a constant evaluatable simple integer, +// which means we don't have to separately handle the true/false blocks. +static std::optional han

[clang] [CIR] Upstream lowering of conditional operators to TernaryOp (PR #138156)

2025-05-19 Thread Morris Hafner via cfe-commits
@@ -948,6 +950,165 @@ void CIRGenFunction::emitIgnoredExpr(const Expr *e) { emitLValue(e); } +// Handle the case where the condition is a constant evaluatable simple integer, +// which means we don't have to separately handle the true/false blocks. +static std::optional han

[clang] [CIR] Upstream lowering of conditional operators to TernaryOp (PR #138156)

2025-05-19 Thread Morris Hafner via cfe-commits
https://github.com/mmha edited https://github.com/llvm/llvm-project/pull/138156 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream lowering of conditional operators to TernaryOp (PR #138156)

2025-05-19 Thread Morris Hafner via cfe-commits
https://github.com/mmha edited https://github.com/llvm/llvm-project/pull/138156 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream lowering of conditional operators to TernaryOp (PR #138156)

2025-05-19 Thread Morris Hafner via cfe-commits
https://github.com/mmha edited https://github.com/llvm/llvm-project/pull/138156 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream lowering of conditional operators to TernaryOp (PR #138156)

2025-05-19 Thread Morris Hafner via cfe-commits
@@ -1658,6 +1828,170 @@ mlir::Value ScalarExprEmitter::VisitUnaryExprOrTypeTraitExpr( cgf.cgm.UInt64Ty, e->EvaluateKnownConstInt(cgf.getContext(; } +/// Return true if the specified expression is cheap enough and side-effect-free +/// enough to evaluate un

[clang] [CIR] Upstream lowering of conditional operators to TernaryOp (PR #138156)

2025-05-27 Thread Morris Hafner via cfe-commits
@@ -948,6 +950,165 @@ void CIRGenFunction::emitIgnoredExpr(const Expr *e) { emitLValue(e); } +// Handle the case where the condition is a constant evaluatable simple integer, +// which means we don't have to separately handle the true/false blocks. +static std::optional han

[clang] [CIR] Upstream lowering of conditional operators to TernaryOp (PR #138156)

2025-05-27 Thread Morris Hafner via cfe-commits
https://github.com/mmha edited https://github.com/llvm/llvm-project/pull/138156 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream lowering of conditional operators to TernaryOp (PR #138156)

2025-05-27 Thread Morris Hafner via cfe-commits
https://github.com/mmha updated https://github.com/llvm/llvm-project/pull/138156 >From 66cea1ef63965b27617a6b6995ac1c5f8d8b8ed6 Mon Sep 17 00:00:00 2001 From: Morris Hafner Date: Thu, 1 May 2025 17:27:23 +0200 Subject: [PATCH 1/4] [CIR] Upstream lowering of lvalue conditional operators to Terna

[clang] [CIR] Upstream lowering of conditional operators to TernaryOp (PR #138156)

2025-05-27 Thread Morris Hafner via cfe-commits
@@ -948,6 +950,165 @@ void CIRGenFunction::emitIgnoredExpr(const Expr *e) { emitLValue(e); } +// Handle the case where the condition is a constant evaluatable simple integer, +// which means we don't have to separately handle the true/false blocks. +static std::optional han

[clang] [CIR] Upstream lowering of conditional operators to TernaryOp (PR #138156)

2025-05-29 Thread Morris Hafner via cfe-commits
@@ -540,3 +540,171 @@ void long_shift_example(long long a, short b) { // OGCG: store i64 %[[SHL]], ptr %[[X]] // OGCG: ret void + +void b1(bool a, bool b) { + bool x = a && b; + x = x || b; +} + +// CIR-LABEL: cir.func @_Z2b1bb( +// CIR-SAME: %[[ARG0:.*]]: !c

[clang] [CIR] Upstream lowering of conditional operators to TernaryOp (PR #138156)

2025-06-03 Thread Morris Hafner via cfe-commits
https://github.com/mmha closed https://github.com/llvm/llvm-project/pull/138156 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Add Minimal Destructor Definition Support (PR #144719)

2025-06-18 Thread Morris Hafner via cfe-commits
https://github.com/mmha updated https://github.com/llvm/llvm-project/pull/144719 >From 278750574dd72831347bbba144bd49ded9daaa3c Mon Sep 17 00:00:00 2001 From: Morris Hafner Date: Wed, 18 Jun 2025 15:09:21 +0100 Subject: [PATCH 1/2] [CIR] Add Minimal Destructor Definition Support This patch upst

[clang] [CIR] Add Minimal Destructor Definition Support (PR #144719)

2025-06-18 Thread Morris Hafner via cfe-commits
https://github.com/mmha created https://github.com/llvm/llvm-project/pull/144719 This patch upstreams support for writing inline and out of line C++ destructor definitions. Calling a destructor implcitly or explicitly is left for a future patch. Because of that restriction complete destructors

[clang] [CIR] Handle global string literals as char array initializer (PR #144384)

2025-06-17 Thread Morris Hafner via cfe-commits
https://github.com/mmha approved this pull request. LGTM, just a request for three more test cases. I'm not sure if they work upstream already. If they don't, let's just skip over them for now. ```c++ char oversized[100] = "123"; char exact[4] = "123"; decltype(auto) returns_literal() { re

[clang] [CIR][NFCI] Represent Complex RValues As Single Value (PR #144519)

2025-06-17 Thread Morris Hafner via cfe-commits
https://github.com/mmha closed https://github.com/llvm/llvm-project/pull/144519 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream minimal builtin function call support (PR #142981)

2025-06-09 Thread Morris Hafner via cfe-commits
https://github.com/mmha updated https://github.com/llvm/llvm-project/pull/142981 >From 939ad27d0d0dacc5b796e36ca9bca32d26f6b714 Mon Sep 17 00:00:00 2001 From: Morris Hafner Date: Mon, 9 Jun 2025 14:52:55 +0200 Subject: [PATCH 1/4] [CIR] Upstream minimal builtin function call support This patch

[clang] [CIR] Fix missing return value warning in maybePromoteBoolResult (PR #142673)

2025-06-03 Thread Morris Hafner via cfe-commits
https://github.com/mmha created https://github.com/llvm/llvm-project/pull/142673 This is NFC and simply adds an llvm_unreachable >From 5e67287af5e55e3792e359812e539d8375d32f10 Mon Sep 17 00:00:00 2001 From: Morris Hafner Date: Tue, 3 Jun 2025 23:19:50 +0200 Subject: [PATCH] [CIR] Fix missing re

[clang] [CIR][NFS] Fix dead code return statement warning (PR #142591)

2025-06-03 Thread Morris Hafner via cfe-commits
https://github.com/mmha approved this pull request. LGTM (and thanks!) https://github.com/llvm/llvm-project/pull/142591 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Fix missing return value warning in maybePromoteBoolResult (PR #142673)

2025-06-04 Thread Morris Hafner via cfe-commits
https://github.com/mmha closed https://github.com/llvm/llvm-project/pull/142673 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Update RValue class to reflect changes in classic CodeGen (PR #142779)

2025-06-04 Thread Morris Hafner via cfe-commits
https://github.com/mmha created https://github.com/llvm/llvm-project/pull/142779 This changes clang::CIRGen::RValue to look like current clang::CodeGen::RValue which was changed in 84780a/[#86923](https://github.com/llvm/llvm-project/issues/86923). This should be NFC and is preliminary work fo

[clang] [CIR] Skip generation of a continue block when flattening TernaryOp (PR #142165)

2025-05-30 Thread Morris Hafner via cfe-commits
https://github.com/mmha created https://github.com/llvm/llvm-project/pull/142165 We used to insert a continue Block at the end of a flattened ternary op that only contained a branch to the remaing operation of the remaining Block. This patch removes that continue block and changes the true/fals

[clang] [CIR] Skip generation of a continue block when flattening TernaryOp (PR #142165)

2025-05-30 Thread Morris Hafner via cfe-commits
https://github.com/mmha updated https://github.com/llvm/llvm-project/pull/142165 >From f62994df24f912a3815cabb7fc4a47fa8c8c948e Mon Sep 17 00:00:00 2001 From: Morris Hafner Date: Fri, 30 May 2025 16:29:05 +0200 Subject: [PATCH 1/2] [CIR] Skip generation of a continue block when flattening Terna

[clang] [CIR][NFCI] Update RValue class to reflect changes in classic CodeGen (PR #142779)

2025-06-05 Thread Morris Hafner via cfe-commits
https://github.com/mmha closed https://github.com/llvm/llvm-project/pull/142779 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Add Support For Library Builtins (PR #143984)

2025-06-12 Thread Morris Hafner via cfe-commits
https://github.com/mmha created https://github.com/llvm/llvm-project/pull/143984 This patch upstreams support for builtins that map to a standard library function. Examples would be abort() and printf(). It also fixes a minor issue with the errorNYI for all remaining unimplemented builtins usi

[clang] [CIR] Add Support For Library Builtins (PR #143984)

2025-06-12 Thread Morris Hafner via cfe-commits
https://github.com/mmha updated https://github.com/llvm/llvm-project/pull/143984 >From c60378591a7d8d156306ff9c840aa319396c4f00 Mon Sep 17 00:00:00 2001 From: Morris Hafner Date: Fri, 13 Jun 2025 00:04:24 +0200 Subject: [PATCH 1/2] [CIR] Add Support For Library Builtins This patch upstreams sup

[clang] [CIR] Add Support For Library Builtins (PR #143984)

2025-06-12 Thread Morris Hafner via cfe-commits
https://github.com/mmha updated https://github.com/llvm/llvm-project/pull/143984 >From c60378591a7d8d156306ff9c840aa319396c4f00 Mon Sep 17 00:00:00 2001 From: Morris Hafner Date: Fri, 13 Jun 2025 00:04:24 +0200 Subject: [PATCH 1/3] [CIR] Add Support For Library Builtins This patch upstreams sup

[clang] [CIR] Add Support For Library Builtins (PR #143984)

2025-06-12 Thread Morris Hafner via cfe-commits
@@ -76,3 +76,21 @@ float constant_fp_builtin_single() { // OGCG: define {{.*}}float @_Z26constant_fp_builtin_singlev() // OGCG: ret float 0x3FB9A000 // OGCG: } + +void library_builtins() { + __builtin_printf(nullptr); mmha wrote: I added `builtin_prin

[clang] [CIR][NFC] Fix build problems with [[maybe_unused]] (PR #143994)

2025-06-12 Thread Morris Hafner via cfe-commits
https://github.com/mmha approved this pull request. This fixes the build on my machine with clang 19.1. Thanks! https://github.com/llvm/llvm-project/pull/143994 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mail

[clang] [CIR] Upstream minimal builtin function call support (PR #142981)

2025-06-11 Thread Morris Hafner via cfe-commits
https://github.com/mmha updated https://github.com/llvm/llvm-project/pull/142981 >From 1faee59aebae98bf01ecac07a7a5d70f2f9ca2db Mon Sep 17 00:00:00 2001 From: Morris Hafner Date: Mon, 9 Jun 2025 14:52:55 +0200 Subject: [PATCH 1/6] [CIR] Upstream minimal builtin function call support This patch

[clang] [CIR] Upstream minimal builtin function call support (PR #142981)

2025-06-11 Thread Morris Hafner via cfe-commits
@@ -229,6 +231,19 @@ class CIRGenBuilderTy : public cir::CIRBaseBuilderTy { cir::IntType getUInt32Ty() { return typeCache.UInt32Ty; } cir::IntType getUInt64Ty() { return typeCache.UInt64Ty; } + cir::ConstantOp getConstInt(mlir::Location loc, llvm::APSInt intVal); + + cir

[clang] [CIR] Upstream minimal builtin function call support (PR #142981)

2025-06-11 Thread Morris Hafner via cfe-commits
https://github.com/mmha closed https://github.com/llvm/llvm-project/pull/142981 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream minimal builtin function call support (PR #142981)

2025-06-10 Thread Morris Hafner via cfe-commits
https://github.com/mmha updated https://github.com/llvm/llvm-project/pull/142981 >From 1e759f0ec3b010e64c44cc4e5f87ffbe8f4e3d21 Mon Sep 17 00:00:00 2001 From: Morris Hafner Date: Mon, 9 Jun 2025 14:52:55 +0200 Subject: [PATCH 1/5] [CIR] Upstream minimal builtin function call support This patch

[clang] [CIR] Upstream minimal builtin function call support (PR #142981)

2025-06-10 Thread Morris Hafner via cfe-commits
@@ -0,0 +1,453 @@ +//===--===// +// +// 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] Add Minimal Destructor Definition Support (PR #144719)

2025-07-14 Thread Morris Hafner via cfe-commits
https://github.com/mmha closed https://github.com/llvm/llvm-project/pull/144719 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Add Minimal Destructor Definition Support (PR #144719)

2025-07-14 Thread Morris Hafner via cfe-commits
https://github.com/mmha updated https://github.com/llvm/llvm-project/pull/144719 >From 856aceca89e83604933756e30dfaa24021b604fc Mon Sep 17 00:00:00 2001 From: Morris Hafner Date: Wed, 18 Jun 2025 15:09:21 +0100 Subject: [PATCH 1/3] [CIR] Add Minimal Destructor Definition Support This patch upst

[clang] [CIR] Add Minimal Destructor Definition Support (PR #144719)

2025-07-14 Thread Morris Hafner via cfe-commits
https://github.com/mmha updated https://github.com/llvm/llvm-project/pull/144719 >From 856aceca89e83604933756e30dfaa24021b604fc Mon Sep 17 00:00:00 2001 From: Morris Hafner Date: Wed, 18 Jun 2025 15:09:21 +0100 Subject: [PATCH 1/3] [CIR] Add Minimal Destructor Definition Support This patch upst

[clang] [CIR] Add support for array constructors (PR #149142)

2025-07-16 Thread Morris Hafner via cfe-commits
https://github.com/mmha created https://github.com/llvm/llvm-project/pull/149142 This patch upstreams support for creating arrays of classes that require calling a constructor. * Adds the ArrayCtor operation * New lowering pass for lowering ArrayCtor to a loop >From 2a78522d151c3a970fccef94724

[clang] [CIR] Add support for array constructors (PR #149142)

2025-07-17 Thread Morris Hafner via cfe-commits
https://github.com/mmha updated https://github.com/llvm/llvm-project/pull/149142 >From 2a78522d151c3a970fccef94724a31fe14547f9d Mon Sep 17 00:00:00 2001 From: Morris Hafner Date: Wed, 16 Jul 2025 18:48:52 +0200 Subject: [PATCH 1/2] [CIR] Add support for array constructors This patch upstreams s

[clang] [CIR] Add support for array constructors (PR #149142)

2025-07-17 Thread Morris Hafner via cfe-commits
@@ -0,0 +1,70 @@ +// 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 -check-prefix=CIR +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -Wno-unused-value -fclangir -emit-llvm %s -o

[clang] [CIR] Add support for array constructors (PR #149142)

2025-07-17 Thread Morris Hafner via cfe-commits
https://github.com/mmha updated https://github.com/llvm/llvm-project/pull/149142 >From 2a78522d151c3a970fccef94724a31fe14547f9d Mon Sep 17 00:00:00 2001 From: Morris Hafner Date: Wed, 16 Jul 2025 18:48:52 +0200 Subject: [PATCH 1/4] [CIR] Add support for array constructors This patch upstreams s

[clang] [CIR] Add support for array constructors (PR #149142)

2025-07-17 Thread Morris Hafner via cfe-commits
@@ -22,15 +24,97 @@ struct LoweringPreparePass : public LoweringPrepareBase { void runOnOperation() override; void runOnOp(Operation *op); + void lowerArrayCtor(ArrayCtor op); }; } // namespace -void LoweringPreparePass::runOnOp(Operation *op) {} +void LoweringPrep

[clang] [CIR] Add support for array constructors (PR #149142)

2025-07-17 Thread Morris Hafner via cfe-commits
@@ -0,0 +1,70 @@ +// 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 -check-prefix=CIR +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -Wno-unused-value -fclangir -emit-llvm %s -o

<    1   2