[clang] [CIR] Upstream global initialization for ArrayType (PR #131657)

2025-03-18 Thread Amr Hesham via cfe-commits
https://github.com/AmrDeveloper updated https://github.com/llvm/llvm-project/pull/131657 >From 4ae9c422e786f843f5f019a5d9e55232ec6c8694 Mon Sep 17 00:00:00 2001 From: AmrDeveloper Date: Fri, 14 Mar 2025 21:46:57 +0100 Subject: [PATCH 1/3] [CIR] Upstream global initialization for ArrayType ---

[clang] [CIR] Upstream global initialization for ArrayType (PR #131657)

2025-03-18 Thread Amr Hesham via cfe-commits
AmrDeveloper wrote: @andykaylor All comments addressed except two points related to NYI https://github.com/llvm/llvm-project/pull/131657 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Follow up for addressing style comment (PR #132093)

2025-03-20 Thread Amr Hesham via cfe-commits
https://github.com/AmrDeveloper closed https://github.com/llvm/llvm-project/pull/132093 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream global initialization for ArrayType (PR #131657)

2025-03-19 Thread Amr Hesham via cfe-commits
https://github.com/AmrDeveloper updated https://github.com/llvm/llvm-project/pull/131657 >From 4ae9c422e786f843f5f019a5d9e55232ec6c8694 Mon Sep 17 00:00:00 2001 From: AmrDeveloper Date: Fri, 14 Mar 2025 21:46:57 +0100 Subject: [PATCH 1/4] [CIR] Upstream global initialization for ArrayType ---

[clang] [CIR] Upstream global initialization for ArrayType (PR #131657)

2025-03-19 Thread Amr Hesham via cfe-commits
@@ -45,6 +45,41 @@ class CIRGenBuilderTy : public cir::CIRBaseBuilderTy { return false; } + // Return true if this is the null value AmrDeveloper wrote: That's right, I updated the comment to describe the implemented cases https://github.com/llvm/llvm

[clang] [CIR] Upstream global initialization for ArrayType (PR #131657)

2025-03-19 Thread Amr Hesham via cfe-commits
AmrDeveloper wrote: > If you just set commonElementType to {} as is done in the incubator, this > will eventually reach the NYI state in emitConstantArray and this code won't > need to be updated later. @andykaylor Yes, this is a better approach, I updated the code Thanks https://github.com/

[clang] [CIR] Upstream global initialization for ArrayType (PR #131657)

2025-03-19 Thread Amr Hesham via cfe-commits
@@ -228,6 +257,42 @@ mlir::Value CIRAttrToValue::visitCirAttr(cir::FPAttr fltAttr) { loc, converter->convertType(fltAttr.getType()), fltAttr.getValue()); } +// ConstArrayAttr visitor +mlir::Value CIRAttrToValue::visitCirAttr(cir::ConstArrayAttr attr) { + mlir::Type llv

[clang] [CIR] Upstream global initialization for ArrayType (PR #131657)

2025-03-18 Thread Amr Hesham via cfe-commits
@@ -290,9 +378,23 @@ mlir::Attribute ConstantEmitter::tryEmitPrivate(const APValue &value, cgm.errorNYI("ConstExprEmitter::tryEmitPrivate member pointer"); return {}; } - case APValue::LValue: -cgm.errorNYI("ConstExprEmitter::tryEmitPrivate lvalue"); + case APV

[clang] [CIR] Upstream global initialization for ArrayType (PR #131657)

2025-03-19 Thread Amr Hesham via cfe-commits
https://github.com/AmrDeveloper closed https://github.com/llvm/llvm-project/pull/131657 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Follow up for addressing style comment (PR #132093)

2025-03-19 Thread Amr Hesham via cfe-commits
https://github.com/AmrDeveloper created https://github.com/llvm/llvm-project/pull/132093 Follow up PR to address style comment (https://github.com/llvm/llvm-project/pull/131657#discussion_r2004197917) >From 04499c516d36a84a632e58e64a9800af1bdfbc4c Mon Sep 17 00:00:00 2001 From: AmrDeveloper D

[clang] [CIR] Upstream zero init for global variables (PR #133100)

2025-03-31 Thread Amr Hesham via cfe-commits
https://github.com/AmrDeveloper closed https://github.com/llvm/llvm-project/pull/133100 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR][Upstream] Local initialization for ArrayType (PR #132974)

2025-03-31 Thread Amr Hesham via cfe-commits
https://github.com/AmrDeveloper updated https://github.com/llvm/llvm-project/pull/132974 >From 4dc1e77299c71b8f01fb73f7fba5f14e0fbe3edd Mon Sep 17 00:00:00 2001 From: AmrDeveloper Date: Fri, 21 Mar 2025 21:07:11 +0100 Subject: [PATCH 1/7] [CIR] [Upstream local initialization for ArrayType ---

[clang] [CIR][Upstream] Local initialization for ArrayType (PR #132974)

2025-04-04 Thread Amr Hesham via cfe-commits
https://github.com/AmrDeveloper updated https://github.com/llvm/llvm-project/pull/132974 >From 4dc1e77299c71b8f01fb73f7fba5f14e0fbe3edd Mon Sep 17 00:00:00 2001 From: AmrDeveloper Date: Fri, 21 Mar 2025 21:07:11 +0100 Subject: [PATCH 01/10] [CIR] [Upstream local initialization for ArrayType --

[clang] [CIR][Upstream] Local initialization for ArrayType (PR #132974)

2025-04-03 Thread Amr Hesham via cfe-commits
https://github.com/AmrDeveloper closed https://github.com/llvm/llvm-project/pull/132974 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR][Upstream] Local initialization for ArrayType (PR #132974)

2025-04-03 Thread Amr Hesham via cfe-commits
@@ -110,6 +110,8 @@ class CIRGenFunction : public CIRGenTypeCache { public: mlir::Value createDummyValue(mlir::Location loc, clang::QualType qt); + void emitNullInitialization(mlir::Location loc, Address destPtr, QualType ty); AmrDeveloper wrote: Thank yo

[clang] [CIR] Upstream zero init for global variables (PR #133100)

2025-03-27 Thread Amr Hesham via cfe-commits
https://github.com/AmrDeveloper updated https://github.com/llvm/llvm-project/pull/133100 >From b4aafe8bdb2754597d440e256c33b9f8b9a92a91 Mon Sep 17 00:00:00 2001 From: AmrDeveloper Date: Wed, 26 Mar 2025 05:52:17 -0700 Subject: [PATCH 1/2] [CIR] Upstream zero init for global variables --- .../

[clang] [CIR] [Upstream local initialization for ArrayType (PR #132974)

2025-03-27 Thread Amr Hesham via cfe-commits
https://github.com/AmrDeveloper updated https://github.com/llvm/llvm-project/pull/132974 >From 4dc1e77299c71b8f01fb73f7fba5f14e0fbe3edd Mon Sep 17 00:00:00 2001 From: AmrDeveloper Date: Fri, 21 Mar 2025 21:07:11 +0100 Subject: [PATCH 1/6] [CIR] [Upstream local initialization for ArrayType ---

[clang] [CIR] [Upstream local initialization for ArrayType (PR #132974)

2025-03-27 Thread Amr Hesham via cfe-commits
https://github.com/AmrDeveloper updated https://github.com/llvm/llvm-project/pull/132974 >From 4dc1e77299c71b8f01fb73f7fba5f14e0fbe3edd Mon Sep 17 00:00:00 2001 From: AmrDeveloper Date: Fri, 21 Mar 2025 21:07:11 +0100 Subject: [PATCH 1/6] [CIR] [Upstream local initialization for ArrayType ---

[clang] [CIR][Upstream] Local initialization for ArrayType (PR #132974)

2025-04-04 Thread Amr Hesham via cfe-commits
https://github.com/AmrDeveloper updated https://github.com/llvm/llvm-project/pull/132974 >From 4dc1e77299c71b8f01fb73f7fba5f14e0fbe3edd Mon Sep 17 00:00:00 2001 From: AmrDeveloper Date: Fri, 21 Mar 2025 21:07:11 +0100 Subject: [PATCH 1/8] [CIR] [Upstream local initialization for ArrayType ---

[clang] [CIR] [Upstream local initialization for ArrayType (PR #132974)

2025-03-25 Thread Amr Hesham via cfe-commits
https://github.com/AmrDeveloper created https://github.com/llvm/llvm-project/pull/132974 This change adds local initialization for ArrayType Issue #130197 >From 4dc1e77299c71b8f01fb73f7fba5f14e0fbe3edd Mon Sep 17 00:00:00 2001 From: AmrDeveloper Date: Fri, 21 Mar 2025 21:07:11 +0100 Subject:

[clang] [CIR] Upstream zero init for global variables (PR #133100)

2025-03-26 Thread Amr Hesham via cfe-commits
@@ -67,6 +67,40 @@ class CIRBaseBuilderTy : public mlir::OpBuilder { return create(loc, attr.getType(), attr); } + mlir::TypedAttr getConstNullPtrAttr(mlir::Type t) { +assert(mlir::isa(t) && "expected cir.ptr"); +return getConstPtrAttr(t, 0); + } + + mlir::Typ

[clang] [CIR] Upstream zero init for global variables (PR #133100)

2025-03-26 Thread Amr Hesham via cfe-commits
https://github.com/AmrDeveloper updated https://github.com/llvm/llvm-project/pull/133100 >From b4aafe8bdb2754597d440e256c33b9f8b9a92a91 Mon Sep 17 00:00:00 2001 From: AmrDeveloper Date: Wed, 26 Mar 2025 05:52:17 -0700 Subject: [PATCH] [CIR] Upstream zero init for global variables --- .../CIR/

[clang] [CIR] Upstream zero init for global variables (PR #133100)

2025-03-26 Thread Amr Hesham via cfe-commits
https://github.com/AmrDeveloper created https://github.com/llvm/llvm-project/pull/133100 This change adds zero initialization for global variables >From 999b8e47c0a8506a983d7d3ac5ce1b82b41966b0 Mon Sep 17 00:00:00 2001 From: JaydeepChauhan14 Date: Wed, 26 Mar 2025 05:52:17 -0700 Subject: [PATC

[clang] [CIR] [Upstream local initialization for ArrayType (PR #132974)

2025-03-26 Thread Amr Hesham via cfe-commits
AmrDeveloper wrote: > I'm not suggesting errorNYI. I'm suggesting op.emitError(). We can't do that > here either, but maybe we could do it in the function from which this is > called? I think it's easier to keep it as assert, llvm_unreachable or a missing features as the error message mention

[clang] [CIR] [Upstream local initialization for ArrayType (PR #132974)

2025-03-26 Thread Amr Hesham via cfe-commits
https://github.com/AmrDeveloper updated https://github.com/llvm/llvm-project/pull/132974 >From 4dc1e77299c71b8f01fb73f7fba5f14e0fbe3edd Mon Sep 17 00:00:00 2001 From: AmrDeveloper Date: Fri, 21 Mar 2025 21:07:11 +0100 Subject: [PATCH 1/5] [CIR] [Upstream local initialization for ArrayType ---

[clang] [CIR] [Upstream local initialization for ArrayType (PR #132974)

2025-03-26 Thread Amr Hesham via cfe-commits
@@ -620,6 +684,28 @@ mlir::LogicalResult CIRToLLVMStoreOpLowering::matchAndRewrite( return mlir::LogicalResult::success(); } +/// Switches on the type of attribute and calls the appropriate conversion. +mlir::Value lowerCirAttrAsValue(mlir::Operation *parentOp, +

[clang] [CIR] [Upstream local initialization for ArrayType (PR #132974)

2025-03-26 Thread Amr Hesham via cfe-commits
@@ -0,0 +1,150 @@ +//- LoweringHelpers.cpp - Lowering helper functions ---===// +// +// 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: Ap

[clang] [CIR] [Upstream local initialization for ArrayType (PR #132974)

2025-03-26 Thread Amr Hesham via cfe-commits
https://github.com/AmrDeveloper updated https://github.com/llvm/llvm-project/pull/132974 >From 4dc1e77299c71b8f01fb73f7fba5f14e0fbe3edd Mon Sep 17 00:00:00 2001 From: AmrDeveloper Date: Fri, 21 Mar 2025 21:07:11 +0100 Subject: [PATCH 1/4] [CIR] [Upstream local initialization for ArrayType ---

[clang] [CIR] [Upstream local initialization for ArrayType (PR #132974)

2025-03-25 Thread Amr Hesham via cfe-commits
https://github.com/AmrDeveloper updated https://github.com/llvm/llvm-project/pull/132974 >From 4dc1e77299c71b8f01fb73f7fba5f14e0fbe3edd Mon Sep 17 00:00:00 2001 From: AmrDeveloper Date: Fri, 21 Mar 2025 21:07:11 +0100 Subject: [PATCH 1/2] [CIR] [Upstream local initialization for ArrayType ---

[clang] [CIR] Upstream zero init for global variables (PR #133100)

2025-03-27 Thread Amr Hesham via cfe-commits
@@ -67,6 +67,40 @@ class CIRBaseBuilderTy : public mlir::OpBuilder { return create(loc, attr.getType(), attr); } + mlir::TypedAttr getConstNullPtrAttr(mlir::Type t) { +assert(mlir::isa(t) && "expected cir.ptr"); +return getConstPtrAttr(t, 0); + } + + mlir::Typ

[clang] [CIR][Upstream] Local initialization for ArrayType (PR #132974)

2025-04-01 Thread Amr Hesham via cfe-commits
@@ -110,6 +110,10 @@ class CIRGenFunction : public CIRGenTypeCache { public: mlir::Value createDummyValue(mlir::Location loc, clang::QualType qt); + void emitAggExpr(const clang::Expr *e, AggValueSlot slot); AmrDeveloper wrote: Done, thanks https://github

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

2025-04-06 Thread Amr Hesham via cfe-commits
https://github.com/AmrDeveloper created https://github.com/llvm/llvm-project/pull/134536 This change adds ArraySubscriptExpr for fixed size ArrayType Issue #130197 >From 81e1cd76594d3eaeda67d5888e5e5daa63fb0e12 Mon Sep 17 00:00:00 2001 From: AmrDeveloper Date: Sun, 6 Apr 2025 14:31:35 +0200 S

[clang] [CIR] [Upstream local initialization for ArrayType (PR #132974)

2025-04-05 Thread Amr Hesham via cfe-commits
https://github.com/AmrDeveloper updated https://github.com/llvm/llvm-project/pull/132974 >From 4dc1e77299c71b8f01fb73f7fba5f14e0fbe3edd Mon Sep 17 00:00:00 2001 From: AmrDeveloper Date: Fri, 21 Mar 2025 21:07:11 +0100 Subject: [PATCH 1/5] [CIR] [Upstream local initialization for ArrayType ---

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

2025-04-07 Thread Amr Hesham via cfe-commits
https://github.com/AmrDeveloper updated https://github.com/llvm/llvm-project/pull/134536 >From 81e1cd76594d3eaeda67d5888e5e5daa63fb0e12 Mon Sep 17 00:00:00 2001 From: AmrDeveloper Date: Sun, 6 Apr 2025 14:31:35 +0200 Subject: [PATCH 1/2] [CIR] Upstream ArraySubscriptExpr for fixed size array -

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

2025-04-07 Thread Amr Hesham 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

<    1   2   3