[clang] [CIR] Add side effect attribute to call operations (PR #144201)

2025-06-18 Thread Sirui Mu via cfe-commits
@@ -1858,6 +1858,40 @@ def FuncOp : CIR_Op<"func", [ // CallOp //===--===// +def SE_All : I32EnumAttrCase<"All", 1, "all">; +def SE_Pure : I32EnumAttrCase<"Pure", 2, "pure">; +def SE_Const : I32EnumAttrCase<"

[clang] [CIR] Add support for __builtin_assume (PR #144376)

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

[clang] [CIR] Add support for __builtin_assume (PR #144376)

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

[clang] [CIR] Add support for __builtin_assume (PR #144376)

2025-06-17 Thread Sirui Mu via cfe-commits
@@ -49,7 +52,43 @@ RValue CIRGenFunction::emitBuiltinExpr(const GlobalDecl &gd, unsigned builtinID, } } + assert(!cir::MissingFeatures::opCallBuiltin()); Lancern wrote: Replaced it with several fine-grained missing feature flags. https://github.com/l

[clang] [CIR] Add support for __builtin_assume (PR #144376)

2025-06-17 Thread Sirui Mu via cfe-commits
https://github.com/Lancern updated https://github.com/llvm/llvm-project/pull/144376 >From 74b80387abe26da76d73b81682105228ef3dfc73 Mon Sep 17 00:00:00 2001 From: Sirui Mu Date: Tue, 17 Jun 2025 23:39:34 +0800 Subject: [PATCH] [CIR] Add support for __builtin_assume This patch adds support for t

[clang] [CIR] Add side effect attribute to call operations (PR #144201)

2025-06-17 Thread Sirui Mu via cfe-commits
@@ -24,16 +24,17 @@ let cppNamespace = "::cir" in { def CIRCallOpInterface : OpInterface<"CIRCallOpInterface", [CallOpInterface]> { // Currently we don't have any methods defined in CIRCallOpInterface. We'll // add more methods as the upstreaming proceeds. -let m

[clang] [CIR] Add side effect attribute to call operations (PR #144201)

2025-06-17 Thread Sirui Mu via cfe-commits
@@ -1858,6 +1858,40 @@ def FuncOp : CIR_Op<"func", [ // CallOp //===--===// +def SE_All : I32EnumAttrCase<"All", 1, "all">; Lancern wrote: Done. https://github.com/llvm/llvm-project/pull/14

[clang] [CIR] Add side effect attribute to call operations (PR #144201)

2025-06-17 Thread Sirui Mu via cfe-commits
@@ -1940,22 +1975,30 @@ def CallOp : CIR_CallOpBase<"call", [NoRegionArguments]> { let arguments = commonArgs; let builders = [ -// Build a call op for a direct call -OpBuilder<(ins "mlir::SymbolRefAttr":$callee, "mlir::Type":$resType, - "mlir::V

[clang] [CIR] Add side effect attribute to call operations (PR #144201)

2025-06-17 Thread Sirui Mu via cfe-commits
https://github.com/Lancern updated https://github.com/llvm/llvm-project/pull/144201 >From 77d093f1a9c6c6fc742e788f8b05aa9c601480de Mon Sep 17 00:00:00 2001 From: Sirui Mu Date: Tue, 17 Jun 2025 22:35:50 +0800 Subject: [PATCH] [CIR] Add support for __builtin_assume This patch adds support for t

[clang] [CIR] Add support for __builtin_assume (PR #144376)

2025-06-16 Thread Sirui Mu via cfe-commits
https://github.com/Lancern created https://github.com/llvm/llvm-project/pull/144376 This patch adds support for the `__builtin_assume` builtin function. >From 886097329c486b48ceb32ea7ea807e561ad8abdd Mon Sep 17 00:00:00 2001 From: Sirui Mu Date: Mon, 16 Jun 2025 23:38:47 +0800 Subject: [PATCH]

[clang] [clang][bytecode] Avoid revisiting decomposition decl in visitDeclRef (PR #144226)

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

[clang] [clang][bytecode] Avoid revisiting decomposition decl in visitDeclRef (PR #144226)

2025-06-15 Thread Sirui Mu via cfe-commits
Lancern wrote: I'll merge it once the CI is green. https://github.com/llvm/llvm-project/pull/144226 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Avoid revisiting decomposition decl in visitDeclRef (PR #144226)

2025-06-15 Thread Sirui Mu via cfe-commits
@@ -141,3 +141,11 @@ template constexpr auto c() { } auto y = c<1>(); // both-note {{in instantiation of function template specialization 'c<1>' requested here}} + +namespace non_constexpr_structured_binding { Lancern wrote: Sorry about that... Updated. ht

[clang] [clang][bytecode] Avoid revisiting decomposition decl in visitDeclRef (PR #144226)

2025-06-15 Thread Sirui Mu via cfe-commits
https://github.com/Lancern updated https://github.com/llvm/llvm-project/pull/144226 >From c9649ce4a054cd20b81b12e51f25afa1cfbcf855 Mon Sep 17 00:00:00 2001 From: Sirui Mu Date: Sat, 14 Jun 2025 22:25:48 +0800 Subject: [PATCH] [clang][Bytecode] Avoid revisiting decomposition decl --- clang/lib

[clang] [clang][bytecode] Avoid revisiting decomposition decl in visitDeclRef (PR #144226)

2025-06-15 Thread Sirui Mu via cfe-commits
https://github.com/Lancern updated https://github.com/llvm/llvm-project/pull/144226 >From 72b99e66ff7b7534604eed5e555ceaf261b3c78e Mon Sep 17 00:00:00 2001 From: Sirui Mu Date: Sat, 14 Jun 2025 22:25:48 +0800 Subject: [PATCH] [clang][Bytecode] Avoid revisiting decomposition decl --- clang/lib

[clang] [clang][bytecode] Avoid revisiting decomposition decl in visitDeclRef (PR #144226)

2025-06-14 Thread Sirui Mu via cfe-commits
@@ -0,0 +1,8 @@ +// RUN: %clang_cc1 -std=c++17 -verify %s -fexperimental-new-constant-interpreter +// RUN: %clang_cc1 -std=c++17 -verify %s + +void f1() { Lancern wrote: Updated https://github.com/llvm/llvm-project/pull/144226 __

[clang] [clang][bytecode] Avoid revisiting decomposition decl in visitDeclRef (PR #144226)

2025-06-14 Thread Sirui Mu via cfe-commits
https://github.com/Lancern updated https://github.com/llvm/llvm-project/pull/144226 >From 8046031437a5cfafac17c7c9d978c25fb8ed2479 Mon Sep 17 00:00:00 2001 From: Sirui Mu Date: Sat, 14 Jun 2025 22:25:48 +0800 Subject: [PATCH] [clang][Bytecode] Avoid revisiting decomposition decl --- clang/lib

[clang] [CIR] Upstream ComplexType ImaginaryLiteral (PR #144223)

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

[clang] [CIR] Upstream ComplexType builtin_complex (PR #144225)

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

[clang] [CIR] Upstream ComplexType builtin_complex (PR #144225)

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

[clang] [CIR] Upstream ComplexType builtin_complex (PR #144225)

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

[clang] [CIR] Upstream ComplexType builtin_complex (PR #144225)

2025-06-14 Thread Sirui Mu via cfe-commits
@@ -44,6 +68,15 @@ void ComplexExprEmitter::emitStoreOfComplex(mlir::Location loc, mlir::Value val, builder.createStore(loc, val, destAddr); } +mlir::Value ComplexExprEmitter::VisitCallExpr(const CallExpr *e) { + if (e->getCallReturnType(cgf.getContext())->isReferenceType(

[clang] [CIR][NFCI] Update RValue class to reflect changes in classic CodeGen (PR #142779)

2025-06-14 Thread Sirui Mu via cfe-commits
@@ -34,28 +32,85 @@ namespace clang::CIRGen { class RValue { enum Flavor { Scalar, Complex, Aggregate }; - // Stores first value and flavor. - llvm::PointerIntPair v1; - // Stores second value and volatility. - llvm::PointerIntPair, 1, bool> v2; - // Stores element type

[clang] [clang][bytecode] Avoid revisiting decomposition decl in visitDeclRef (PR #144226)

2025-06-14 Thread Sirui Mu via cfe-commits
https://github.com/Lancern created https://github.com/llvm/llvm-project/pull/144226 This simple patch removes the code to revisit `DecompositionDecl` in `visitDeclRef`. The revisit will try to emit the initializer of the `DecompositionDecl`, which could result in evaluation errors if the `Dec

[clang] [CIR] Add side effect attribute to call operations (PR #144201)

2025-06-13 Thread Sirui Mu via cfe-commits
https://github.com/Lancern created https://github.com/llvm/llvm-project/pull/144201 This patch adds `side_effect` attribute to `cir.call` operation. Other function call attributes will be added in later patches. >From ccf7371db9793ac980093fb3a43f24a7e9b176e7 Mon Sep 17 00:00:00 2001 From: Siru

[clang] [CIR] Function calls with aggregate arguments and return values (PR #143377)

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

[clang] [CIR] Function calls with aggregate arguments and return values (PR #143377)

2025-06-12 Thread Sirui Mu via cfe-commits
@@ -312,8 +329,47 @@ RValue CIRGenFunction::emitCall(const CIRGenFunctionInfo &funcInfo, assert(!cir::MissingFeatures::opCallBitcastArg()); cirCallArgs[argNo] = v; } else { - assert(!cir::MissingFeatures::opCallAggregateArgs()); - cgm.errorNYI("emitCa

[clang] [CIR] Function calls with aggregate arguments and return values (PR #143377)

2025-06-12 Thread Sirui Mu via cfe-commits
https://github.com/Lancern updated https://github.com/llvm/llvm-project/pull/143377 >From f524308595a06833b7e58f0138f281c7da84 Mon Sep 17 00:00:00 2001 From: Sirui Mu Date: Mon, 9 Jun 2025 18:35:08 +0800 Subject: [PATCH] [CIR] Function calls with aggregate arguments and return values This

[clang] [CIR] Function calls with aggregate arguments and return values (PR #143377)

2025-06-12 Thread Sirui Mu via cfe-commits
@@ -312,8 +329,47 @@ RValue CIRGenFunction::emitCall(const CIRGenFunctionInfo &funcInfo, assert(!cir::MissingFeatures::opCallBitcastArg()); cirCallArgs[argNo] = v; } else { - assert(!cir::MissingFeatures::opCallAggregateArgs()); - cgm.errorNYI("emitCa

[clang] [CIR] Function calls with aggregate arguments and return values (PR #143377)

2025-06-12 Thread Sirui Mu via cfe-commits
https://github.com/Lancern updated https://github.com/llvm/llvm-project/pull/143377 >From e45c2ad46d7589ae1c7aa78b3ea19f7c6e5df094 Mon Sep 17 00:00:00 2001 From: Sirui Mu Date: Mon, 9 Jun 2025 18:35:08 +0800 Subject: [PATCH] [CIR] Function calls with aggregate arguments and return values This

[clang] [Sema][clangd] add noexcept to override functions during code completion (PR #75937)

2025-06-12 Thread Sirui Mu via cfe-commits
Lancern wrote: Ping. Does this PR still get a chance to be merged? https://github.com/llvm/llvm-project/pull/75937 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Sema][clangd] add noexcept to override functions during code completion (PR #75937)

2025-06-12 Thread Sirui Mu via cfe-commits
https://github.com/Lancern updated https://github.com/llvm/llvm-project/pull/75937 >From 8924617e16a035730c4c33f17c726dd5e5bb5f00 Mon Sep 17 00:00:00 2001 From: Sirui Mu Date: Tue, 19 Dec 2023 22:24:23 +0800 Subject: [PATCH] [clangd][Sema] add noexcept to override functions during code complet

[clang] [CIR] Function calls with aggregate arguments and return values (PR #143377)

2025-06-12 Thread Sirui Mu via cfe-commits
https://github.com/Lancern updated https://github.com/llvm/llvm-project/pull/143377 >From 2296d60a753de77415ad4b95e35509bbf3bd437b Mon Sep 17 00:00:00 2001 From: Sirui Mu Date: Mon, 9 Jun 2025 18:35:08 +0800 Subject: [PATCH] [CIR] Function calls with aggregate arguments and return values This

[clang] [CIR] Upstream support for emitting constructors (PR #143639)

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

[clang] [CIR] Upstream support for emitting constructors (PR #143639)

2025-06-12 Thread Sirui Mu via cfe-commits
@@ -21,6 +21,88 @@ using namespace clang; using namespace clang::CIRGen; +/// Checks whether the given constructor is a valid subject for the +/// complete-to-base constructor delgation optimization, i.e. emitting the +/// complete constructor as a simple call to the base cons

[clang] [CIR] Function calls with aggregate arguments and return values (PR #143377)

2025-06-10 Thread Sirui Mu via cfe-commits
https://github.com/Lancern updated https://github.com/llvm/llvm-project/pull/143377 >From df020dfa578d504521c1178dcc161a651eb0b0fa Mon Sep 17 00:00:00 2001 From: Sirui Mu Date: Mon, 9 Jun 2025 18:35:08 +0800 Subject: [PATCH] [CIR] Function calls with aggregate arguments and return values This

[clang] [CIR] Upstream minimal builtin function call support (PR #142981)

2025-06-10 Thread Sirui Mu via cfe-commits
@@ -0,0 +1,78 @@ +// RUN: %clang_cc1 -std=c++11 -triple x86_64-unknown-linux-gnu -Wno-unused-value -fclangir -emit-cir %s -o %t.cir +// RUN: FileCheck --input-file=%t.cir %s -check-prefix=CIR +// RUN: %clang_cc1 -std=c++11 -triple x86_64-unknown-linux-gnu -Wno-unused-value -fcla

[clang] [CIR] Upstream minimal builtin function call support (PR #142981)

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

[clang] [CIR] Upstream minimal builtin function call support (PR #142981)

2025-06-10 Thread Sirui Mu via cfe-commits
@@ -229,6 +231,19 @@ class CIRGenBuilderTy : public cir::CIRBaseBuilderTy { cir::IntType getUInt32Ty() { return typeCache.UInt32Ty; } cir::IntType getUInt64Ty() { return typeCache.UInt64Ty; } + cir::ConstantOp getConstInt(mlir::Location loc, llvm::APSInt intVal); + + cir

[clang] [CIR] Upstream minimal builtin function call support (PR #142981)

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

[clang] [CIR] Upstream support for emitting constructors (PR #143639)

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

[clang] [CIR] Upstream support for emitting constructors (PR #143639)

2025-06-10 Thread Sirui Mu via cfe-commits
@@ -496,6 +496,47 @@ cir::FuncOp CIRGenFunction::generateCode(clang::GlobalDecl gd, cir::FuncOp fn, return fn; } +void CIRGenFunction::emitConstructorBody(FunctionArgList &args) { + assert(!cir::MissingFeatures::sanitizers()); + const auto *ctor = cast(curGD.getDecl()); +

[clang] [CIR] Upstream support for emitting constructors (PR #143639)

2025-06-10 Thread Sirui Mu via cfe-commits
https://github.com/Lancern requested changes to this pull request. https://github.com/llvm/llvm-project/pull/143639 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream support for emitting constructors (PR #143639)

2025-06-10 Thread Sirui Mu via cfe-commits
@@ -21,6 +21,88 @@ using namespace clang; using namespace clang::CIRGen; +/// Checks whether the given constructor is a valid subject for the +/// complete-to-base constructor delgation optimization, i.e. emitting the +/// complete constructor as a simple call to the base cons

[clang] [CIR] Upstream support for emitting constructors (PR #143639)

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

[clang] [CIR] Function calls with aggregate arguments and return values (PR #143377)

2025-06-10 Thread Sirui Mu via cfe-commits
https://github.com/Lancern updated https://github.com/llvm/llvm-project/pull/143377 >From 2999e0180e22724fc1a7247c9ed3520a8b2349dc Mon Sep 17 00:00:00 2001 From: Sirui Mu Date: Mon, 9 Jun 2025 18:35:08 +0800 Subject: [PATCH] [CIR] Function calls with aggregate arguments and return values This

[clang] [CIR] Function calls with aggregate arguments and return values (PR #143377)

2025-06-10 Thread Sirui Mu via cfe-commits
@@ -312,8 +329,47 @@ RValue CIRGenFunction::emitCall(const CIRGenFunctionInfo &funcInfo, assert(!cir::MissingFeatures::opCallBitcastArg()); cirCallArgs[argNo] = v; } else { - assert(!cir::MissingFeatures::opCallAggregateArgs()); - cgm.errorNYI("emitCa

[clang] [CIR] Function calls with aggregate arguments and return values (PR #143377)

2025-06-10 Thread Sirui Mu via cfe-commits
@@ -312,8 +329,47 @@ RValue CIRGenFunction::emitCall(const CIRGenFunctionInfo &funcInfo, assert(!cir::MissingFeatures::opCallBitcastArg()); cirCallArgs[argNo] = v; } else { - assert(!cir::MissingFeatures::opCallAggregateArgs()); - cgm.errorNYI("emitCa

[clang] [CIR] Function calls with aggregate arguments and return values (PR #143377)

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

[clang] [CIR] Function calls with aggregate arguments and return values (PR #143377)

2025-06-10 Thread Sirui Mu via cfe-commits
https://github.com/Lancern updated https://github.com/llvm/llvm-project/pull/143377 >From ea7297baf0d801f892065523749903a14aa59ee0 Mon Sep 17 00:00:00 2001 From: Sirui Mu Date: Mon, 9 Jun 2025 18:35:08 +0800 Subject: [PATCH] [CIR] Function calls with aggregate arguments and return values This

[clang] [CIR] Function calls with aggregate arguments and return values (PR #143377)

2025-06-10 Thread Sirui Mu via cfe-commits
@@ -312,8 +329,47 @@ RValue CIRGenFunction::emitCall(const CIRGenFunctionInfo &funcInfo, assert(!cir::MissingFeatures::opCallBitcastArg()); cirCallArgs[argNo] = v; } else { - assert(!cir::MissingFeatures::opCallAggregateArgs()); - cgm.errorNYI("emitCa

[clang] [CIR] Function calls with aggregate arguments and return values (PR #143377)

2025-06-10 Thread Sirui Mu via cfe-commits
https://github.com/Lancern updated https://github.com/llvm/llvm-project/pull/143377 >From fc98c3d1e0995d5519a4cb5313affd07f088ab44 Mon Sep 17 00:00:00 2001 From: Sirui Mu Date: Mon, 9 Jun 2025 18:35:08 +0800 Subject: [PATCH] [CIR] Function calls with aggregate arguments and return values This

[clang] [CIR] Function calls with aggregate arguments and return values (PR #143377)

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

[clang] [CIR] Function calls with aggregate arguments and return values (PR #143377)

2025-06-09 Thread Sirui Mu via cfe-commits
https://github.com/Lancern created https://github.com/llvm/llvm-project/pull/143377 This patch updates cir.call operation and allows function calls with aggregate arguments and return values. It seems that C++ class support is still at a minimum now. I try to make a call to a C++ function wit

[clang] [CIR] Call to variadic functions (PR #141942)

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

[clang] [CIR] Call to variadic functions (PR #141942)

2025-05-29 Thread Sirui Mu via cfe-commits
@@ -409,6 +409,18 @@ void CIRGenFunction::emitCallArg(CallArgList &args, const clang::Expr *e, args.add(emitAnyExprToTemp(e), argType); } +QualType CIRGenFunction::getVarArgType(const Expr *arg) { + // System headers on Windows define NULL to 0 instead of 0LL on Win64. MSV

[clang] [CIR] Call to variadic functions (PR #141942)

2025-05-29 Thread Sirui Mu via cfe-commits
@@ -39,6 +39,26 @@ class RequiredArgs { bool allowsOptionalArgs() const { return numRequired != ~0U; } + /// Compute the arguments required by the given formal prototype, given that + /// there may be some additional, non-formal arguments in play. + /// + /// If FD is n

[clang] [CIR] Call to variadic functions (PR #141942)

2025-05-29 Thread Sirui Mu via cfe-commits
https://github.com/Lancern updated https://github.com/llvm/llvm-project/pull/141942 >From 862cb3bd98bc2ed6a6b01efe0f08ebfaf8ad63e0 Mon Sep 17 00:00:00 2001 From: Sirui Mu Date: Thu, 29 May 2025 17:21:06 +0800 Subject: [PATCH] [CIR] Call to variadic functions --- clang/include/clang/CIR/Missin

[clang] [CIR] Call to variadic functions (PR #141942)

2025-05-29 Thread Sirui Mu via cfe-commits
https://github.com/Lancern created https://github.com/llvm/llvm-project/pull/141942 This PR adds support for calling variadic functions in CIR. >From 800e4b1a02520e4c3137a02e284cc8406cf36602 Mon Sep 17 00:00:00 2001 From: Sirui Mu Date: Thu, 29 May 2025 17:21:06 +0800 Subject: [PATCH] [CIR] Ca

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

  1   2   >