[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] Fix extra `;` warning, and replace `new` with emplaceBlock (NFC) (PR #127207)

2025-02-14 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko created https://github.com/llvm/llvm-project/pull/127207 None >From 5ef56ce2cece39467d1eb8526aa23cd89be6442c Mon Sep 17 00:00:00 2001 From: xlauko Date: Fri, 14 Feb 2025 13:58:53 +0100 Subject: [PATCH] [CIR] Fix extra `;` warning, and replace new with emplaceBlock (N

[clang] [CIR] Better handling of `void` function return (PR #128089)

2025-02-21 Thread Henrich Lauko via cfe-commits
@@ -375,11 +409,48 @@ void printFuncTypeArgs(mlir::AsmPrinter &p, mlir::ArrayRef params, p << ')'; } +// Use a custom parser to handle the optional return and argument types without +// an optional anchor. +static mlir::ParseResult parseFuncType(mlir::AsmParser &p, +

[clang] [CIR] Better handling of `void` function return (PR #128089)

2025-02-21 Thread Henrich Lauko via cfe-commits
@@ -375,11 +409,48 @@ void printFuncTypeArgs(mlir::AsmPrinter &p, mlir::ArrayRef params, p << ')'; } +// Use a custom parser to handle the optional return and argument types without +// an optional anchor. +static mlir::ParseResult parseFuncType(mlir::AsmParser &p, +

[clang] [CIR] Better handling of `void` function return (PR #128089)

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

[clang] [CIR] Better handling of `void` function return (PR #128089)

2025-02-21 Thread Henrich Lauko via cfe-commits
@@ -375,11 +410,48 @@ void printFuncTypeArgs(mlir::AsmPrinter &p, mlir::ArrayRef params, p << ')'; } +// Use a custom parser to handle the optional return and argument types without +// an optional anchor. +static mlir::ParseResult parseFuncType(mlir::AsmParser &p, +

[clang] [CIR] Better handling of `void` function return (PR #128089)

2025-02-21 Thread Henrich Lauko via cfe-commits
@@ -375,11 +410,48 @@ void printFuncTypeArgs(mlir::AsmPrinter &p, mlir::ArrayRef params, p << ')'; } +// Use a custom parser to handle the optional return and argument types without +// an optional anchor. +static mlir::ParseResult parseFuncType(mlir::AsmParser &p, +

[clang] [CIR] Better handling of `void` function return (PR #128089)

2025-02-21 Thread Henrich Lauko via cfe-commits
@@ -375,11 +410,48 @@ void printFuncTypeArgs(mlir::AsmPrinter &p, mlir::ArrayRef params, p << ')'; } +// Use a custom parser to handle the optional return and argument types without +// an optional anchor. +static mlir::ParseResult parseFuncType(mlir::AsmParser &p, +

[clang] [CIR] Better handling of `void` function return (PR #128089)

2025-02-21 Thread Henrich Lauko via cfe-commits
@@ -375,11 +410,48 @@ void printFuncTypeArgs(mlir::AsmPrinter &p, mlir::ArrayRef params, p << ')'; } +// Use a custom parser to handle the optional return and argument types without +// an optional anchor. +static mlir::ParseResult parseFuncType(mlir::AsmParser &p, +

[clang] [CIR] Better handling of `void` function return (PR #128089)

2025-02-21 Thread Henrich Lauko via cfe-commits
@@ -331,9 +335,38 @@ FuncType FuncType::clone(TypeRange inputs, TypeRange results) const { return get(llvm::to_vector(inputs), results[0], isVarArg()); } -mlir::ParseResult parseFuncTypeArgs(mlir::AsmParser &p, -llvm::SmallVector ¶ms, -

[clang] [CIR] Better handling of `void` function return (PR #128089)

2025-02-21 Thread Henrich Lauko via cfe-commits
@@ -331,9 +335,38 @@ FuncType FuncType::clone(TypeRange inputs, TypeRange results) const { return get(llvm::to_vector(inputs), results[0], isVarArg()); } -mlir::ParseResult parseFuncTypeArgs(mlir::AsmParser &p, -llvm::SmallVector ¶ms, -

[clang] [CIR] Better handling of `void` function return (PR #128089)

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

[clang] [CIR] Better handling of `void` function return (PR #128089)

2025-02-21 Thread Henrich Lauko via cfe-commits
@@ -375,11 +409,48 @@ void printFuncTypeArgs(mlir::AsmPrinter &p, mlir::ArrayRef params, p << ')'; } +// Use a custom parser to handle the optional return and argument types without +// an optional anchor. +static mlir::ParseResult parseFuncType(mlir::AsmParser &p, +

[clang] [CIR] Better handling of `void` function return (PR #128089)

2025-02-21 Thread Henrich Lauko via cfe-commits
@@ -375,11 +409,48 @@ void printFuncTypeArgs(mlir::AsmPrinter &p, mlir::ArrayRef params, p << ')'; } +// Use a custom parser to handle the optional return and argument types without +// an optional anchor. +static mlir::ParseResult parseFuncType(mlir::AsmParser &p, +

[clang] [CIR] Better handling of `void` function return (PR #128089)

2025-02-21 Thread Henrich Lauko via cfe-commits
@@ -2,12 +2,12 @@ // RUN: %clang_cc1 -std=c++20 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir %s -o - | FileCheck %s xlauko wrote: I presume `clang` cannot load `cir` files yet? So nothing is really testing parsers? https://github.com/llvm/llvm-projec

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

2025-02-20 Thread Henrich Lauko via cfe-commits
@@ -2958,6 +2958,8 @@ defm clangir : BoolFOption<"clangir", BothFlags<[], [ClangOption, CC1Option], "">>; def emit_cir : Flag<["-"], "emit-cir">, Visibility<[ClangOption, CC1Option]>, Group, HelpText<"Build ASTs and then lower to ClangIR">; +def emit_cir_mlir : Flag<["-"],

[clang] [CIR] Better handling of `void` function return (PR #128089)

2025-02-21 Thread Henrich Lauko via cfe-commits
@@ -331,9 +335,38 @@ FuncType FuncType::clone(TypeRange inputs, TypeRange results) const { return get(llvm::to_vector(inputs), results[0], isVarArg()); } -mlir::ParseResult parseFuncTypeArgs(mlir::AsmParser &p, -llvm::SmallVector ¶ms, -

[clang] [CIR] Add cir-opt tool to exercise CIR dialect parsing (PR #128254)

2025-02-22 Thread Henrich Lauko via cfe-commits
@@ -0,0 +1,32 @@ +get_property(dialect_libs GLOBAL PROPERTY MLIR_DIALECT_LIBS) +get_property(conversion_libs GLOBAL PROPERTY MLIR_CONVERSION_LIBS) + +include_directories(${LLVM_MAIN_SRC_DIR}/../mlir/include) +include_directories(${CMAKE_BINARY_DIR}/tools/mlir/include) + +add_clang

[clang] [CIR] Add cir-opt tool to exercise CIR dialect parsing (PR #128254)

2025-02-22 Thread Henrich Lauko via cfe-commits
@@ -0,0 +1,46 @@ +//===--===// +// +// 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] Add cir-opt tool to exercise CIR dialect parsing (PR #128254)

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

[clang] [CIR] Add cir-opt tool to exercise CIR dialect parsing (PR #128254)

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

[clang] [CIR] Upstream type `bool` (PR #128601)

2025-02-25 Thread Henrich Lauko via cfe-commits
@@ -266,6 +266,22 @@ def CIR_PointerType : CIR_Type<"Pointer", "ptr", }]; } +//===--===// +// BoolType +//===--===// + +def CIR_BoolType :

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

2025-02-20 Thread Henrich Lauko via cfe-commits
@@ -2958,6 +2958,8 @@ defm clangir : BoolFOption<"clangir", BothFlags<[], [ClangOption, CC1Option], "">>; def emit_cir : Flag<["-"], "emit-cir">, Visibility<[ClangOption, CC1Option]>, Group, HelpText<"Build ASTs and then lower to ClangIR">; +def emit_cir_mlir : Flag<["-"],

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

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

[clang] [CIR] Function type return type improvements (PR #128787)

2025-02-26 Thread Henrich Lauko via cfe-commits
xlauko wrote: You don't need to write custom printer/parser for return type. As suggested here https://github.com/llvm/clangir/pull/1413 These can be autogenerated from assembly format: ``` let assemblyFormat = [{ `<` custom($inputs, $varArg) (`->` $optionalReturnType^)? `>` }]; ``` ht

[clang] [CIR] Upstream simple function bodies (PR #127674)

2025-02-19 Thread Henrich Lauko via cfe-commits
@@ -0,0 +1,53 @@ +// Simple functions +// RUN: %clang_cc1 -std=c++20 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir %s -o - | FileCheck %s + +void empty() { } +// CHECK: cir.func @empty() -> !cir.void { xlauko wrote: Ideally once there will be abi-lib: h

[clang] [CIR] Upstream simple function bodies (PR #127674)

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

[clang] [CIR] Upstream simple function bodies (PR #127674)

2025-02-19 Thread Henrich Lauko via cfe-commits
@@ -0,0 +1,134 @@ +//===--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang] [CIR] Upstream simple function bodies (PR #127674)

2025-02-19 Thread Henrich Lauko via cfe-commits
@@ -0,0 +1,134 @@ +//===--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang] [CIR] Upstream simple function bodies (PR #127674)

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

[clang] [CIR] Upstream global variable linkage types (PR #129072)

2025-02-28 Thread Henrich Lauko via cfe-commits
@@ -210,6 +223,193 @@ void CIRGenModule::emitGlobalDefinition(clang::GlobalDecl gd, llvm_unreachable("Invalid argument to CIRGenModule::emitGlobalDefinition"); } +static bool shouldBeInCOMDAT(CIRGenModule &cgm, const Decl &d) { + assert(!cir::MissingFeatures::supportComdat

[clang] [CIR] Upstream global variable linkage types (PR #129072)

2025-02-28 Thread Henrich Lauko via cfe-commits
@@ -0,0 +1,63 @@ +//===- CIROpInterfaces.td - CIR Op Interface Definitions *- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang] [CIR] Upstream global variable linkage types (PR #129072)

2025-02-28 Thread Henrich Lauko via cfe-commits
@@ -0,0 +1,63 @@ +//===- CIROpInterfaces.td - CIR Op Interface Definitions *- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang] [CIR] Upstream global variable linkage types (PR #129072)

2025-02-28 Thread Henrich Lauko via cfe-commits
@@ -210,6 +223,193 @@ void CIRGenModule::emitGlobalDefinition(clang::GlobalDecl gd, llvm_unreachable("Invalid argument to CIRGenModule::emitGlobalDefinition"); } +static bool shouldBeInCOMDAT(CIRGenModule &cgm, const Decl &d) { + assert(!cir::MissingFeatures::supportComdat

[clang] [CIR] Upstream global variable linkage types (PR #129072)

2025-02-28 Thread Henrich Lauko via cfe-commits
@@ -210,6 +223,193 @@ void CIRGenModule::emitGlobalDefinition(clang::GlobalDecl gd, llvm_unreachable("Invalid argument to CIRGenModule::emitGlobalDefinition"); } +static bool shouldBeInCOMDAT(CIRGenModule &cgm, const Decl &d) { + assert(!cir::MissingFeatures::supportComdat

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

2025-03-06 Thread Henrich Lauko via cfe-commits
@@ -94,10 +203,59 @@ void CIRGenFunction::emitVarDecl(const VarDecl &d) { assert(d.hasLocalStorage()); - assert(!cir::MissingFeatures::opAllocaVarDeclContext()); + CIRGenFunction::VarDeclContext varDeclCtx{*this, &d}; return emitAutoVarDecl(d); } +void CIRGenFunctio

[clang] [CIR] Upstream global variable linkage types (PR #129072)

2025-03-04 Thread Henrich Lauko via cfe-commits
@@ -0,0 +1,119 @@ +//===--===// +//-*-===// xlauko wrote: ```suggestion ``` https://github.com/llvm/llvm-project/pull/129072 ___ cfe-commits mailing l

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

2025-03-06 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] 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 break and continue statements (PR #134181)

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

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

2025-04-03 Thread Henrich Lauko via cfe-commits
@@ -569,6 +569,35 @@ def YieldOp : CIR_Op<"yield", [ReturnLike, Terminator, ]; } +//===--===// +// BreakOp +//===--===// + +def BreakOp : C

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

2025-03-27 Thread Henrich Lauko via cfe-commits
@@ -710,6 +710,89 @@ class ScalarExprEmitter : public StmtVisitor { HANDLEBINOP(Xor) HANDLEBINOP(Or) #undef HANDLEBINOP + + mlir::Value emitCmp(const BinaryOperator *e) { +mlir::Value result; +QualType lhsTy = e->getLHS()->getType(); +QualType rhsTy = e->getRH

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

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

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

2025-04-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] [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

  1   2   >