[clang] [CIR][NFC] Eliminate ArgInfo structure (PR #140612)

2025-05-20 Thread Sirui Mu via cfe-commits
https://github.com/Lancern edited https://github.com/llvm/llvm-project/pull/140612 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR][NFC] Eliminate ArgInfo structure (PR #140612)

2025-05-20 Thread Sirui Mu via cfe-commits
@@ -72,16 +68,15 @@ class RequiredArgs { class CIRGenFunctionInfo final : public llvm::FoldingSetNode, - private llvm::TrailingObjects { - using ArgInfo = CIRGenFunctionInfoArgInfo; - + private llvm::TrailingObjects { Lancern wrote: It would be

[clang] [CIR][NFC] Eliminate ArgInfo structure (PR #140612)

2025-05-20 Thread Sirui Mu via cfe-commits
https://github.com/Lancern approved this pull request. LGTM with one nit https://github.com/llvm/llvm-project/pull/140612 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Add support for indirect calls (PR #139748)

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

[clang] [CIR] Add support for indirect calls (PR #139748)

2025-05-20 Thread Sirui Mu via cfe-commits
https://github.com/Lancern updated https://github.com/llvm/llvm-project/pull/139748 >From 71009b450a333d4537d9a84176707656c5bdcea1 Mon Sep 17 00:00:00 2001 From: Sirui Mu Date: Thu, 15 May 2025 23:01:18 +0800 Subject: [PATCH] [CIR] Add support for indirect calls --- .../CIR/Dialect/Builder/CI

[clang] [CIR] Upstream support for C++ member function calls (PR #140290)

2025-05-18 Thread Sirui Mu via cfe-commits
@@ -1148,6 +1146,35 @@ mlir::Value CIRGenFunction::emitAlloca(StringRef name, mlir::Type ty, return addr; } +// Note: this function also emit constructor calls to support a MSVC extensions +// allowing explicit constructor function call. +RValue CIRGenFunction::emitCXXMembe

[clang] [CIR] Upstream support for C++ member function calls (PR #140290)

2025-05-18 Thread Sirui Mu via cfe-commits
https://github.com/Lancern edited https://github.com/llvm/llvm-project/pull/140290 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream support for C++ member function calls (PR #140290)

2025-05-18 Thread Sirui Mu via cfe-commits
https://github.com/Lancern approved this pull request. https://github.com/llvm/llvm-project/pull/140290 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream support for C++ member function calls (PR #140290)

2025-05-18 Thread Sirui Mu via cfe-commits
https://github.com/Lancern approved this pull request. https://github.com/llvm/llvm-project/pull/140290 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Add support for indirect calls (PR #139748)

2025-05-17 Thread Sirui Mu via cfe-commits
@@ -1500,6 +1507,14 @@ static void prepareTypeConverter(mlir::LLVMTypeConverter &converter, converter.addConversion([&](cir::BF16Type type) -> mlir::Type { return mlir::BFloat16Type::get(type.getContext()); }); + converter.addConversion([&](cir::FuncType type) -> mlir

[clang] [CIR] Add support for indirect calls (PR #139748)

2025-05-17 Thread Sirui Mu via cfe-commits
https://github.com/Lancern edited https://github.com/llvm/llvm-project/pull/139748 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Add support for indirect calls (PR #139748)

2025-05-17 Thread Sirui Mu via cfe-commits
https://github.com/Lancern edited https://github.com/llvm/llvm-project/pull/139748 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Add support for indirect calls (PR #139748)

2025-05-17 Thread Sirui Mu via cfe-commits
https://github.com/Lancern edited https://github.com/llvm/llvm-project/pull/139748 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Add support for indirect calls (PR #139748)

2025-05-17 Thread Sirui Mu via cfe-commits
@@ -937,8 +937,28 @@ CIRGenCallee CIRGenFunction::emitCallee(const clang::Expr *e) { return emitDirectCallee(cgm, funcDecl); } - cgm.errorNYI(e->getSourceRange(), "Unsupported callee kind"); - return {}; + assert(!cir::MissingFeatures::opCallPseudoDtor());

[clang] [CIR] Add support for indirect calls (PR #139748)

2025-05-17 Thread Sirui Mu via cfe-commits
@@ -539,15 +573,16 @@ mlir::ParseResult cir::CallOp::parse(mlir::OpAsmParser &parser, } void cir::CallOp::print(mlir::OpAsmPrinter &p) { - printCallCommon(*this, getCalleeAttr(), p); + mlir::Value indirectCallee = isIndirect() ? getIndirectCall() : nullptr; + printCallComm

[clang] [CIR] Add support for indirect calls (PR #139748)

2025-05-17 Thread Sirui Mu via cfe-commits
@@ -464,15 +464,35 @@ OpFoldResult cir::CastOp::fold(FoldAdaptor adaptor) { // CallOp //===--===// +mlir::OperandRange cir::CallOp::getArgOperands() { + if (isIndirect()) +return getArgs().drop_front(1);

[clang] [CIR] Add support for indirect calls (PR #139748)

2025-05-17 Thread Sirui Mu via cfe-commits
@@ -1861,13 +1867,23 @@ def CallOp : CIR_CallOpBase<"call", [NoRegionArguments]> { let arguments = commonArgs; let builders = [OpBuilder<(ins "mlir::SymbolRefAttr":$callee, - "mlir::Type":$resType, - "mlir::V

[clang] [CIR] Add support for indirect calls (PR #139748)

2025-05-17 Thread Sirui Mu via cfe-commits
@@ -1861,13 +1867,23 @@ def CallOp : CIR_CallOpBase<"call", [NoRegionArguments]> { let arguments = commonArgs; let builders = [OpBuilder<(ins "mlir::SymbolRefAttr":$callee, - "mlir::Type":$resType, - "mlir::V

[clang] [CIR] Add support for indirect calls (PR #139748)

2025-05-17 Thread Sirui Mu via cfe-commits
https://github.com/Lancern updated https://github.com/llvm/llvm-project/pull/139748 >From 614849751f24c47c6da53ebc1fb296b806223557 Mon Sep 17 00:00:00 2001 From: Sirui Mu Date: Thu, 15 May 2025 23:01:18 +0800 Subject: [PATCH] [CIR] Add support for indirect calls --- .../CIR/Dialect/Builder/CI

[clang] [CIR] Add support for indirect calls (PR #139748)

2025-05-17 Thread Sirui Mu via cfe-commits
https://github.com/Lancern updated https://github.com/llvm/llvm-project/pull/139748 >From eb08d386728d1d9876f68dc40b4042bace9e5d5c Mon Sep 17 00:00:00 2001 From: Sirui Mu Date: Thu, 15 May 2025 23:01:18 +0800 Subject: [PATCH] [CIR] Add support for indirect calls --- .../CIR/Dialect/Builder/CI

[clang] [CIR] Add support for indirect calls (PR #139748)

2025-05-15 Thread Sirui Mu via cfe-commits
https://github.com/Lancern updated https://github.com/llvm/llvm-project/pull/139748 >From 8c6a8c37037634ea48eb94e022cd76c0cececb84 Mon Sep 17 00:00:00 2001 From: Sirui Mu Date: Thu, 15 May 2025 23:01:18 +0800 Subject: [PATCH] [CIR] Add support for indirect calls --- .../CIR/Dialect/Builder/CI

[clang] [CIR] Add support for indirect calls (PR #139748)

2025-05-14 Thread Sirui Mu via cfe-commits
@@ -1500,6 +1507,14 @@ static void prepareTypeConverter(mlir::LLVMTypeConverter &converter, converter.addConversion([&](cir::BF16Type type) -> mlir::Type { return mlir::BFloat16Type::get(type.getContext()); }); + converter.addConversion([&](cir::FuncType type) -> mlir

[clang] [CIR] Add support for indirect calls (PR #139748)

2025-05-14 Thread Sirui Mu via cfe-commits
@@ -1837,16 +1835,24 @@ class CIR_CallOpBase extra_traits = []> // the upstreaming process moves on. The verifiers is also missing for now, // will add in the future. - dag commonArgs = (ins FlatSymbolRefAttr:$callee, -Variadic:$args); + dag comm

[clang] [CIR] Add support for indirect calls (PR #139748)

2025-05-14 Thread Sirui Mu via cfe-commits
@@ -1500,6 +1507,14 @@ static void prepareTypeConverter(mlir::LLVMTypeConverter &converter, converter.addConversion([&](cir::BF16Type type) -> mlir::Type { return mlir::BFloat16Type::get(type.getContext()); }); + converter.addConversion([&](cir::FuncType type) -> mlir

[clang] [CIR] Add support for indirect calls (PR #139748)

2025-05-14 Thread Sirui Mu via cfe-commits
https://github.com/Lancern updated https://github.com/llvm/llvm-project/pull/139748 Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-s

[clang] [CIR] Add support for indirect calls (PR #139748)

2025-05-13 Thread Sirui Mu via cfe-commits
https://github.com/Lancern created https://github.com/llvm/llvm-project/pull/139748 This PR adds support for indirect calls to the `cir.call` operation. >From 786327894695a73ec80ec256892ca51e68fa5389 Mon Sep 17 00:00:00 2001 From: Sirui Mu Date: Tue, 13 May 2025 23:02:08 +0800 Subject: [PATCH]

[clang] [CIR] Cleanup support for C functions (PR #136854)

2025-05-10 Thread Sirui Mu via cfe-commits
https://github.com/Lancern approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/136854 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] LLVMIR lowering for cir.call (PR #138873)

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

[clang] [CIR][NFC] Remove ABI handling from CIRGen call handling (PR #139159)

2025-05-09 Thread Sirui Mu via cfe-commits
https://github.com/Lancern approved this pull request. https://github.com/llvm/llvm-project/pull/139159 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] LLVMIR lowering for cir.call (PR #138873)

2025-05-08 Thread Sirui Mu via cfe-commits
https://github.com/Lancern updated https://github.com/llvm/llvm-project/pull/138873 Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-s

[clang] [CIR] LLVMIR lowering for cir.call (PR #138873)

2025-05-07 Thread Sirui Mu via cfe-commits
https://github.com/Lancern created https://github.com/llvm/llvm-project/pull/138873 This PR adds LLVMIR lowering support for the `cir.call` operation. Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e; font-famil

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

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

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

2025-05-01 Thread Sirui Mu via cfe-commits
Lancern wrote: Rebased onto the latest `main`. Will land later if no one have more comments. https://github.com/llvm/llvm-project/pull/136810 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-co

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

2025-05-01 Thread Sirui Mu via cfe-commits
@@ -446,8 +446,31 @@ OpFoldResult cir::CastOp::fold(FoldAdaptor adaptor) { // CallOp //===--===// +mlir::Operation::operand_iterator cir::CallOp::arg_operand_begin() { + assert(!cir::MissingFeatures::opCallI

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

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

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

2025-05-01 Thread Sirui Mu via cfe-commits
@@ -1516,6 +1520,41 @@ class CIR_CallOpBase extra_traits = []> !listconcat(extra_traits, [DeclareOpInterfaceMethods, DeclareOpInterfaceMethods])> { + let extraClassDeclaration = [{ +/// Get the argument operands to the c

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

2025-05-01 Thread Sirui Mu via cfe-commits
https://github.com/Lancern updated https://github.com/llvm/llvm-project/pull/136810 >From e5e7bd931dd409546d04237bd61eab67d6ba6451 Mon Sep 17 00:00:00 2001 From: Sirui Mu Date: Fri, 2 May 2025 00:31:08 +0800 Subject: [PATCH] [CIR] Upstream cir.call with scalar arguments --- .../CIR/Dialect/Bu

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

2025-05-01 Thread Sirui Mu via cfe-commits
https://github.com/Lancern updated https://github.com/llvm/llvm-project/pull/136810 >From e9334137d0d1b968ac4d0e59af9f1b04e6b639ac Mon Sep 17 00:00:00 2001 From: Sirui Mu Date: Fri, 2 May 2025 00:31:08 +0800 Subject: [PATCH] [CIR] Upstream cir.call with scalar arguments --- .../CIR/Dialect/Bu

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

2025-04-28 Thread Sirui Mu via cfe-commits
@@ -68,20 +168,70 @@ static cir::CIRCallOpInterface emitCallLikeOp(CIRGenFunction &cgf, assert(builder.getInsertionBlock() && "expected valid basic block"); assert(!cir::MissingFeatures::opCallIndirect()); - return builder.createCallOp(callLoc, directFuncOp); + return b

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

2025-04-26 Thread Sirui Mu via cfe-commits
https://github.com/Lancern updated https://github.com/llvm/llvm-project/pull/136810 >From 6fa07927f48cc820fe7babe6d85a32e8e6cc781b Mon Sep 17 00:00:00 2001 From: Sirui Mu Date: Wed, 23 Apr 2025 12:14:40 +0800 Subject: [PATCH] [CIR] Upstream cir.call with scalar arguments --- .../CIR/Dialect/B

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

2025-04-26 Thread Sirui Mu via cfe-commits
@@ -17,3 +17,15 @@ int f4() { // CHECK-LABEL: cir.func @f4() -> !s32i // CHECK: %[[#x:]] = cir.call @f3() : () -> !s32i // CHECK-NEXT:cir.store %[[#x]], %{{.+}} : !s32i, !cir.ptr + +int f5(int a, int *b, bool c); +int f6() { + int b = 1; + return f5(2, &b, false);

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

2025-04-26 Thread Sirui Mu via cfe-commits
@@ -32,7 +32,13 @@ void X8664ABIInfo::computeInfo(CIRGenFunctionInfo &funcInfo) const { // Top level CIR has unlimited arguments and return types. Lowering for ABI // specific concerns should happen during a lowering phase. Assume everything // is direct for now. - asse

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

2025-04-26 Thread Sirui Mu via cfe-commits
@@ -68,20 +168,70 @@ static cir::CIRCallOpInterface emitCallLikeOp(CIRGenFunction &cgf, assert(builder.getInsertionBlock() && "expected valid basic block"); assert(!cir::MissingFeatures::opCallIndirect()); - return builder.createCallOp(callLoc, directFuncOp); + return b

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

2025-04-26 Thread Sirui Mu via cfe-commits
@@ -18,22 +18,118 @@ using namespace clang; using namespace clang::CIRGen; -CIRGenFunctionInfo *CIRGenFunctionInfo::create(CanQualType resultType) { - void *buffer = operator new(totalSizeToAlloc(1)); +CIRGenFunctionInfo * +CIRGenFunctionInfo::create(CanQualType resultType, +

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

2025-04-26 Thread Sirui Mu via cfe-commits
@@ -18,22 +18,118 @@ using namespace clang; using namespace clang::CIRGen; -CIRGenFunctionInfo *CIRGenFunctionInfo::create(CanQualType resultType) { - void *buffer = operator new(totalSizeToAlloc(1)); +CIRGenFunctionInfo * +CIRGenFunctionInfo::create(CanQualType resultType, +

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

2025-04-26 Thread Sirui Mu via cfe-commits
@@ -18,22 +18,118 @@ using namespace clang; using namespace clang::CIRGen; -CIRGenFunctionInfo *CIRGenFunctionInfo::create(CanQualType resultType) { - void *buffer = operator new(totalSizeToAlloc(1)); +CIRGenFunctionInfo * +CIRGenFunctionInfo::create(CanQualType resultType, +

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

2025-04-26 Thread Sirui Mu via cfe-commits
@@ -18,22 +18,118 @@ using namespace clang; using namespace clang::CIRGen; -CIRGenFunctionInfo *CIRGenFunctionInfo::create(CanQualType resultType) { - void *buffer = operator new(totalSizeToAlloc(1)); +CIRGenFunctionInfo * +CIRGenFunctionInfo::create(CanQualType resultType, +

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

2025-04-26 Thread Sirui Mu via cfe-commits
@@ -18,22 +18,118 @@ using namespace clang; using namespace clang::CIRGen; -CIRGenFunctionInfo *CIRGenFunctionInfo::create(CanQualType resultType) { - void *buffer = operator new(totalSizeToAlloc(1)); +CIRGenFunctionInfo * +CIRGenFunctionInfo::create(CanQualType resultType, +

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

2025-04-26 Thread Sirui Mu via cfe-commits
@@ -1516,6 +1520,41 @@ class CIR_CallOpBase extra_traits = []> !listconcat(extra_traits, [DeclareOpInterfaceMethods, DeclareOpInterfaceMethods])> { + let extraClassDeclaration = [{ +/// Get the argument operands to the c

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

2025-04-26 Thread Sirui Mu via cfe-commits
@@ -214,14 +214,15 @@ class CIRBaseBuilderTy : public mlir::OpBuilder { //======// cir::CallOp createCallOp(mlir::Location loc, mlir::SymbolRefAttr callee, - mlir::Type returnTyp

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

2025-04-26 Thread Sirui Mu via cfe-commits
@@ -152,3 +303,105 @@ RValue CIRGenFunction::emitCall(const CIRGenFunctionInfo &funcInfo, return ret; } + +void CIRGenFunction::emitCallArg(CallArgList &args, const clang::Expr *e, + clang::QualType argType) { + assert(argType->isReferenceTy

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

2025-04-26 Thread Sirui Mu via cfe-commits
@@ -68,20 +168,70 @@ static cir::CIRCallOpInterface emitCallLikeOp(CIRGenFunction &cgf, assert(builder.getInsertionBlock() && "expected valid basic block"); assert(!cir::MissingFeatures::opCallIndirect()); - return builder.createCallOp(callLoc, directFuncOp); + return b

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

2025-04-26 Thread Sirui Mu via cfe-commits
@@ -18,22 +18,118 @@ using namespace clang; using namespace clang::CIRGen; -CIRGenFunctionInfo *CIRGenFunctionInfo::create(CanQualType resultType) { - void *buffer = operator new(totalSizeToAlloc(1)); +CIRGenFunctionInfo * +CIRGenFunctionInfo::create(CanQualType resultType, +

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

2025-04-26 Thread Sirui Mu via cfe-commits
@@ -1496,6 +1496,10 @@ def FuncOp : CIR_Op<"func", [ return getFunctionType().getReturnTypes(); } +// TODO(cir): this should be an operand attribute, but for now we just hard- +// wire this as a function. Will later add a $no_proto argument to this op. +

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

2025-04-26 Thread Sirui Mu via cfe-commits
https://github.com/Lancern updated https://github.com/llvm/llvm-project/pull/136810 >From 8f7b72f8dfe2e4fb32669a344f95be7ce04dae3d Mon Sep 17 00:00:00 2001 From: Sirui Mu Date: Wed, 23 Apr 2025 12:14:40 +0800 Subject: [PATCH] [CIR] Upstream cir.call with scalar arguments --- .../CIR/Dialect/B

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

2025-04-22 Thread Sirui Mu via cfe-commits
https://github.com/Lancern created https://github.com/llvm/llvm-project/pull/136810 This PR upstreams support for scalar arguments in `cir.call` operation. Related to #132487 . >From 557cae2daea53723010390cdf545721dd9ad7de4 Mon Sep 17 00:00:00 2001 From: Sirui Mu Date: Wed, 23 Apr 2025 12:14:

[clang] [Clang] Add support for GCC bound member functions extension (PR #135649)

2025-04-21 Thread Sirui Mu via cfe-commits
@@ -0,0 +1,105 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --check-globals all --version 5 +// RUN: %clang_cc1 -triple x86_64-linux-gnu -Wno-pmf-conversions %s -O3 -emit-llvm -o - | FileCheck %s + +struct A { + int data; +//. +//

[clang] [llvm] [RISCV] Add processor definition for XiangShan-KunMingHu-V2R2 (PR #123193)

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

[clang] [CIR] cir.call with scalar return type (PR #135552)

2025-04-17 Thread Sirui Mu via cfe-commits
@@ -18,9 +18,12 @@ using namespace clang; using namespace clang::CIRGen; -CIRGenFunctionInfo *CIRGenFunctionInfo::create() { - // For now we just create an empty CIRGenFunctionInfo. - CIRGenFunctionInfo *fi = new CIRGenFunctionInfo(); +CIRGenFunctionInfo *CIRGenFunctionInfo:

[clang] [CIR] cir.call with scalar return type (PR #135552)

2025-04-17 Thread Sirui Mu via cfe-commits
@@ -18,9 +18,12 @@ using namespace clang; using namespace clang::CIRGen; -CIRGenFunctionInfo *CIRGenFunctionInfo::create() { - // For now we just create an empty CIRGenFunctionInfo. - CIRGenFunctionInfo *fi = new CIRGenFunctionInfo(); +CIRGenFunctionInfo *CIRGenFunctionInfo:

[clang] [CIR] cir.call with scalar return type (PR #135552)

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

[clang] [CIR] cir.call with scalar return type (PR #135552)

2025-04-17 Thread Sirui Mu via cfe-commits
https://github.com/Lancern updated https://github.com/llvm/llvm-project/pull/135552 >From 0d5b4290c6bbcf8654e6898bb20182c252243e07 Mon Sep 17 00:00:00 2001 From: Sirui Mu Date: Sun, 13 Apr 2025 23:34:21 +0800 Subject: [PATCH] [CIR] cir.call with scalar return type This patch introduces support

[clang] [CIR] cir.call with scalar return type (PR #135552)

2025-04-16 Thread Sirui Mu via cfe-commits
Lancern wrote: > I'd still love it if we could get one of the Code gen owners to let us know > what is going on with this/see if this is somethign they want for classic > codegen, but they can RAC. Could we open an issue to track this? https://github.com/llvm/llvm-project/pull/135552

[clang] [CIR] cir.call with scalar return type (PR #135552)

2025-04-16 Thread Sirui Mu via cfe-commits
@@ -0,0 +1,92 @@ +//==-- ABIArgInfo.h - Abstract info regarding ABI-specific arguments ---==// +// +// 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] cir.call with scalar return type (PR #135552)

2025-04-16 Thread Sirui Mu via cfe-commits
@@ -14,9 +14,14 @@ using namespace clang::CIRGen; CIRGenTypes::CIRGenTypes(CIRGenModule &genModule) : cgm(genModule), astContext(genModule.getASTContext()), - builder(cgm.getBuilder()) {} + builder(cgm.getBuilder()), + theABIInfo(cgm.getTargetCIRGenInfo().ge

[clang] [CIR] cir.call with scalar return type (PR #135552)

2025-04-16 Thread Sirui Mu via cfe-commits
https://github.com/Lancern updated https://github.com/llvm/llvm-project/pull/135552 >From cf894c58a8058956b296e499c84ccd528121addf Mon Sep 17 00:00:00 2001 From: Sirui Mu Date: Sun, 13 Apr 2025 23:34:21 +0800 Subject: [PATCH] [CIR] cir.call with scalar return type This patch introduces support

[clang] [CIR] cir.call with scalar return type (PR #135552)

2025-04-16 Thread Sirui Mu via cfe-commits
@@ -303,14 +305,23 @@ const CIRGenFunctionInfo &CIRGenTypes::arrangeCIRFunctionInfo() { assert(!cir::MissingFeatures::opCallCallConv()); // Construction the function info. We co-allocate the ArgInfos. - fi = CIRGenFunctionInfo::create(); + fi = CIRGenFunctionInfo::creat

[clang] [CIR] cir.call with scalar return type (PR #135552)

2025-04-16 Thread Sirui Mu via cfe-commits
@@ -18,9 +18,12 @@ using namespace clang; using namespace clang::CIRGen; -CIRGenFunctionInfo *CIRGenFunctionInfo::create() { - // For now we just create an empty CIRGenFunctionInfo. - CIRGenFunctionInfo *fi = new CIRGenFunctionInfo(); +CIRGenFunctionInfo *CIRGenFunctionInfo:

[clang] [CIR] cir.call with scalar return type (PR #135552)

2025-04-16 Thread Sirui Mu via cfe-commits
https://github.com/Lancern updated https://github.com/llvm/llvm-project/pull/135552 >From fcb21d172d382a3b6608bb3c4dcb4ede3f43611c Mon Sep 17 00:00:00 2001 From: Sirui Mu Date: Sun, 13 Apr 2025 23:34:21 +0800 Subject: [PATCH] [CIR] cir.call with scalar return type This patch introduces support

[clang] [CIR] cir.call with scalar return type (PR #135552)

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

[clang] [CIR] cir.call with scalar return type (PR #135552)

2025-04-15 Thread Sirui Mu via cfe-commits
@@ -0,0 +1,89 @@ +//==-- ABIArgInfo.h - Abstract info regarding ABI-specific arguments ---==// +// +// 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] cir.call with scalar return type (PR #135552)

2025-04-15 Thread Sirui Mu via cfe-commits
@@ -0,0 +1,89 @@ +//==-- ABIArgInfo.h - Abstract info regarding ABI-specific arguments ---==// +// +// 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] cir.call with scalar return type (PR #135552)

2025-04-15 Thread Sirui Mu via cfe-commits
@@ -0,0 +1,50 @@ +#include "TargetInfo.h" +#include "ABIInfo.h" +#include "CIRGenFunctionInfo.h" +#include "clang/CIR/MissingFeatures.h" + +using namespace clang; +using namespace clang::CIRGen; + +static bool testIfIsVoidTy(QualType ty) { + const auto *builtinTy = ty->getAs(); +

[clang] [CIR] cir.call with scalar return type (PR #135552)

2025-04-15 Thread Sirui Mu via cfe-commits
@@ -515,9 +519,32 @@ verifyCallCommInSymbolUses(mlir::Operation *op, return op->emitOpError() << "'" << fnAttr.getValue() << "' does not reference a valid function"; - // TODO(cir): verify function arguments and return type + auto callIf = dy

[clang] [CIR] cir.call with scalar return type (PR #135552)

2025-04-15 Thread Sirui Mu via cfe-commits
@@ -87,9 +110,48 @@ RValue CIRGenFunction::emitCall(const CIRGenFunctionInfo &funcInfo, assert(!cir::MissingFeatures::opCallMustTail()); assert(!cir::MissingFeatures::opCallReturn()); - // For now we just return nothing because we don't have support for return - // valu

[clang] [CIR] cir.call with scalar return type (PR #135552)

2025-04-15 Thread Sirui Mu via cfe-commits
@@ -29,13 +32,29 @@ CIRGenCallee CIRGenCallee::prepareConcreteCallee(CIRGenFunction &cgf) const { return *this; } -static const CIRGenFunctionInfo &arrangeFreeFunctionLikeCall(CIRGenTypes &cgt) { +static const CIRGenFunctionInfo & +arrangeFreeFunctionLikeCall(CIRGenTypes &

[clang] [CIR] cir.call with scalar return type (PR #135552)

2025-04-15 Thread Sirui Mu via cfe-commits
@@ -205,13 +205,15 @@ class CIRBaseBuilderTy : public mlir::OpBuilder { // Call operators //======// - cir::CallOp createCallOp(mlir::Location loc, mlir::SymbolRefAttr callee) { -auto op = create(loc

[clang] [CIR] cir.call with scalar return type (PR #135552)

2025-04-15 Thread Sirui Mu via cfe-commits
@@ -205,13 +205,15 @@ class CIRBaseBuilderTy : public mlir::OpBuilder { // Call operators //======// - cir::CallOp createCallOp(mlir::Location loc, mlir::SymbolRefAttr callee) { -auto op = create(loc

[clang] [CIR] cir.call with scalar return type (PR #135552)

2025-04-15 Thread Sirui Mu via cfe-commits
@@ -0,0 +1,89 @@ +//==-- ABIArgInfo.h - Abstract info regarding ABI-specific arguments ---==// +// +// 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] cir.call with scalar return type (PR #135552)

2025-04-15 Thread Sirui Mu via cfe-commits
@@ -0,0 +1,89 @@ +//==-- ABIArgInfo.h - Abstract info regarding ABI-specific arguments ---==// +// +// 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] cir.call with scalar return type (PR #135552)

2025-04-15 Thread Sirui Mu via cfe-commits
https://github.com/Lancern updated https://github.com/llvm/llvm-project/pull/135552 >From f930508ec33ca9c2f1d0b68e14901bffa10af9da Mon Sep 17 00:00:00 2001 From: Sirui Mu Date: Sun, 13 Apr 2025 23:34:21 +0800 Subject: [PATCH] [CIR] cir.call with scalar return type This patch introduces support

[clang] [CIR] cir.call with scalar return type (PR #135552)

2025-04-13 Thread Sirui Mu via cfe-commits
Lancern wrote: The CI failure on code formatting seems to be a problem in the code formatter script itself rather than in the patch content. https://github.com/llvm/llvm-project/pull/135552 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https

[clang] [CIR] cir.call with scalar return type (PR #135552)

2025-04-13 Thread Sirui Mu via cfe-commits
https://github.com/Lancern created https://github.com/llvm/llvm-project/pull/135552 This PR introduces support for calling functions with a scalar return type to the upstream. This PR also includes an initial version of `CIRGenTargetInfo` and related definitions which are essential for the CIR

[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 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 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

  1   2   >