[clang] [CIR] Upstream initial function call support (PR #134673)

2025-04-10 Thread Sirui Mu via cfe-commits
Lancern wrote: Resolved conflicts. https://github.com/llvm/llvm-project/pull/134673 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream initial function call support (PR #134673)

2025-04-10 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Sirui Mu (Lancern) Changes This PR upstreams initial support for making function calls in CIR. Function arguments and return values are not included to keep the patch small for review. Related to #132487 --- Patch is 27.90 KiB, truncate

[clang] [CIR] Upstream initial function call support (PR #134673)

2025-04-10 Thread Sirui Mu via cfe-commits
@@ -0,0 +1,34 @@ +//==-- CIRGenFunctionInfo.h - Representation of fn argument/return types ---==// +// +// 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 initial function call support (PR #134673)

2025-04-10 Thread Sirui Mu via cfe-commits
https://github.com/Lancern closed https://github.com/llvm/llvm-project/pull/134673 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream initial function call support (PR #134673)

2025-04-10 Thread Sirui Mu via cfe-commits
Lancern wrote: I'm going to merge this once the CI is green. https://github.com/llvm/llvm-project/pull/134673 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream initial function call support (PR #134673)

2025-04-10 Thread Sirui Mu via cfe-commits
@@ -1342,6 +1342,47 @@ def FuncOp : CIR_Op<"func", [ let hasVerifier = 1; } +//===--===// +// CallOp +//===--===// + +class CIR_CallOpBase

[clang] [CIR] Upstream initial function call support (PR #134673)

2025-04-10 Thread Sirui Mu via cfe-commits
https://github.com/Lancern updated https://github.com/llvm/llvm-project/pull/134673 >From 88a41a88abbc32e02fb65efc64c830a723932302 Mon Sep 17 00:00:00 2001 From: Sirui Mu Date: Tue, 8 Apr 2025 22:54:24 +0800 Subject: [PATCH] [CIR] Upstream initial function call support --- .../CIR/Dialect/Bui

[clang] [CIR] Upstream initial function call support (PR #134673)

2025-04-09 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes approved this pull request. LGTM after few extra nits https://github.com/llvm/llvm-project/pull/134673 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream initial function call support (PR #134673)

2025-04-09 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes edited https://github.com/llvm/llvm-project/pull/134673 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream initial function call support (PR #134673)

2025-04-09 Thread Bruno Cardoso Lopes via cfe-commits
@@ -0,0 +1,17 @@ +// RUN: cir-opt %s | FileCheck %s + bcardosolopes wrote: Not a review item, more like a general "it will be nice comment": `mlir-opt` has a `--verify-roundtrip` flag, which we should add at some point to `cir-opt` to make such testings even mo

[clang] [CIR] Upstream initial function call support (PR #134673)

2025-04-09 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes edited https://github.com/llvm/llvm-project/pull/134673 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream initial function call support (PR #134673)

2025-04-09 Thread Bruno Cardoso Lopes via cfe-commits
@@ -304,6 +305,102 @@ RValue CIRGenFunction::emitAnyExpr(const Expr *e) { llvm_unreachable("bad evaluation kind"); } +static cir::FuncOp emitFunctionDeclPointer(CIRGenModule &cgm, GlobalDecl gd) { + assert(!cir::MissingFeatures::weakRefReference()); + return cgm.getAddrOfF

[clang] [CIR] Upstream initial function call support (PR #134673)

2025-04-09 Thread Bruno Cardoso Lopes via cfe-commits
@@ -304,6 +305,102 @@ RValue CIRGenFunction::emitAnyExpr(const Expr *e) { llvm_unreachable("bad evaluation kind"); } +static cir::FuncOp emitFunctionDeclPointer(CIRGenModule &cgm, GlobalDecl gd) { + assert(!cir::MissingFeatures::weakRefReference()); + return cgm.getAddrOfF

[clang] [CIR] Upstream initial function call support (PR #134673)

2025-04-09 Thread Bruno Cardoso Lopes via cfe-commits
@@ -1342,6 +1342,47 @@ def FuncOp : CIR_Op<"func", [ let hasVerifier = 1; } +//===--===// +// CallOp +//===--===// + +class CIR_CallOpBase

[clang] [CIR] Upstream initial function call support (PR #134673)

2025-04-09 Thread Andy Kaylor via cfe-commits
andykaylor wrote: @bcardosolopes Are your concerns addressed with the latest version? https://github.com/llvm/llvm-project/pull/134673 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream initial function call support (PR #134673)

2025-04-09 Thread Sirui Mu via cfe-commits
https://github.com/Lancern updated https://github.com/llvm/llvm-project/pull/134673 >From 6995ca5f0ecd34a9f1c2e28de93d0b555264de25 Mon Sep 17 00:00:00 2001 From: Sirui Mu Date: Tue, 8 Apr 2025 22:54:24 +0800 Subject: [PATCH] [CIR] Upstream initial function call support --- .../CIR/Dialect/Bui

[clang] [CIR] Upstream initial function call support (PR #134673)

2025-04-08 Thread Sirui Mu via cfe-commits
@@ -281,3 +281,33 @@ bool CIRGenTypes::isZeroInitializable(clang::QualType t) { return true; } + +const CIRGenFunctionInfo &CIRGenTypes::arrangeCIRFunctionInfo() { + // Lookup or create unique function info. + llvm::FoldingSetNodeID id; + CIRGenFunctionInfo::Profile(id);

[clang] [CIR] Upstream initial function call support (PR #134673)

2025-04-08 Thread Sirui Mu via cfe-commits
@@ -281,3 +281,33 @@ bool CIRGenTypes::isZeroInitializable(clang::QualType t) { return true; } + +const CIRGenFunctionInfo &CIRGenTypes::arrangeCIRFunctionInfo() { + // Lookup or create unique function info. + llvm::FoldingSetNodeID id; + CIRGenFunctionInfo::Profile(id);

[clang] [CIR] Upstream initial function call support (PR #134673)

2025-04-08 Thread Sirui Mu via cfe-commits
@@ -304,6 +305,102 @@ RValue CIRGenFunction::emitAnyExpr(const Expr *e) { llvm_unreachable("bad evaluation kind"); } +static cir::FuncOp emitFunctionDeclPointer(CIRGenModule &cgm, GlobalDecl gd) { + assert(!cir::MissingFeatures::weakRefReference()); + return cgm.getAddrOfF

[clang] [CIR] Upstream initial function call support (PR #134673)

2025-04-08 Thread Sirui Mu via cfe-commits
@@ -304,6 +305,102 @@ RValue CIRGenFunction::emitAnyExpr(const Expr *e) { llvm_unreachable("bad evaluation kind"); } +static cir::FuncOp emitFunctionDeclPointer(CIRGenModule &cgm, GlobalDecl gd) { + assert(!cir::MissingFeatures::weakRefReference()); + return cgm.getAddrOfF

[clang] [CIR] Upstream initial function call support (PR #134673)

2025-04-08 Thread Sirui Mu via cfe-commits
@@ -304,6 +305,102 @@ RValue CIRGenFunction::emitAnyExpr(const Expr *e) { llvm_unreachable("bad evaluation kind"); } +static cir::FuncOp emitFunctionDeclPointer(CIRGenModule &cgm, GlobalDecl gd) { + assert(!cir::MissingFeatures::weakRefReference()); + return cgm.getAddrOfF

[clang] [CIR] Upstream initial function call support (PR #134673)

2025-04-08 Thread Sirui Mu via cfe-commits
@@ -1242,6 +1242,43 @@ def FuncOp : CIR_Op<"func", [ let hasVerifier = 1; } +//===--===// +// CallOp +//===--===// + +class CIR_CallOp extr

[clang] [CIR] Upstream initial function call support (PR #134673)

2025-04-08 Thread Sirui Mu via cfe-commits
@@ -304,6 +305,102 @@ RValue CIRGenFunction::emitAnyExpr(const Expr *e) { llvm_unreachable("bad evaluation kind"); } +static cir::FuncOp emitFunctionDeclPointer(CIRGenModule &cgm, GlobalDecl gd) { + assert(!cir::MissingFeatures::weakRefReference()); + return cgm.getAddrOfF

[clang] [CIR] Upstream initial function call support (PR #134673)

2025-04-08 Thread Sirui Mu via cfe-commits
@@ -466,8 +468,17 @@ CIRGenModule::createCIRFunction(mlir::Location loc, StringRef name, { mlir::OpBuilder::InsertionGuard guard(builder); +// Some global emissions are triggered while emitting a function, e.g. +// void s() { x.method() } +// +// Be sure

[clang] [CIR] Upstream initial function call support (PR #134673)

2025-04-08 Thread Sirui Mu via cfe-commits
@@ -441,6 +441,87 @@ OpFoldResult cir::CastOp::fold(FoldAdaptor adaptor) { return tryFoldCastChain(*this); } +//===--===// +// CallOp +//===---

[clang] [CIR] Upstream initial function call support (PR #134673)

2025-04-08 Thread Sirui Mu via cfe-commits
@@ -403,6 +403,26 @@ class CIRGenFunction : public CIRGenTypeCache { mlir::LogicalResult emitContinueStmt(const clang::ContinueStmt &s); mlir::LogicalResult emitDoStmt(const clang::DoStmt &s); + /// An abstract representation of regular/ObjC call/message targets. + class

[clang] [CIR] Upstream initial function call support (PR #134673)

2025-04-08 Thread Sirui Mu via cfe-commits
https://github.com/Lancern updated https://github.com/llvm/llvm-project/pull/134673 >From cd34ab6e29c88a617b5e9b943be6670ed5a5792b Mon Sep 17 00:00:00 2001 From: Sirui Mu Date: Tue, 8 Apr 2025 22:54:24 +0800 Subject: [PATCH] [CIR] Upstream initial function call support --- .../CIR/Dialect/Bui

[clang] [CIR] Upstream initial function call support (PR #134673)

2025-04-08 Thread Sirui Mu via cfe-commits
@@ -403,6 +403,26 @@ class CIRGenFunction : public CIRGenTypeCache { mlir::LogicalResult emitContinueStmt(const clang::ContinueStmt &s); mlir::LogicalResult emitDoStmt(const clang::DoStmt &s); + /// An abstract representation of regular/ObjC call/message targets. + class

[clang] [CIR] Upstream initial function call support (PR #134673)

2025-04-08 Thread Sirui Mu via cfe-commits
https://github.com/Lancern updated https://github.com/llvm/llvm-project/pull/134673 >From 8cd0b282523a602b0e4677d9b2f556c8014ca72d Mon Sep 17 00:00:00 2001 From: Sirui Mu Date: Tue, 8 Apr 2025 22:54:24 +0800 Subject: [PATCH] [CIR] Upstream initial function call support --- .../CIR/Dialect/Bui

[clang] [CIR] Upstream initial function call support (PR #134673)

2025-04-08 Thread Sirui Mu via cfe-commits
@@ -441,6 +441,87 @@ OpFoldResult cir::CastOp::fold(FoldAdaptor adaptor) { return tryFoldCastChain(*this); } +//===--===// +// CallOp +//===---

[clang] [CIR] Upstream initial function call support (PR #134673)

2025-04-08 Thread Sirui Mu via cfe-commits
@@ -441,6 +441,87 @@ OpFoldResult cir::CastOp::fold(FoldAdaptor adaptor) { return tryFoldCastChain(*this); } +//===--===// +// CallOp +//===---

[clang] [CIR] Upstream initial function call support (PR #134673)

2025-04-08 Thread Sirui Mu via cfe-commits
@@ -1242,6 +1242,43 @@ def FuncOp : CIR_Op<"func", [ let hasVerifier = 1; } +//===--===// +// CallOp +//===--===// + +class CIR_CallOp extr

[clang] [CIR] Upstream initial function call support (PR #134673)

2025-04-08 Thread Sirui Mu via cfe-commits
https://github.com/Lancern updated https://github.com/llvm/llvm-project/pull/134673 >From c2f4fa2b38b13665039509e04d8d364df2899754 Mon Sep 17 00:00:00 2001 From: Sirui Mu Date: Tue, 8 Apr 2025 22:54:24 +0800 Subject: [PATCH] [CIR] Upstream initial function call support --- .../CIR/Dialect/Bui

[clang] [CIR] Upstream initial function call support (PR #134673)

2025-04-07 Thread Sirui Mu via cfe-commits
https://github.com/Lancern created https://github.com/llvm/llvm-project/pull/134673 This PR upstreams initial support for making function calls in CIR. Function arguments and return values are not included to keep the patch small for review. Related to #132487 >From 82f6ce93ca22dd778173100231

[clang] [CIR] Upstream initial function call support (PR #134673)

2025-04-07 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clangir Author: Sirui Mu (Lancern) Changes This PR upstreams initial support for making function calls in CIR. Function arguments and return values are not included to keep the patch small for review. Related to #132487 --- Patch is 27.90 KiB, trunca