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

2025-08-23 Thread Henrich Lauko via cfe-commits
@@ -3800,4 +3800,58 @@ def CIR_VAArgOp : CIR_Op<"va_arg"> { }]; } +//===--===// +// ThrowOp +//===--===// + +def CIR_ThrowOp : CIR_Op<"thro

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

2025-08-23 Thread Henrich Lauko via cfe-commits
@@ -3800,4 +3800,58 @@ def CIR_VAArgOp : CIR_Op<"va_arg"> { }]; } +//===--===// +// ThrowOp +//===--===// + +def CIR_ThrowOp : CIR_Op<"thro

[clang] [CIR] Add CIR vtable attribute (PR #154415)

2025-08-21 Thread Henrich Lauko via cfe-commits
@@ -496,6 +496,46 @@ def CIR_GlobalViewAttr : CIR_Attr<"GlobalView", "global_view", [ }]; } +//===--===// +// VTableAttr +//===--===// + +

[clang] [CIR] Add support for derived classes in type info conversion safety … (PR #154385)

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

[clang] [CIR] Add support for derived classes in type info conversion safety … (PR #154385)

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

[clang] [CIR] Add support for derived classes in type info conversion safety … (PR #154385)

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

[clang] [CIR] Add CIR vtable attribute (PR #154415)

2025-08-20 Thread Henrich Lauko via cfe-commits
@@ -424,6 +424,44 @@ cir::ConstVectorAttr::verify(function_ref emitError, return elementTypeCheck; } +//===--===// +// CIR VTableAttr +//===--

[clang] [CIR] Add CIR vtable attribute (PR #154415)

2025-08-20 Thread Henrich Lauko via cfe-commits
@@ -424,6 +424,44 @@ cir::ConstVectorAttr::verify(function_ref emitError, return elementTypeCheck; } +//===--===// +// CIR VTableAttr +//===--

[clang] [CIR] Add CIR vtable attribute (PR #154415)

2025-08-20 Thread Henrich Lauko via cfe-commits
@@ -424,6 +424,44 @@ cir::ConstVectorAttr::verify(function_ref emitError, return elementTypeCheck; } +//===--===// +// CIR VTableAttr +//===--

[clang] [CIR] Add CIR vtable attribute (PR #154415)

2025-08-20 Thread Henrich Lauko via cfe-commits
@@ -496,6 +496,46 @@ def CIR_GlobalViewAttr : CIR_Attr<"GlobalView", "global_view", [ }]; } +//===--===// +// VTableAttr +//===--===// + +

[clang] [CIR] Add CIR vtable attribute (PR #154415)

2025-08-20 Thread Henrich Lauko via cfe-commits
@@ -424,6 +424,44 @@ cir::ConstVectorAttr::verify(function_ref emitError, return elementTypeCheck; } +//===--===// +// CIR VTableAttr +//===--

[clang] [CIR] Add CIR vtable attribute (PR #154415)

2025-08-20 Thread Henrich Lauko via cfe-commits
@@ -496,6 +496,46 @@ def CIR_GlobalViewAttr : CIR_Attr<"GlobalView", "global_view", [ }]; } +//===--===// +// VTableAttr +//===--===// + +

[clang] [CIR] Add CIR vtable attribute (PR #154415)

2025-08-20 Thread Henrich Lauko via cfe-commits
@@ -496,6 +496,46 @@ def CIR_GlobalViewAttr : CIR_Attr<"GlobalView", "global_view", [ }]; } +//===--===// +// VTableAttr +//===--===// + +

[clang] [CIR] Add CIR vtable attribute (PR #154415)

2025-08-20 Thread Henrich Lauko via cfe-commits
@@ -496,6 +496,46 @@ def CIR_GlobalViewAttr : CIR_Attr<"GlobalView", "global_view", [ }]; } +//===--===// +// VTableAttr +//===--===// + +

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

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

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

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

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

2025-08-19 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko approved this pull request. lgtm, with minor nits https://github.com/llvm/llvm-project/pull/152511 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

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

[clang] [mlir] [MLIR] Default valued enum parameter (PR #154168)

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

[clang] [mlir] XXX (PR #154168)

2025-08-18 Thread Henrich Lauko via cfe-commits
xlauko wrote: * **#154168** https://app.graphite.dev/github/pr/llvm/llvm-project/154168?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/15416

[clang] [mlir] XXX (PR #154168)

2025-08-18 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko created https://github.com/llvm/llvm-project/pull/154168 None >From 4b75153b6542eb7dc906d378a00aadee10359a64 Mon Sep 17 00:00:00 2001 From: xlauko Date: Tue, 15 Jul 2025 14:17:46 +0200 Subject: [PATCH] XXX --- clang/lib/CIR/CodeGen/CIRGenBuiltin.cpp | 1 - ml

[clang] [CIR] Implement Statement Expressions (PR #153677)

2025-08-18 Thread Henrich Lauko via cfe-commits
@@ -1178,11 +1178,11 @@ static void pushTemporaryCleanup(CIRGenFunction &cgf, ->getBaseElementTypeUnsafe() ->getAs()) { // Get the destructor for the reference temporary. -auto *classDecl =

[clang] [CIR] Implement MemberExpr support for ComplexType (PR #154027)

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

[clang] [CIR] Implement MemberExpr support for ComplexType (PR #154027)

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

[clang] [CIR] Run LoweringPrepare pass only for non CIR output (PR #154107)

2025-08-18 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko commented: Why does this adds `-std=c++20` to tests? This removes lot of lowering prepare tests, is it intentional? Can we add `RUN:` with enabled lowering and keep tests? https://github.com/llvm/llvm-project/pull/154107 ___

[clang] [CIR] Run LoweringPrepare pass only for non CIR output (PR #154107)

2025-08-18 Thread Henrich Lauko via cfe-commits
@@ -15,53 +15,29 @@ struct HasDtor { ~HasDtor(); }; -// CHECK: acc.private.recipe @privatization__ZTSA5_7HasDtor : !cir.ptr> init { +// CHECK: acc.private.recipe @privatization__ZTSA5_7HasDtor : !cir.ptr> init { // CHECK-NEXT: ^bb0(%[[ARG:.*]]: !cir.ptr> {{.*}}): -// CH

[clang] [CIR] Run LoweringPrepare pass only for non CIR output (PR #154107)

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

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

2025-08-16 Thread Henrich Lauko via cfe-commits
@@ -858,6 +853,21 @@ mlir::Value ComplexExprEmitter::emitBinMul(const BinOpInfo &op) { return builder.createComplexCreate(op.loc, newReal, newImag); } +mlir::Value ComplexExprEmitter::emitBinDiv(const BinOpInfo &op) { + assert(!cir::MissingFeatures::fastMathFlags()); + as

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

2025-08-16 Thread Henrich Lauko via cfe-commits
@@ -858,6 +853,21 @@ mlir::Value ComplexExprEmitter::emitBinMul(const BinOpInfo &op) { return builder.createComplexCreate(op.loc, newReal, newImag); } +mlir::Value ComplexExprEmitter::emitBinDiv(const BinOpInfo &op) { + assert(!cir::MissingFeatures::fastMathFlags()); + as

[clang] [CIR] Implement__builtin_va_arg (PR #153834)

2025-08-16 Thread Henrich Lauko via cfe-commits
@@ -3415,4 +3415,126 @@ def CIR_FAbsOp : CIR_UnaryFPToFPBuiltinOp<"fabs", "FAbsOp"> { }]; } +//===--===// +// Variadic Operations +//===--

[clang] [CIR] Implement__builtin_va_arg (PR #153834)

2025-08-16 Thread Henrich Lauko via cfe-commits
@@ -3415,4 +3415,126 @@ def CIR_FAbsOp : CIR_UnaryFPToFPBuiltinOp<"fabs", "FAbsOp"> { }]; } +//===--===// +// Variadic Operations +//===--

[clang] [CIR] Implement__builtin_va_arg (PR #153834)

2025-08-16 Thread Henrich Lauko via cfe-commits
@@ -3415,4 +3415,126 @@ def CIR_FAbsOp : CIR_UnaryFPToFPBuiltinOp<"fabs", "FAbsOp"> { }]; } +//===--===// +// Variadic Operations +//===--

[clang] [CIR] Implement__builtin_va_arg (PR #153834)

2025-08-16 Thread Henrich Lauko via cfe-commits
@@ -384,6 +384,19 @@ class ScalarExprEmitter : public StmtVisitor { return Visit(e->getReplacement()); } + mlir::Value VisitVAArgExpr(VAArgExpr *ve) { +QualType Ty = ve->getType(); + +if (Ty->isVariablyModifiedType()) { xlauko wrote: ```sugges

[clang] [CIR] Implement__builtin_va_arg (PR #153834)

2025-08-16 Thread Henrich Lauko via cfe-commits
@@ -384,6 +384,19 @@ class ScalarExprEmitter : public StmtVisitor { return Visit(e->getReplacement()); } + mlir::Value VisitVAArgExpr(VAArgExpr *ve) { +QualType Ty = ve->getType(); + +if (Ty->isVariablyModifiedType()) { + cgf.cgm.errorNYI(ve->getSourceRang

[clang] [CIR] Implement__builtin_va_arg (PR #153834)

2025-08-16 Thread Henrich Lauko via cfe-commits
@@ -384,6 +384,19 @@ class ScalarExprEmitter : public StmtVisitor { return Visit(e->getReplacement()); } + mlir::Value VisitVAArgExpr(VAArgExpr *ve) { +QualType Ty = ve->getType(); xlauko wrote: ```suggestion QualType ty = ve->getType(); ```

[clang] [CIR] Upstream EHScopeStack memory allocator (PR #152215)

2025-08-07 Thread Henrich Lauko via cfe-commits
@@ -42,7 +42,47 @@ enum CleanupKind : unsigned { /// A stack of scopes which respond to exceptions, including cleanups /// and catch blocks. class EHScopeStack { + friend class CIRGenFunction; + public: + // TODO(ogcg): Switch to alignof(uint64_t) instead of 8 + enum { Scop

[clang] [CIR] Upstream EHScopeStack memory allocator (PR #152215)

2025-08-07 Thread Henrich Lauko via cfe-commits
@@ -0,0 +1,43 @@ +//===--===// +// +// 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 EHScopeStack memory allocator (PR #152215)

2025-08-07 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko approved this pull request. lgtm, with minor nits https://github.com/llvm/llvm-project/pull/152215 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream EHScopeStack memory allocator (PR #152215)

2025-08-07 Thread Henrich Lauko via cfe-commits
@@ -0,0 +1,43 @@ +//===--===// +// +// 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 EHScopeStack memory allocator (PR #152215)

2025-08-07 Thread Henrich Lauko via cfe-commits
@@ -42,7 +42,47 @@ enum CleanupKind : unsigned { /// A stack of scopes which respond to exceptions, including cleanups /// and catch blocks. class EHScopeStack { + friend class CIRGenFunction; + public: + // TODO(ogcg): Switch to alignof(uint64_t) instead of 8 + enum { Scop

[clang] [CIR] Upstream EHScopeStack memory allocator (PR #152215)

2025-08-07 Thread Henrich Lauko via cfe-commits
@@ -42,7 +42,47 @@ enum CleanupKind : unsigned { /// A stack of scopes which respond to exceptions, including cleanups /// and catch blocks. class EHScopeStack { + friend class CIRGenFunction; + public: + // TODO(ogcg): Switch to alignof(uint64_t) instead of 8 + enum { Scop

[clang] [CIR] Upstream EHScopeStack memory allocator (PR #152215)

2025-08-07 Thread Henrich Lauko via cfe-commits
@@ -0,0 +1,43 @@ +//===--===// +// +// 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 EHScopeStack memory allocator (PR #152215)

2025-08-07 Thread Henrich Lauko via cfe-commits
@@ -33,6 +34,54 @@ using namespace clang::CIRGen; void EHScopeStack::Cleanup::anchor() {} +/// Push an entry of the given size onto this protected-scope stack. +char *EHScopeStack::allocate(size_t size) { + size = llvm::alignTo(size, ScopeStackAlignment); + if (!startOfBuff

[clang] [CIR] Upstream EHScopeStack memory allocator (PR #152215)

2025-08-07 Thread Henrich Lauko via cfe-commits
@@ -0,0 +1,43 @@ +//===--===// +// +// 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 EHScopeStack memory allocator (PR #152215)

2025-08-07 Thread Henrich Lauko via cfe-commits
@@ -33,6 +34,54 @@ using namespace clang::CIRGen; void EHScopeStack::Cleanup::anchor() {} +/// Push an entry of the given size onto this protected-scope stack. +char *EHScopeStack::allocate(size_t size) { + size = llvm::alignTo(size, ScopeStackAlignment); + if (!startOfBuff

[clang] [CIR] Upstream EHScopeStack memory allocator (PR #152215)

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

[clang] [CIR] Add CIRGen for cir.unreachable and cir.trap (PR #151363)

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

[clang] [CIR] Use getDefiningOp() instead of dyn_cast(getDefiningOp()) (NFC) (PR #151217)

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

[clang] [CIR] Use getDefiningOp() instead of dyn_cast(getDefiningOp()) (NFC) (PR #151217)

2025-08-01 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko updated https://github.com/llvm/llvm-project/pull/151217 >From 320cabcdefda70ba4f3af33f633cf43b834bc1d4 Mon Sep 17 00:00:00 2001 From: xlauko Date: Tue, 29 Jul 2025 21:49:22 +0200 Subject: [PATCH] [CIR] Use getDefiningOp() instead of dyn_cast(getDefiningOp()) (NFC) T

[clang] [CIR] Use getDefiningOp() instead of dyn_cast(getDefiningOp()) (NFC) (PR #151217)

2025-08-01 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko updated https://github.com/llvm/llvm-project/pull/151217 >From 4d76a80344df0e4543c86613e5c36c02d230b962 Mon Sep 17 00:00:00 2001 From: xlauko Date: Tue, 29 Jul 2025 21:49:22 +0200 Subject: [PATCH] [CIR] Use getDefiningOp() instead of dyn_cast(getDefiningOp()) (NFC) T

[clang] [CIR] Use getDefiningOp() instead of dyn_cast(getDefiningOp()) (NFC) (PR #151217)

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

[clang] [CIR] Simplify ConstantOp accesses and its getDefiningOp (PR #151216)

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

[clang] [CIR] Simplify ConstantOp accesses and its getDefiningOp (PR #151216)

2025-08-01 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko updated https://github.com/llvm/llvm-project/pull/151216 >From 88e5e8bd20d36c63d4110a70f9276a8095549668 Mon Sep 17 00:00:00 2001 From: xlauko Date: Tue, 29 Jul 2025 21:38:48 +0200 Subject: [PATCH] [CIR] Simplify ConstantOp accesses and its getDefiningOp - Replaces dy

[clang] [CIR] Simplify ConstantOp accesses and its getDefiningOp (PR #151216)

2025-08-01 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko updated https://github.com/llvm/llvm-project/pull/151216 >From 05b0240952b59ec86eee40b13aebedb335818038 Mon Sep 17 00:00:00 2001 From: xlauko Date: Tue, 29 Jul 2025 21:38:48 +0200 Subject: [PATCH] [CIR] Simplify ConstantOp accesses and its getDefiningOp - Replaces dy

[clang] [CIR] Simplify ConstantOp accesses and its getDefiningOp (PR #151216)

2025-08-01 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko updated https://github.com/llvm/llvm-project/pull/151216 >From 376046571e736227c8ce8bb39b90d4570429bdc0 Mon Sep 17 00:00:00 2001 From: xlauko Date: Tue, 29 Jul 2025 21:38:48 +0200 Subject: [PATCH] [CIR] Simplify ConstantOp accesses and its getDefiningOp - Replaces dy

[clang] [CIR] Simplify ConstantOp accesses and its getDefiningOp (PR #151216)

2025-08-01 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko updated https://github.com/llvm/llvm-project/pull/151216 >From 8b41e899143aeb3873384cc2b0d31c012dfd5df7 Mon Sep 17 00:00:00 2001 From: xlauko Date: Tue, 29 Jul 2025 21:38:48 +0200 Subject: [PATCH] [CIR] Simplify ConstantOp accesses and its getDefiningOp - Replaces dy

[clang] [CIR] Simplify ConstantOp accesses and its getDefiningOp (PR #151216)

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

[clang] [CIR] Simplify ConstantOp accesses and its getDefiningOp (PR #151216)

2025-08-01 Thread Henrich Lauko via cfe-commits
xlauko wrote: ### Merge activity * **Aug 1, 6:06 PM UTC**: [Graphite](https://app.graphite.dev/github/pr/llvm/llvm-project/151216) rebased this pull request as part of a merge. https://github.com/llvm/llvm-project/pull/151216 ___ cfe-commits mailin

[clang] [CIR] Simplify ConstantOp accesses and its getDefiningOp (PR #151216)

2025-08-01 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko updated https://github.com/llvm/llvm-project/pull/151216 >From 23121724bf565468a2c0e632a24ce48054ecd31e Mon Sep 17 00:00:00 2001 From: xlauko Date: Tue, 29 Jul 2025 21:38:48 +0200 Subject: [PATCH] [CIR] Simplify ConstantOp accesses and its getDefiningOp - Replaces dy

[clang] [CIR] Simplify ConstantOp accesses and its getDefiningOp (PR #151216)

2025-08-01 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko updated https://github.com/llvm/llvm-project/pull/151216 >From 3f272554fd86f5a0b778202c687a79498279edf6 Mon Sep 17 00:00:00 2001 From: xlauko Date: Tue, 29 Jul 2025 21:38:48 +0200 Subject: [PATCH] [CIR] Simplify ConstantOp accesses and its getDefiningOp - Replaces dy

[clang] [CIR] Simplify ConstantOp accesses and its getDefiningOp (PR #151216)

2025-08-01 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko updated https://github.com/llvm/llvm-project/pull/151216 >From cce12ad93d03ab26260ec65e4cd98ccdee61844e Mon Sep 17 00:00:00 2001 From: xlauko Date: Tue, 29 Jul 2025 21:38:48 +0200 Subject: [PATCH] [CIR] Simplify ConstantOp accesses and its getDefiningOp - Replaces dy

[clang] [CIR] Simplify ConstantOp accesses and its getDefiningOp (PR #151216)

2025-08-01 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko updated https://github.com/llvm/llvm-project/pull/151216 >From fddf5271b65e657e4f1034fd4a1add17979058c8 Mon Sep 17 00:00:00 2001 From: xlauko Date: Tue, 29 Jul 2025 21:38:48 +0200 Subject: [PATCH] [CIR] Simplify ConstantOp accesses and its getDefiningOp - Replaces dy

[clang] [CIR] Simplify ConstantOp accesses and its getDefiningOp (PR #151216)

2025-08-01 Thread Henrich Lauko via cfe-commits
@@ -291,6 +291,21 @@ def CIR_ConstantOp : CIR_Op<"const", [ return ptrAttr.isNullValue(); return false; } + +template +T getValueAttr() { return mlir::dyn_cast(getValue()); } + +llvm::APInt getIntValue() { xlauko wrote: They are

[clang] [CIR] Simplify ConstantOp accesses and its getDefiningOp (PR #151216)

2025-08-01 Thread Henrich Lauko via cfe-commits
xlauko wrote: @andykaylor ping https://github.com/llvm/llvm-project/pull/151216 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Simplify ConstantOp accesses and its getDefiningOp (PR #151216)

2025-08-01 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko updated https://github.com/llvm/llvm-project/pull/151216 >From 1770a46e81bc67fad2cef89d5fb273c47fd909df Mon Sep 17 00:00:00 2001 From: xlauko Date: Tue, 29 Jul 2025 21:38:48 +0200 Subject: [PATCH] [CIR] Simplify ConstantOp accesses and its getDefiningOp - Replaces dy

[clang] [CIR] Handle expression with cleanups (PR #151600)

2025-08-01 Thread Henrich Lauko via cfe-commits
@@ -1096,6 +1096,154 @@ void CIRGenFunction::emitAnyExprToMem(const Expr *e, Address location, llvm_unreachable("bad evaluation kind"); } +static Address createReferenceTemporary(CIRGenFunction &cgf, +const MaterializeTemporaryExpr *m

[clang] [CIR] Handle expression with cleanups (PR #151600)

2025-08-01 Thread Henrich Lauko via cfe-commits
@@ -1096,6 +1096,154 @@ void CIRGenFunction::emitAnyExprToMem(const Expr *e, Address location, llvm_unreachable("bad evaluation kind"); } +static Address createReferenceTemporary(CIRGenFunction &cgf, +const MaterializeTemporaryExpr *m

[clang] [CIR] Handle expression with cleanups (PR #151600)

2025-08-01 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko approved this pull request. lgtm with minor nits https://github.com/llvm/llvm-project/pull/151600 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Handle expression with cleanups (PR #151600)

2025-08-01 Thread Henrich Lauko via cfe-commits
@@ -1096,6 +1096,154 @@ void CIRGenFunction::emitAnyExprToMem(const Expr *e, Address location, llvm_unreachable("bad evaluation kind"); } +static Address createReferenceTemporary(CIRGenFunction &cgf, +const MaterializeTemporaryExpr *m

[clang] [CIR] Handle expression with cleanups (PR #151600)

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

[clang] [CIR] Add diagnostic for NYI AST visitor handlers (PR #151561)

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

[clang] [CIR] Add vptr type and generate vptr field when needed (PR #151377)

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

[clang] [CIR] Add vptr type and generate vptr field when needed (PR #151377)

2025-08-01 Thread Henrich Lauko via cfe-commits
@@ -697,6 +697,24 @@ BoolType::getABIAlignment(const ::mlir::DataLayout &dataLayout, return 1; } +//===--===// +// VPtrType Definitions +//===---

[clang] [CIR] Add CIRGen for cir.unreachable and cir.trap (PR #151363)

2025-07-31 Thread Henrich Lauko via cfe-commits
@@ -269,6 +270,22 @@ RValue CIRGenFunction::emitBuiltinExpr(const GlobalDecl &gd, unsigned builtinID, case Builtin::BI__builtin_rotateright32: case Builtin::BI__builtin_rotateright64: return emitRotate(e, /*isRotateLeft=*/false); + + case Builtin::BI__builtin_trap: {

[clang] [CIR] Add CIRGen for cir.unreachable and cir.trap (PR #151363)

2025-07-31 Thread Henrich Lauko via cfe-commits
@@ -1780,6 +1780,11 @@ LValue CIRGenFunction::emitLoadOfReferenceLValue(Address refAddr, pointeeBaseInfo); } +void CIRGenFunction::emitUnreachable(clang::SourceLocation loc) { + assert(!cir::MissingFeatures::sanitizers()); + builder.create(getLoc(loc

[clang] [CIR] Add CIRGen for cir.unreachable and cir.trap (PR #151363)

2025-07-31 Thread Henrich Lauko via cfe-commits
@@ -269,6 +270,22 @@ RValue CIRGenFunction::emitBuiltinExpr(const GlobalDecl &gd, unsigned builtinID, case Builtin::BI__builtin_rotateright32: case Builtin::BI__builtin_rotateright64: return emitRotate(e, /*isRotateLeft=*/false); + + case Builtin::BI__builtin_trap: {

[clang] [CIR] Add CIRGen for cir.unreachable and cir.trap (PR #151363)

2025-07-31 Thread Henrich Lauko via cfe-commits
@@ -269,6 +270,22 @@ RValue CIRGenFunction::emitBuiltinExpr(const GlobalDecl &gd, unsigned builtinID, case Builtin::BI__builtin_rotateright32: case Builtin::BI__builtin_rotateright64: return emitRotate(e, /*isRotateLeft=*/false); + + case Builtin::BI__builtin_trap: {

[clang] [CIR] Add CIRGen for cir.unreachable and cir.trap (PR #151363)

2025-07-31 Thread Henrich Lauko via cfe-commits
@@ -269,6 +270,22 @@ RValue CIRGenFunction::emitBuiltinExpr(const GlobalDecl &gd, unsigned builtinID, case Builtin::BI__builtin_rotateright32: case Builtin::BI__builtin_rotateright64: return emitRotate(e, /*isRotateLeft=*/false); + + case Builtin::BI__builtin_trap: {

[clang] [CIR] Fix warnings related to unused variables in release builds (PR #151412)

2025-07-31 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko commented: lgtm, with minor nit https://github.com/llvm/llvm-project/pull/151412 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Fix warnings related to unused variables in release builds (PR #151412)

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

[clang] [CIR] Fix warnings related to unused variables in release builds (PR #151412)

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

[clang] [CIR] Fix warnings related to unused variables in release builds (PR #151412)

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

[clang] [CIR] Fix warnings related to unused variables in release builds (PR #151412)

2025-07-31 Thread Henrich Lauko via cfe-commits
@@ -216,8 +216,7 @@ void CIRGenFunction::emitAndUpdateRetAlloca(QualType type, mlir::Location loc, void CIRGenFunction::declare(mlir::Value addrVal, const Decl *var, QualType ty, mlir::Location loc, CharUnits alignment,

[clang] [CIR] Fix fallthrough warning (PR #151418)

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

[clang] [CIR] Support more declarations without any codegen (PR #151076)

2025-07-29 Thread Henrich Lauko via cfe-commits
@@ -1267,8 +1267,14 @@ void CIRGenModule::emitTopLevelDecl(Decl *decl) { break; // No code generation needed. - case Decl::UsingShadow: + case Decl::ClassTemplate: + case Decl::Concept: + case Decl::CXXDeductionGuide: case Decl::Empty: + case Decl::FunctionTempla

[clang] [CIR] Upstream support for function-level variable decompositions (PR #151073)

2025-07-29 Thread Henrich Lauko via cfe-commits
@@ -608,11 +608,16 @@ void CIRGenFunction::emitDecl(const Decl &d) { case Decl::UsingDirective: // using namespace X; [C++] assert(!cir::MissingFeatures::generateDebugInfo()); return; - case Decl::Var: { + case Decl::Var: + case Decl::Decomposition: { const Va

[clang] [CIR] Upstream support for variable template specializations (PR #151069)

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

[clang] [CIR] Upstream support for variable template specializations (PR #151069)

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

[clang] [CIR] Add support for C++ conversion operators (PR #151066)

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

[clang] [CIR] Add support for C++ conversion operators (PR #151066)

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

[clang] [CIR] Upstream proper function alias lowering (PR #150520)

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

[clang] [CIR][NFC] Reformat Attr to use common CIR_ prefix and traits style (PR #150694)

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

[clang] [CIR][NFC] Reformat Attr to use common CIR_ prefix and traits style (PR #150694)

2025-07-28 Thread Henrich Lauko via cfe-commits
xlauko wrote: ### Merge activity * **Jul 29, 5:37 AM UTC**: A user started a stack merge that includes this pull request via [Graphite](https://app.graphite.dev/github/pr/llvm/llvm-project/150694). https://github.com/llvm/llvm-project/pull/150694 _

[clang] [CIR][NFC] Fix an unused variable warning (PR #150758)

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

[clang] [CIR][NFC] Fix an unused variable warning (PR #150758)

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

[clang] [CIR] Add poison attribute (PR #150760)

2025-07-26 Thread Henrich Lauko via cfe-commits
@@ -629,6 +629,11 @@ static Value tryFoldCastChain(cir::CastOp op) { } OpFoldResult cir::CastOp::fold(FoldAdaptor adaptor) { + if (mlir::isa_and_present(adaptor.getSrc())) { +// Propagate poison value +return PoisonAttr::get(getContext(), getType());

[clang] [CIR] Add poison attribute (PR #150760)

2025-07-26 Thread Henrich Lauko via cfe-commits
@@ -2239,16 +2249,18 @@ static OpFoldResult foldUnaryBitOp(mlir::Attribute inputAttr, llvm::function_ref func, bool poisonZero = false) { + if (mlir::isa_and_present(inputAttr)) { +// Propagate poison value +return inputAttr; + } + aut

[clang] [CIR] Add poison attribute (PR #150760)

2025-07-26 Thread Henrich Lauko via cfe-commits
@@ -1783,6 +1788,11 @@ static bool isBoolNot(cir::UnaryOp op) { // // and the argument of the first one (%0) will be used instead. OpFoldResult cir::UnaryOp::fold(FoldAdaptor adaptor) { + if (auto poison = mlir::dyn_cast_if_present(adaptor.getInput())) { xlau

[clang] [CIR] Add poison attribute (PR #150760)

2025-07-26 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko approved this pull request. lgtm, with minot nits https://github.com/llvm/llvm-project/pull/150760 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Add poison attribute (PR #150760)

2025-07-26 Thread Henrich Lauko via cfe-commits
@@ -127,7 +127,7 @@ def CIR_BoolAttr : CIR_Attr<"Bool", "bool", [TypedAttrInterface]> { // ZeroAttr //===--===// -def ZeroAttr : CIR_TypedAttr<"Zero", "zero"> { +def CIR_ZeroAttr : CIR_TypedAttr<"Zero", "zer

  1   2   3   4   5   6   7   >