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

2025-05-01 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko edited 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

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

2025-05-01 Thread Henrich Lauko via cfe-commits
@@ -185,6 +185,15 @@ class CIRGenBuilderTy : public cir::CIRBaseBuilderTy { } bool isInt(mlir::Type i) { return mlir::isa(i); } + // + // Constant creation helpers + // - + // + cir::ConstantOp getSInt32(int32_t c, mlir::Location loc) { +au

[clang] [CIR] Refactor IntType constraints (PR #138106)

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

[clang] [CIR] Refactor IntType constraints (PR #138106)

2025-05-01 Thread Henrich Lauko via cfe-commits
xlauko wrote: * **#138106** https://app.graphite.dev/github/pr/llvm/llvm-project/138106?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/13810

[clang] [CIR] Refactor IntType constraints (PR #138106)

2025-05-01 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko created https://github.com/llvm/llvm-project/pull/138106 - Adds `CIR_` prefixes to integer type constraints types to disambiguate their names from other dialects. - Renames `PrimitiveInt` to `CIR_AnyFundamentalIntType` to align more with constrian conventions. - Adds

[clang] [mlir] [OpenACC] Implement tile/collapse lowering (PR #138576)

2025-05-06 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] [mlir] [OpenACC] Implement tile/collapse lowering (PR #138576)

2025-05-06 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] Upstream initial support for switch statements (PR #137106)

2025-04-25 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-25 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-25 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 fixed size VectorType (PR #136488)

2025-04-25 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko approved this pull request. lgtm 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] Standardize element type name between Array and Vector Types (PR #137465)

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

[clang] [CIR] Standardize element type name between Array and Vector Types (PR #137465)

2025-04-26 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko commented: lgtm, please backport this to incubator once merged https://github.com/llvm/llvm-project/pull/137465 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commit

[clang] [CIR] Standardize element type name between Array and Vector Types (PR #137465)

2025-04-26 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko edited https://github.com/llvm/llvm-project/pull/137465 ___ 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 #137466)

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

[clang] [CIR] Standardize element type name between Array and Vector Types (PR #137465)

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

[clang] [CIR] Refactor IntType constraints (PR #138106)

2025-05-02 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko updated https://github.com/llvm/llvm-project/pull/138106 >From 4e5819cf7c8e0eb2ca4e2ab354a17d1fce67dafe Mon Sep 17 00:00:00 2001 From: xlauko Date: Thu, 1 May 2025 12:32:12 +0200 Subject: [PATCH] [CIR] Refactor IntType constraints - Adds `CIR_` prefixes to integer typ

[clang] [CIR] Refactor IntType constraints (PR #138106)

2025-05-02 Thread Henrich Lauko via cfe-commits
xlauko wrote: ### Merge activity * **May 2, 3:15 AM EDT**: A user started a stack merge that includes this pull request via [Graphite](https://app.graphite.dev/github/pr/llvm/llvm-project/138106). https://github.com/llvm/llvm-project/pull/138106 __

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

2025-05-02 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko edited 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] Refactor IntType constraints (PR #138106)

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

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

2025-05-02 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko updated https://github.com/llvm/llvm-project/pull/138112 >From fbbee19aa597583de7740bd293ee8a2ecd65a430 Mon Sep 17 00:00:00 2001 From: xlauko Date: Thu, 1 May 2025 12:48:17 +0200 Subject: [PATCH] [CIR] Refactor floating point type constraints - This cleans up moves ci

[clang] [CIR] Upstream extract op for VectorType (PR #138413)

2025-05-03 Thread Henrich Lauko via cfe-commits
@@ -1976,4 +1976,28 @@ def VecCreateOp : CIR_Op<"vec.create", [Pure]> { let hasVerifier = 1; } +//===--===// +// VecExtractOp +//===--===//

[clang] [CIR] Upstream extract op for VectorType (PR #138413)

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

[clang] [CIR] Upstream extract op for VectorType (PR #138413)

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

[clang] [CIR] Upstream extract op for VectorType (PR #138413)

2025-05-03 Thread Henrich Lauko via cfe-commits
@@ -1976,4 +1976,28 @@ def VecCreateOp : CIR_Op<"vec.create", [Pure]> { let hasVerifier = 1; } +//===--===// +// VecExtractOp +//===--===//

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

2025-05-03 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko approved this pull request. lgtm https://github.com/llvm/llvm-project/pull/138415 ___ 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 #138415)

2025-05-03 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko edited https://github.com/llvm/llvm-project/pull/138415 ___ 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-19 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] Upstream support for record packing and padding (PR #136036)

2025-04-18 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko approved this pull request. LGTM 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] LowerGlobalDtors: Use use_empty instead of getNumUses == 0 (#136337) (PR #136361)

2025-04-18 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko created https://github.com/llvm/llvm-project/pull/136361 LowerGlobalDtors: Use use_empty instead of getNumUses == 0 (#136337) [flang] Improve runtime SAME_TYPE_AS() (#135670) The present implementation of the intrinsic function SAME_TYPE_AS() yields false positive .TR

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

2025-04-18 Thread Henrich Lauko via cfe-commits
xlauko wrote: * **#136361** https://app.graphite.dev/github/pr/llvm/llvm-project/136361?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 updated https://github.com/llvm/llvm-project/pull/136361 >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 --- clang/incl

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

2025-04-21 Thread Henrich Lauko via cfe-commits
@@ -1419,6 +1419,50 @@ 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,50 @@ 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 support for accessing structure members (PR #136383)

2025-04-19 Thread Henrich Lauko via cfe-commits
@@ -1310,6 +1310,70 @@ def GetGlobalOp : CIR_Op<"get_global", let hasVerifier = 0; } +//===--===// +// GetMemberOp +//===--===// + +def Get

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

2025-04-19 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko updated https://github.com/llvm/llvm-project/pull/136366 >From 9b3342119c49a5ff6f4d16b720de8331f867a15e 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/Builde

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

2025-04-21 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko edited 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 ZeroAttr use AttrBuilderWithInferredContext (PR #136604)

2025-04-21 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko ready_for_review 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 ZeroAttr use AttrBuilderWithInferredContext (PR #136604)

2025-04-21 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko created https://github.com/llvm/llvm-project/pull/136604 None >From 21dc57c1b7d45f1a8ae014ae0360a86fa31562d6 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

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

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

[clang] [CIR] Upstream extract op for VectorType (PR #138413)

2025-05-07 Thread Henrich Lauko via cfe-commits
xlauko wrote: > > Overall looks good. While here, can you please implement a folder for this > > operation? It should kick-in if both idx and input vector are constants. > > @bcardosolopes I implement it like this snippet > > ``` > OpFoldResult cir::VecExtractOp::fold(FoldAdaptor adaptor) { >

[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] 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 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 extract op for VectorType (PR #138413)

2025-05-07 Thread Henrich Lauko via cfe-commits
xlauko wrote: > As far as I understood, they will not always return ConstVecAttr and IntAttr > because if an index or a vector is coming from parameters, or other > variables, they are not constants in that case, and I am thinking even if the > vector is constant, we will use load or get_globa

[clang] [CIR] Remove inferred context from pointer type getters (PR #138858)

2025-05-07 Thread Henrich Lauko via cfe-commits
xlauko wrote: ### Merge activity * **May 7, 1:16 PM EDT**: A user started a stack merge that includes this pull request via [Graphite](https://app.graphite.dev/github/pr/llvm/llvm-project/138858). https://github.com/llvm/llvm-project/pull/138858 __

[clang] [CIR] Remove inferred context from pointer type getters (PR #138858)

2025-05-07 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko updated https://github.com/llvm/llvm-project/pull/138858 Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-se

[clang] [CIR] Refactor VoidPtr constraint to CIR_VoidPtrType (PR #138859)

2025-05-07 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko updated https://github.com/llvm/llvm-project/pull/138859 Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-se

[clang] [CIR] Remove inferred context from pointer type getters (PR #138858)

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

[clang] [CIR] Refactor VoidPtr constraint to CIR_VoidPtrType (PR #138859)

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

[clang] [CIR] Refactor VoidPtr constraint to CIR_VoidPtrType (PR #138859)

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

[clang] [CIR] Remove implicit options from tablegen files (PR #138860)

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

[clang] [CIR] Remove implicit options from tablegen files (PR #138860)

2025-05-07 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko updated https://github.com/llvm/llvm-project/pull/138860 Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-se

[clang] [CIR] Upstream insert op for VectorType (PR #139146)

2025-05-08 Thread Henrich Lauko via cfe-commits
@@ -1969,6 +1969,43 @@ def VecCreateOp : CIR_Op<"vec.create", [Pure]> { let hasVerifier = 1; } +//===--===// +// VecInsertOp +//===--===//

[clang] [CIR] Upstream insert op for VectorType (PR #139146)

2025-05-08 Thread Henrich Lauko via cfe-commits
@@ -666,18 +678,26 @@ CIRGenFunction::emitArraySubscriptExpr(const clang::ArraySubscriptExpr *e) { assert((e->getIdx() == e->getLHS() || e->getIdx() == e->getRHS()) && "index was neither LHS nor RHS"); - auto emitIdxAfterBase = [&]() -> mlir::Value { + auto emitI

[clang] [CIR] Add PointerLikeType interface support for cir::PointerType (PR #139768)

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

[clang] [CIR][NFC] Remove redundant pointer casts (PR #139898)

2025-05-14 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko created https://github.com/llvm/llvm-project/pull/139898 This mirrors incubator changes from https://github.com/llvm/clangir/pull/1609 >From d83f57555c2c7357131d7527f1a04d0e3558af43 Mon Sep 17 00:00:00 2001 From: xlauko Date: Wed, 14 May 2025 15:30:05 +0200 Subject: [

[clang] [CIR][NFC] Remove redundant pointer casts (PR #139898)

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

[clang] [CIR][NFC] Remove redundant pointer casts (PR #139898)

2025-05-14 Thread Henrich Lauko via cfe-commits
xlauko wrote: * **#139898** https://app.graphite.dev/github/pr/llvm/llvm-project/139898?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/13989

[clang] [CIR] Implement `AnyScalarType` constraint (PR #141033)

2025-05-22 Thread Henrich Lauko via cfe-commits
xlauko wrote: ### Merge activity * **May 22, 4:46 PM UTC**: A user started a stack merge that includes this pull request via [Graphite](https://app.graphite.dev/github/pr/llvm/llvm-project/141033). https://github.com/llvm/llvm-project/pull/141033 _

[clang] [CIR] Implement `AnyScalarType` constraint (PR #141033)

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

<    1   2   3   >