[clang] [CIR] Fix extra `;` warning, and replace `new` with emplaceBlock (NFC) (PR #127207)

2025-02-14 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko closed https://github.com/llvm/llvm-project/pull/127207 ___ 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-25 Thread Henrich Lauko 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 local initialization for ArrayType (PR #132974)

2025-04-05 Thread Henrich Lauko via cfe-commits
@@ -449,4 +449,50 @@ LValue CIRGenFunction::emitLValue(const Expr *e) { } } +void CIRGenFunction::emitNullInitialization(mlir::Location loc, Address destPtr, +QualType ty) { + // Ignore empty classes in C++. + if (getLangOpts().

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

2025-03-25 Thread Henrich Lauko via cfe-commits
@@ -229,6 +236,43 @@ def CastOp : CIR_Op<"cast", let hasFolder = 1; } + +//===--===// +// PtrStrideOp +//===--===// + +def PtrStrideOp : CI

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

2025-03-25 Thread Henrich Lauko via cfe-commits
@@ -0,0 +1,277 @@ +//===--- CIRGenExprAgg.cpp - Emit CIR Code from Aggregate Expressions -===// +// +// 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-25 Thread Henrich Lauko via cfe-commits
@@ -0,0 +1,277 @@ +//===--- CIRGenExprAgg.cpp - Emit CIR Code from Aggregate Expressions -===// +// +// 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-25 Thread Henrich Lauko via cfe-commits
@@ -0,0 +1,277 @@ +//===--- CIRGenExprAgg.cpp - Emit CIR Code from Aggregate Expressions -===// +// +// 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-25 Thread Henrich Lauko via cfe-commits
@@ -0,0 +1,277 @@ +//===--- CIRGenExprAgg.cpp - Emit CIR Code from Aggregate Expressions -===// +// +// 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][NFC] Organize emit functions in CIRGenFunction.h (PR #133017)

2025-03-26 Thread Henrich Lauko via cfe-commits
xlauko wrote: LGTM with minor nits https://github.com/llvm/llvm-project/pull/133017 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR][NFC] Organize emit functions in CIRGenFunction.h (PR #133017)

2025-03-26 Thread Henrich Lauko via cfe-commits
@@ -488,6 +364,143 @@ class CIRGenFunction : public CIRGenTypeCache { LexicalScope *curLexScope = nullptr; + /// -- + /// CIR emit functions + /// -- +private: + void emitAndUpdateRetAlloca(clang::QualType type, mlir::Location loc

[clang] [CIR][NFC] Organize emit functions in CIRGenFunction.h (PR #133017)

2025-03-26 Thread Henrich Lauko via cfe-commits
@@ -488,6 +364,143 @@ class CIRGenFunction : public CIRGenTypeCache { LexicalScope *curLexScope = nullptr; + /// -- + /// CIR emit functions + /// -- +private: + void emitAndUpdateRetAlloca(clang::QualType type, mlir::Location loc

[clang] [CIR][NFC] Organize emit functions in CIRGenFunction.h (PR #133017)

2025-03-26 Thread Henrich Lauko via cfe-commits
@@ -488,6 +364,143 @@ class CIRGenFunction : public CIRGenTypeCache { LexicalScope *curLexScope = nullptr; + /// -- + /// CIR emit functions + /// -- +private: + void emitAndUpdateRetAlloca(clang::QualType type, mlir::Location loc

[clang] [CIR] Implement lowering of int-to-bool casts (PR #132996)

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

[clang] [CIR] Upstream CmpOp (PR #133159)

2025-03-27 Thread Henrich Lauko via cfe-commits
@@ -826,6 +826,50 @@ def ForOp : CIR_Op<"for", [LoopOpInterface, NoRegionArguments]> { }]; } +//===--===// +// CmpOp +//===--===// + +def

[clang] [CIR] Upstream support for while and do..while loops (PR #133157)

2025-03-27 Thread Henrich Lauko via cfe-commits
@@ -759,6 +761,84 @@ def BrCondOp : CIR_Op<"brcond", }]; } +//===--===// +// While & DoWhileOp +//===--===// + +class WhileOpBase : CIR_Op

[clang] [CIR] Upstream support for while and do..while loops (PR #133157)

2025-03-27 Thread Henrich Lauko via cfe-commits
@@ -539,9 +539,29 @@ Block *cir::BrCondOp::getSuccessorForOperands(ArrayRef operands) { } //===--===// -// ForOp +// LoopOpInterface Methods //===---

[clang] [CIR] Upstream support for promoted types with unary plus/minus (PR #133829)

2025-04-01 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko commented: LGTM! https://github.com/llvm/llvm-project/pull/133829 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream support for promoted types with unary plus/minus (PR #133829)

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

[clang] [CIR] Emit init of local variables (PR #130164)

2025-03-15 Thread Henrich Lauko via cfe-commits
@@ -46,21 +52,124 @@ void CIRGenFunction::emitAutoVarAlloca(const VarDecl &d) { address = createTempAlloca(allocaTy, alignment, loc, d.getName()); declare(address.getPointer(), &d, ty, getLoc(d.getSourceRange()), alignment); + emission.Addr = address; setAddrOfLocalVar

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[clang] [CIR] Upstream initial support for fixed size VectorType (PR #136488)

2025-04-21 Thread Henrich Lauko via cfe-commits
@@ -307,6 +307,26 @@ def CIR_ArrayType : CIR_Type<"Array", "array", }]; } +//===--===// +// VectorType (fixed size) +//===--===// + +def CI

[clang] [CIR] Upstream initial support for fixed size VectorType (PR #136488)

2025-04-21 Thread Henrich Lauko via cfe-commits
@@ -399,6 +399,15 @@ mlir::Type CIRGenTypes::convertType(QualType type) { break; } + case Type::ExtVector: + case Type::Vector: { +const VectorType *vec = cast(ty); +const mlir::Type elemTy = convertTypeForMem(vec->getElementType()); +resultType = cir::Vect

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

2025-04-21 Thread Henrich Lauko via cfe-commits
xlauko wrote: ### Merge activity * **Apr 21, 3:06 AM EDT**: A user started a stack merge that includes this pull request via [Graphite](https://app.graphite.dev/github/pr/llvm/llvm-project/136366). https://github.com/llvm/llvm-project/pull/136366 _

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

2025-04-21 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko closed 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] Upstream initial support for fixed size VectorType (PR #136488)

2025-04-21 Thread Henrich Lauko via cfe-commits
@@ -307,6 +307,26 @@ def CIR_ArrayType : CIR_Type<"Array", "array", }]; } +//===--===// +// VectorType (fixed size) +//===--===// + +def CI

[clang] [CIR] Upstream initial support for fixed size VectorType (PR #136488)

2025-04-21 Thread Henrich Lauko via cfe-commits
@@ -307,6 +307,26 @@ def CIR_ArrayType : CIR_Type<"Array", "array", }]; } +//===--===// +// VectorType (fixed size) +//===--===// + +def CI

[clang] [CIR] Upstream initial support for fixed size VectorType (PR #136488)

2025-04-21 Thread Henrich Lauko via cfe-commits
@@ -307,6 +307,26 @@ def CIR_ArrayType : CIR_Type<"Array", "array", }]; } +//===--===// +// VectorType (fixed size) +//===--===// + +def CI

[clang] [CIR] Upstream initial support for fixed size VectorType (PR #136488)

2025-04-21 Thread Henrich Lauko via cfe-commits
@@ -307,6 +307,26 @@ def CIR_ArrayType : CIR_Type<"Array", "array", }]; } +//===--===// +// VectorType (fixed size) +//===--===// + +def CI

[clang] [CIR] Upstream initial support for fixed size VectorType (PR #136488)

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

[clang] [CIR] Upstream StackSave and StackRestoreOp (PR #136426)

2025-04-21 Thread Henrich Lauko via cfe-commits
@@ -1419,6 +1419,48 @@ def CallOp : CIR_CallOpBase<"call", [NoRegionArguments]> { }]>]; } +//===--===// +// StackSave & StackRestoreOp +//===---

[clang] [CIR] Upstream StackSave and StackRestoreOp (PR #136426)

2025-04-21 Thread Henrich Lauko via cfe-commits
@@ -1512,6 +1514,22 @@ mlir::LogicalResult CIRToLLVMTrapOpLowering::matchAndRewrite( return mlir::success(); } +mlir::LogicalResult CIRToLLVMStackSaveOpLowering::matchAndRewrite( +cir::StackSaveOp op, OpAdaptor adaptor, +mlir::ConversionPatternRewriter &rewriter) co

[clang] [CIR] Upstream StackSave and StackRestoreOp (PR #136426)

2025-04-21 Thread Henrich Lauko via cfe-commits
@@ -1419,6 +1419,48 @@ def CallOp : CIR_CallOpBase<"call", [NoRegionArguments]> { }]>]; } +//===--===// +// StackSave & StackRestoreOp +//===---

[clang] [CIR] Upstream StackSave and StackRestoreOp (PR #136426)

2025-04-21 Thread Henrich Lauko via cfe-commits
@@ -1419,6 +1419,48 @@ def CallOp : CIR_CallOpBase<"call", [NoRegionArguments]> { }]>]; } +//===--===// +// StackSave & StackRestoreOp +//===---

[clang] [CIR] Upstream StackSave and StackRestoreOp (PR #136426)

2025-04-21 Thread Henrich Lauko via cfe-commits
@@ -242,6 +242,26 @@ class CIRToLLVMPtrStrideOpLowering matchAndRewrite(cir::PtrStrideOp op, OpAdaptor, mlir::ConversionPatternRewriter &) const override; }; + +class CIRToLLVMStackSaveOpLowering +: public mlir::OpConversionPattern { +public: + using ml

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

2025-04-21 Thread Henrich Lauko via cfe-commits
xlauko wrote: ### Merge activity * **Apr 22, 2:26 AM EDT**: A user started a stack merge that includes this pull request via [Graphite](https://app.graphite.dev/github/pr/llvm/llvm-project/136604). https://github.com/llvm/llvm-project/pull/136604 _

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

2025-04-21 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko updated https://github.com/llvm/llvm-project/pull/136604 >From 6f59c473e8ecef0aeaa4d9eb02d41d2e97696615 Mon Sep 17 00:00:00 2001 From: xlauko Date: Mon, 21 Apr 2025 21:51:06 +0200 Subject: [PATCH] [CIR] Make ZeroAttr use AttrBuilderWithInferredContext --- clang/inclu

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

2025-04-21 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko updated https://github.com/llvm/llvm-project/pull/136604 >From 7790612aabf4a310328b16551620edf0704d5453 Mon Sep 17 00:00:00 2001 From: xlauko Date: Mon, 21 Apr 2025 21:51:06 +0200 Subject: [PATCH] [CIR] Make ZeroAttr use AttrBuilderWithInferredContext --- clang/inclu

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

2025-04-21 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko updated https://github.com/llvm/llvm-project/pull/136604 >From a715e75eff27a5b37aca95ef7bbe1c217a1f5463 Mon Sep 17 00:00:00 2001 From: xlauko Date: Mon, 21 Apr 2025 21:51:06 +0200 Subject: [PATCH] [CIR] Make ZeroAttr use AttrBuilderWithInferredContext --- clang/inclu

[clang] [CIR] Make UndefAttr use AttrBuilderWithInferredContext (PR #136605)

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

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

2025-04-22 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko closed 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] Make UndefAttr use AttrBuilderWithInferredContext (PR #136605)

2025-04-22 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko updated https://github.com/llvm/llvm-project/pull/136605 >From ab355262c3a7da4d8089a49d531870bff14d5f8c Mon Sep 17 00:00:00 2001 From: xlauko Date: Mon, 21 Apr 2025 22:03:35 +0200 Subject: [PATCH] [CIR] Make UndefAttr use AttrBuilderWithInferredContext --- clang/incl

[clang] [CIR] Make UndefAttr use AttrBuilderWithInferredContext (PR #136605)

2025-04-22 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko updated https://github.com/llvm/llvm-project/pull/136605 >From e31c61b514c3541d594f67de02b1d495141b4ae3 Mon Sep 17 00:00:00 2001 From: xlauko Date: Mon, 21 Apr 2025 22:03:35 +0200 Subject: [PATCH] [CIR] Make UndefAttr use AttrBuilderWithInferredContext --- clang/incl

[clang] [CIR] Make UndefAttr use AttrBuilderWithInferredContext (PR #136605)

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

[clang] [CIR] Let ConstantOp builder infer its type automatically (PR #136606)

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

[clang] [CIR] Let ConstantOp builder infer its type automatically (PR #136606)

2025-04-22 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko updated https://github.com/llvm/llvm-project/pull/136606 >From ac40893c8429a57f11f1be3d60c326ac98de8282 Mon Sep 17 00:00:00 2001 From: xlauko Date: Mon, 21 Apr 2025 22:23:40 +0200 Subject: [PATCH] [CIR] Let ConstantOp builder infer its type automatically --- clang/in

[clang] [CIR] Let ConstantOp builder infer its type automatically (PR #136606)

2025-04-22 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko updated https://github.com/llvm/llvm-project/pull/136606 >From d5d928c7e90129f2a8029a06256689d9e81d831d Mon Sep 17 00:00:00 2001 From: xlauko Date: Mon, 21 Apr 2025 22:23:40 +0200 Subject: [PATCH] [CIR] Let ConstantOp builder infer its type automatically --- clang/in

[clang] [CIR] Let ConstantOp builder infer its type automatically (PR #136606)

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

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

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

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

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

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

2025-04-18 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko ready_for_review 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 Henrich Lauko via cfe-commits
https://github.com/xlauko 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] Upstream support for record packing and padding (PR #136036)

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

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

2025-04-18 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko created https://github.com/llvm/llvm-project/pull/136362 None >From 2c711e7f5365c1fe6a34254f69c6480a469aebe7 Mon Sep 17 00:00:00 2001 From: xlauko Date: Fri, 18 Apr 2025 21:59:30 +0200 Subject: [PATCH] [CIR] Infer MLIR context in type builders when possible --- clan

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

2025-04-18 Thread Henrich Lauko via cfe-commits
xlauko wrote: * **#136362** https://app.graphite.dev/github/pr/llvm/llvm-project/136362?utm_source=stack-comment-icon"; target="_blank">https://static.graphite.dev/graphite-32x32-black.png"; alt="Graphite" width="10px" height="10px"/> 👈 https://app.graphite.dev/github/pr/llvm/llvm-project/13636

[clang] LowerGlobalDtors: Use use_empty instead of getNumUses == 0 (#136337) (PR #136361)

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

[clang] LowerGlobalDtors: Use use_empty instead of getNumUses == 0 (#136337) (PR #136361)

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

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

2025-04-18 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko ready_for_review 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] Infer MLIR context in type builders when possible (PR #136362)

2025-04-18 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko edited 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][NFC] Simplify BoolAttr builders (PR #136366)

2025-04-18 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko created https://github.com/llvm/llvm-project/pull/136366 None >From 510777f925c25f957567fd874b4474c848b359dc Mon Sep 17 00:00:00 2001 From: xlauko Date: Fri, 18 Apr 2025 22:34:24 +0200 Subject: [PATCH] [CIR][NFC] Simplify BoolAttr builders --- .../clang/CIR/Dialect/

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

2025-04-18 Thread Henrich Lauko via cfe-commits
xlauko wrote: * **#136366** https://app.graphite.dev/github/pr/llvm/llvm-project/136366?utm_source=stack-comment-icon"; target="_blank">https://static.graphite.dev/graphite-32x32-black.png"; alt="Graphite" width="10px" height="10px"/> 👈 https://app.graphite.dev/github/pr/llvm/llvm-project/13636

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

2025-04-18 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko closed 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][NFC] Simplify BoolAttr builders (PR #136366)

2025-04-18 Thread Henrich Lauko 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 Henrich Lauko 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][NFC] Simplify BoolAttr builders (PR #136366)

2025-04-18 Thread Henrich Lauko 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] Infer MLIRContext in attr builders when possible (PR #136741)

2025-04-22 Thread Henrich Lauko via cfe-commits
xlauko wrote: ### Merge activity * **Apr 23, 1:51 AM EDT**: A user started a stack merge that includes this pull request via [Graphite](https://app.graphite.dev/github/pr/llvm/llvm-project/136741). https://github.com/llvm/llvm-project/pull/136741 _

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

2025-04-22 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko closed 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] Create CIR_TypedAttr common class (PR #136852)

2025-04-23 Thread Henrich Lauko via cfe-commits
xlauko wrote: ### Merge activity * **Apr 23, 5:00 PM EDT**: A user started a stack merge that includes this pull request via [Graphite](https://app.graphite.dev/github/pr/llvm/llvm-project/136852). https://github.com/llvm/llvm-project/pull/136852 _

[clang] [CIR] Create CIR_TypedAttr common class (PR #136852)

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

[clang] [CIR] Upstream cir.call with scalar arguments (PR #136810)

2025-04-24 Thread Henrich Lauko via cfe-commits
@@ -21,9 +21,24 @@ let cppNamespace = "::cir" in { // The CIRCallOpInterface must be used instead of CallOpInterface when looking // at arguments and other bits of CallOp. This creates a level of abstraction // that's useful for handling indirect calls and other details.

[clang] [CIR] Upstream initial support for switch statements (PR #137106)

2025-04-24 Thread Henrich Lauko via cfe-commits
@@ -753,6 +755,225 @@ def ScopeOp : CIR_Op<"scope", [ ]; } +//===--===// +// SwitchOp +//===--===// + +def CaseOpKind_DT : I32EnumAttrCase<

[clang] [CIR] Upstream initial support for switch statements (PR #137106)

2025-04-24 Thread Henrich Lauko via cfe-commits
@@ -802,6 +804,132 @@ Block *cir::BrCondOp::getSuccessorForOperands(ArrayRef operands) { return nullptr; } +//===--===// +// CaseOp +//===

[clang] [CIR] Upstream initial support for switch statements (PR #137106)

2025-04-24 Thread Henrich Lauko via cfe-commits
@@ -802,6 +804,132 @@ Block *cir::BrCondOp::getSuccessorForOperands(ArrayRef operands) { return nullptr; } +//===--===// +// CaseOp +//===

[clang] [CIR] Upstream initial support for switch statements (PR #137106)

2025-04-24 Thread Henrich Lauko via cfe-commits
@@ -802,6 +804,132 @@ Block *cir::BrCondOp::getSuccessorForOperands(ArrayRef operands) { return nullptr; } +//===--===// +// CaseOp +//===

[clang] [CIR] Create CIR_TypedAttr common class (PR #136852)

2025-04-23 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko created https://github.com/llvm/llvm-project/pull/136852 Introduce common base class for attributes with single type parameter. This mirrors incubator changes introduced in https://github.com/llvm/clangir/pull/1583 >From 4dc6ea34144040e52ce5818baab39180ec257616 Mon Se

[clang] [CIR] Create CIR_TypedAttr common class (PR #136852)

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

[clang] [CIR] Create CIR_TypedAttr common class (PR #136852)

2025-04-23 Thread Henrich Lauko via cfe-commits
xlauko wrote: * **#136852** https://app.graphite.dev/github/pr/llvm/llvm-project/136852?utm_source=stack-comment-icon"; target="_blank">https://static.graphite.dev/graphite-32x32-black.png"; alt="Graphite" width="10px" height="10px"/> 👈 https://app.graphite.dev/github/pr/llvm/llvm-project/13685

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

2025-04-14 Thread Henrich Lauko 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] [CIR] Upstream minimal support for structure types (PR #135105)

2025-04-14 Thread Henrich Lauko 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] [CIR] Upstream minimal support for structure types (PR #135105)

2025-04-14 Thread Henrich Lauko 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] [CIR] Upstream minimal support for structure types (PR #135105)

2025-04-14 Thread Henrich Lauko 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] [CIR] Upstream minimal support for structure types (PR #135105)

2025-04-14 Thread Henrich Lauko 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] [mlir] [OpenACC] Implement tile/collapse lowering (PR #138576)

2025-05-05 Thread Henrich Lauko via cfe-commits
@@ -82,6 +83,17 @@ class OpenACCClauseCIREmitter final return conversionOp.getResult(0); } + mlir::Value createConstantInt(mlir::Location loc, unsigned width, +int64_t value) { +mlir::IntegerType ty = mlir::IntegerType::get( +

[clang] [CIR] Refactor floating point type constraints (PR #138112)

2025-05-02 Thread Henrich Lauko via cfe-commits
xlauko wrote: ### Merge activity * **May 2, 3:21 AM EDT**: @xlauko merged this pull request with [Graphite](https://app.graphite.dev/github/pr/llvm/llvm-project/138112). https://github.com/llvm/llvm-project/pull/138112 ___ cfe-commits mailing list c

[clang] [CIR] Refactor floating point type constraints (PR #138112)

2025-05-02 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko closed https://github.com/llvm/llvm-project/pull/138112 ___ 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 VectorType (PR #138107)

2025-05-02 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko edited https://github.com/llvm/llvm-project/pull/138107 ___ 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 VectorType (PR #138107)

2025-05-02 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko commented: lgtm, besides Andy's comments https://github.com/llvm/llvm-project/pull/138107 ___ 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 VectorType (PR #138107)

2025-05-02 Thread Henrich Lauko via cfe-commits
@@ -1584,6 +1586,47 @@ mlir::Value ScalarExprEmitter::VisitMemberExpr(MemberExpr *e) { return emitLoadOfLValue(e); } +mlir::Value ScalarExprEmitter::VisitInitListExpr(InitListExpr *e) { + const unsigned numInitElements = e->getNumInits(); + + if (e->hadArrayRangeDesignato

[clang] [CIR] Refactor global variable emission and initialization (PR #138222)

2025-05-02 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko approved this pull request. lgtm https://github.com/llvm/llvm-project/pull/138222 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Refactor global variable emission and initialization (PR #138222)

2025-05-02 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko edited https://github.com/llvm/llvm-project/pull/138222 ___ 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 VectorType (PR #138107)

2025-05-02 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko edited https://github.com/llvm/llvm-project/pull/138107 ___ 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 VectorType (PR #138107)

2025-05-02 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko approved this pull request. lgtm, besides Andy's https://github.com/llvm/llvm-project/pull/138107 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream pointer arithmetic support (PR #138041)

2025-05-01 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko approved this pull request. lgtm, besides Erich's comments https://github.com/llvm/llvm-project/pull/138041 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

  1   2   3   >