[clang] [CIR] Add folders for bit manipulation operations (PR #150235)

2025-07-24 Thread Sirui Mu via cfe-commits
@@ -2132,6 +2133,117 @@ LogicalResult cir::ComplexImagPtrOp::verify() { return success(); } +//===--===// +// Bit manipulation operations +//===---

[clang] [CIR] Add folders for bit manipulation operations (PR #150235)

2025-07-24 Thread Sirui Mu via cfe-commits
@@ -2132,6 +2133,117 @@ LogicalResult cir::ComplexImagPtrOp::verify() { return success(); } +//===--===// +// Bit manipulation operations +//===---

[clang] [CIR] Add folders for bit manipulation operations (PR #150235)

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

[clang] [CIR] Add folders for bit manipulation operations (PR #150235)

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

[clang] [CIR] Add poison attribute (PR #150760)

2025-07-26 Thread Sirui Mu via cfe-commits
https://github.com/Lancern created https://github.com/llvm/llvm-project/pull/150760 This patch adds the `#cir.poison` attribute which represents a poison value. This patch also updates various operation folders to let them propagate poison values from their inputs to their outputs. >From 4a39

[clang] [CIR] Add bit ffs operation (PR #150997)

2025-07-28 Thread Sirui Mu via cfe-commits
https://github.com/Lancern created https://github.com/llvm/llvm-project/pull/150997 This patch adds the `cir.ffs` operation which corresponds to the `__builtin_ffs` family of builtin functions. >From e16b3fe7d156252502ace0b6de74d055b3d5312d Mon Sep 17 00:00:00 2001 From: Sirui Mu Date: Tue, 29

[clang] [CIR] Add poison attribute (PR #150760)

2025-07-27 Thread Sirui Mu via cfe-commits
https://github.com/Lancern updated https://github.com/llvm/llvm-project/pull/150760 >From ea9b3e72f0d375ba1ded9b4342cf9e88703ceacf Mon Sep 17 00:00:00 2001 From: Sirui Mu Date: Sat, 26 Jul 2025 21:07:36 +0800 Subject: [PATCH] [CIR] Add poison attribute This patch adds the `#cir.poison` attribu

[clang] [CIR] Add poison attribute (PR #150760)

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

[clang] [CIR] Add folders for bit manipulation operations (PR #150235)

2025-07-25 Thread Sirui Mu via cfe-commits
https://github.com/Lancern updated https://github.com/llvm/llvm-project/pull/150235 >From 169c89a95a5714584a91473c76bf1b9859311bf1 Mon Sep 17 00:00:00 2001 From: Sirui Mu Date: Wed, 23 Jul 2025 23:04:09 +0800 Subject: [PATCH] [CIR] Add folders for bit manipulation operations --- clang/include

[clang] [CIR] Add folders for bit manipulation operations (PR #150235)

2025-07-25 Thread Sirui Mu via cfe-commits
@@ -2132,6 +2133,117 @@ LogicalResult cir::ComplexImagPtrOp::verify() { return success(); } +//===--===// +// Bit manipulation operations +//===---

[clang] [CIR] Add folders for bit manipulation operations (PR #150235)

2025-07-25 Thread Sirui Mu via cfe-commits
https://github.com/Lancern updated https://github.com/llvm/llvm-project/pull/150235 >From b22e90b2b7279081ccc07c32441d2761deb5ed2b Mon Sep 17 00:00:00 2001 From: Sirui Mu Date: Wed, 23 Jul 2025 23:04:09 +0800 Subject: [PATCH] [CIR] Add folders for bit manipulation operations --- clang/include

[clang] [CIR] Add folders for bit manipulation operations (PR #150235)

2025-07-25 Thread Sirui Mu via cfe-commits
https://github.com/Lancern updated https://github.com/llvm/llvm-project/pull/150235 >From b22e90b2b7279081ccc07c32441d2761deb5ed2b Mon Sep 17 00:00:00 2001 From: Sirui Mu Date: Wed, 23 Jul 2025 23:04:09 +0800 Subject: [PATCH] [CIR] Add folders for bit manipulation operations --- clang/include

[clang] [CIR] Add folders for bit manipulation operations (PR #150235)

2025-07-25 Thread Sirui Mu via cfe-commits
https://github.com/Lancern updated https://github.com/llvm/llvm-project/pull/150235 >From b22e90b2b7279081ccc07c32441d2761deb5ed2b Mon Sep 17 00:00:00 2001 From: Sirui Mu Date: Wed, 23 Jul 2025 23:04:09 +0800 Subject: [PATCH] [CIR] Add folders for bit manipulation operations --- clang/include

[clang] [CIR] Add support for array cleanups (PR #150499)

2025-07-25 Thread Sirui Mu via cfe-commits
@@ -2272,6 +2272,23 @@ def CIR_ArrayCtor : CIR_ArrayInitDestroy<"array.ctor"> { }]; } +def CIR_ArrayDtor : CIR_ArrayInitDestroy<"array.dtor"> { + let summary = "Destroy array elements with C++ dtors"; + let description = [{ +Destroy each array element using the same C+

[clang] [CIR] Add folders for bit manipulation operations (PR #150235)

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

[clang] [CIR] Add proper handling for no prototype function calls (PR #150553)

2025-07-25 Thread Sirui Mu via cfe-commits
@@ -1296,6 +1298,44 @@ RValue CIRGenFunction::emitCall(clang::QualType calleeTy, const CIRGenFunctionInfo &funcInfo = cgm.getTypes().arrangeFreeFunctionCall(args, fnType); + // C99 6.5.2.2p6: + // If the expression that denotes the called function has a type that d

[clang] [CIR] Add proper handling for no prototype function calls (PR #150553)

2025-07-25 Thread Sirui Mu via cfe-commits
@@ -1805,7 +1887,9 @@ CIRGenModule::createCIRFunction(mlir::Location loc, StringRef name, func = builder.create(loc, name, funcType); assert(!cir::MissingFeatures::opFuncAstDeclAttr()); -assert(!cir::MissingFeatures::opFuncNoProto()); + +if (funcDecl && !funcD

[clang] [CIR] Add proper handling for no prototype function calls (PR #150553)

2025-07-25 Thread Sirui Mu via cfe-commits
@@ -1729,6 +1783,34 @@ cir::FuncOp CIRGenModule::getOrCreateCIRFunction( invalidLoc ? theModule->getLoc() : getLoc(funcDecl->getSourceRange()), mangledName, mlir::cast(funcType), funcDecl); + // If we already created a function with the same mangled name (but diff

[clang] [CIR] Add proper handling for no prototype function calls (PR #150553)

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

[clang] [CIR] Add CIRGen for cir.unreachable and cir.trap (PR #151363)

2025-07-31 Thread Sirui Mu via cfe-commits
https://github.com/Lancern updated https://github.com/llvm/llvm-project/pull/151363 >From 8f1deb8f71b2fec45c706ae4a6b21a87cab43bc9 Mon Sep 17 00:00:00 2001 From: Sirui Mu Date: Thu, 31 Jul 2025 01:08:22 +0800 Subject: [PATCH] [CIR] Add CIRGen for cir.unreachable and cir.trap --- clang/lib/CIR

[clang] [CIR] Add CIRGen for cir.unreachable and cir.trap (PR #151363)

2025-07-31 Thread Sirui Mu via cfe-commits
@@ -269,6 +270,22 @@ RValue CIRGenFunction::emitBuiltinExpr(const GlobalDecl &gd, unsigned builtinID, case Builtin::BI__builtin_rotateright32: case Builtin::BI__builtin_rotateright64: return emitRotate(e, /*isRotateLeft=*/false); + + case Builtin::BI__builtin_trap: {

[clang] [CIR] Add CIRGen for cir.unreachable and cir.trap (PR #151363)

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

[clang] [CIR] Add CIRGen for cir.unreachable and cir.trap (PR #151363)

2025-07-31 Thread Sirui Mu via cfe-commits
@@ -269,6 +270,22 @@ RValue CIRGenFunction::emitBuiltinExpr(const GlobalDecl &gd, unsigned builtinID, case Builtin::BI__builtin_rotateright32: case Builtin::BI__builtin_rotateright64: return emitRotate(e, /*isRotateLeft=*/false); + + case Builtin::BI__builtin_trap: {

[clang] [CIR] Add CIRGen for cir.unreachable and cir.trap (PR #151363)

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

[clang] [CIR] Add CIRGen for cir.unreachable and cir.trap (PR #151363)

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

[clang] [CIR] Add CIRGen for cir.unreachable and cir.trap (PR #151363)

2025-08-02 Thread Sirui Mu via cfe-commits
@@ -1780,6 +1780,20 @@ LValue CIRGenFunction::emitLoadOfReferenceLValue(Address refAddr, pointeeBaseInfo); } +void CIRGenFunction::emitTrap(mlir::Location loc, bool createNewBlock) { Lancern wrote: I added a missing feature call for s

[clang] [CIR] Add CIRGen for cir.unreachable and cir.trap (PR #151363)

2025-08-02 Thread Sirui Mu via cfe-commits
https://github.com/Lancern updated https://github.com/llvm/llvm-project/pull/151363 >From 8f9ec79eaf53e993558e06dd088ea9924c9ca8a3 Mon Sep 17 00:00:00 2001 From: Sirui Mu Date: Thu, 31 Jul 2025 01:08:22 +0800 Subject: [PATCH] [CIR] Add CIRGen for cir.unreachable and cir.trap --- clang/lib/CIR

[clang] [CIR] Add CIRGen for cir.unreachable and cir.trap (PR #151363)

2025-08-02 Thread Sirui Mu via cfe-commits
https://github.com/Lancern updated https://github.com/llvm/llvm-project/pull/151363 >From 6e74f1908cd9643151ca72e5ab059a4c5d547816 Mon Sep 17 00:00:00 2001 From: Sirui Mu Date: Thu, 31 Jul 2025 01:08:22 +0800 Subject: [PATCH] [CIR] Add CIRGen for cir.unreachable and cir.trap --- clang/lib/CIR

[clang] [CIR] Add CIRGen for cir.unreachable and cir.trap (PR #151363)

2025-08-05 Thread Sirui Mu via cfe-commits
https://github.com/Lancern closed https://github.com/llvm/llvm-project/pull/151363 ___ 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_aligned (PR #152152)

2025-08-05 Thread Sirui Mu via cfe-commits
https://github.com/Lancern created https://github.com/llvm/llvm-project/pull/152152 This patch upstreams CIRGen and LLVM lowering support for the `__builtin_assume_aligned` builtin function. >From 46e1300ba7f0c2168a2157facf51834ed6549d00 Mon Sep 17 00:00:00 2001 From: Sirui Mu Date: Tue, 5 Au

[clang] [CIR] Add CIRGen for cir.unreachable and cir.trap (PR #151363)

2025-07-30 Thread Sirui Mu via cfe-commits
https://github.com/Lancern created https://github.com/llvm/llvm-project/pull/151363 This patch adds CIRGen support for `cir.unreachable` and `cir.trap`. It also adds missing LLVM lowering code for `cir.unreachable`. >From 22fd4328f0b5695de47e001f135a92416c38bfbf Mon Sep 17 00:00:00 2001 From:

[clang] [CIR] Add support for __builtin_assume_aligned (PR #152152)

2025-08-06 Thread Sirui Mu via cfe-commits
@@ -460,6 +460,28 @@ mlir::LogicalResult CIRToLLVMAssumeOpLowering::matchAndRewrite( return mlir::success(); } +mlir::LogicalResult CIRToLLVMAssumeAlignedOpLowering::matchAndRewrite( +cir::AssumeAlignedOp op, OpAdaptor adaptor, +mlir::ConversionPatternRewriter &rewr

[clang] [CIR] Add CIRGen for cir.unreachable and cir.trap (PR #151363)

2025-08-02 Thread Sirui Mu via cfe-commits
@@ -1780,6 +1780,20 @@ LValue CIRGenFunction::emitLoadOfReferenceLValue(Address refAddr, pointeeBaseInfo); } +void CIRGenFunction::emitTrap(mlir::Location loc, bool createNewBlock) { Lancern wrote: I'd rather not do this change in thi

[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] 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] 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-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
@@ -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-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 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-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
@@ -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
@@ -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
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-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][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 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] 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][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] 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] 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
@@ -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] 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
@@ -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
@@ -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] 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
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 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
@@ -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 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 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
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 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 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] 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-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 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
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
@@ -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 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-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] 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-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] [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] [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] [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] 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] Add initial support for atomic types (PR #152923)

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

[clang] [CIR] Add initial support for atomic types (PR #152923)

2025-08-11 Thread Sirui Mu via cfe-commits
https://github.com/Lancern updated https://github.com/llvm/llvm-project/pull/152923 >From 2aca18e40471552400218f0bf6f50a02209509da Mon Sep 17 00:00:00 2001 From: Sirui Mu Date: Sun, 10 Aug 2025 23:53:29 +0800 Subject: [PATCH] [CIR] Add initial support for atomic types This patch adds the initi

[clang] [CIR] Add initial support for atomic types (PR #152923)

2025-08-11 Thread Sirui Mu via cfe-commits
https://github.com/Lancern ready_for_review https://github.com/llvm/llvm-project/pull/152923 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Add CIRGen for pseudo destructor calls (PR #153014)

2025-08-11 Thread Sirui Mu via cfe-commits
https://github.com/Lancern created https://github.com/llvm/llvm-project/pull/153014 This patch adds CIRGen support for C++ pseudo destructor call expressions. >From 8d567b71514b64222c67937e5fda907af87b7855 Mon Sep 17 00:00:00 2001 From: Sirui Mu Date: Mon, 11 Aug 2025 22:29:39 +0800 Subject: [

[clang] [CIR] Add support for __builtin_assume_aligned (PR #152152)

2025-08-06 Thread Sirui Mu via cfe-commits
https://github.com/Lancern updated https://github.com/llvm/llvm-project/pull/152152 >From d517c140a3ec9ec64d3f35c286c7e2b8ce6f6594 Mon Sep 17 00:00:00 2001 From: Sirui Mu Date: Wed, 6 Aug 2025 23:03:05 +0800 Subject: [PATCH] [CIR] Add support for __builtin_assume_aligned --- clang/include/cla

[clang] [CIR] Add support for __builtin_assume_aligned (PR #152152)

2025-08-06 Thread Sirui Mu via cfe-commits
@@ -129,6 +129,23 @@ RValue CIRGenFunction::emitBuiltinExpr(const GlobalDecl &gd, unsigned builtinID, return RValue::get(nullptr); } + case Builtin::BI__builtin_assume_aligned: { +const Expr *ptrExpr = e->getArg(0); +mlir::Value ptrValue = emitScalarExpr(ptrExp

[clang] [CIR] Add support for __builtin_assume_aligned (PR #152152)

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

[clang] [CIR] Add atomic load and store operations (PR #153814)

2025-08-18 Thread Sirui Mu via cfe-commits
https://github.com/Lancern updated https://github.com/llvm/llvm-project/pull/153814 >From b6b6dd067f2631b69dbe63ce6b08b1cbc448b2e3 Mon Sep 17 00:00:00 2001 From: Sirui Mu Date: Fri, 15 Aug 2025 22:32:52 +0800 Subject: [PATCH] [CIR] Add atomic load and store This patch adds support for atomic l

[clang] [CIR] Add atomic load and store operations (PR #153814)

2025-08-18 Thread Sirui Mu via cfe-commits
@@ -187,12 +244,85 @@ void AtomicInfo::emitCopyIntoMemory(RValue rvalue) const { } } +static void emitAtomicOp(CIRGenFunction &cgf, AtomicExpr *expr, Address dest, + Address ptr, Address val1, uint64_t size, + cir::MemOrder ord

[clang] [CIR] Add initial support for atomic types (PR #152923)

2025-08-10 Thread Sirui Mu via cfe-commits
https://github.com/Lancern created https://github.com/llvm/llvm-project/pull/152923 This patch adds the initial support for C11 atomic types, including: - Convert `QualType` that represents atomic types to CIR types; - Start emitting code for atomic value initializers. >From 7fcc3b16858e88adcf

[clang] [CIR] Add atomic load and store operations (PR #153814)

2025-08-20 Thread Sirui Mu via cfe-commits
https://github.com/Lancern updated https://github.com/llvm/llvm-project/pull/153814 >From 84df7cf4426488bc192271934ff6316d46a0c377 Mon Sep 17 00:00:00 2001 From: Sirui Mu Date: Fri, 15 Aug 2025 22:32:52 +0800 Subject: [PATCH] [CIR] Add atomic load and store This patch adds support for atomic l

[clang] [CIR] Add atomic load and store operations (PR #153814)

2025-08-20 Thread Sirui Mu via cfe-commits
@@ -187,12 +244,85 @@ void AtomicInfo::emitCopyIntoMemory(RValue rvalue) const { } } +static void emitAtomicOp(CIRGenFunction &cgf, AtomicExpr *expr, Address dest, + Address ptr, Address val1, uint64_t size, + cir::MemOrder ord

[clang] [CIR][NFC] Use Op::create to create CIR operations in CIRGenBuilder (PR #154540)

2025-08-20 Thread Sirui Mu via cfe-commits
https://github.com/Lancern created https://github.com/llvm/llvm-project/pull/154540 This patch updates `CIRGenBuilderTy` and `CIRBaseBuilderTy` to use `Op::create` for creating CIR operations. Compared to the new way which calls `OpBuilder::create` to create operations, the new way is more fri

[clang] [CIR] Add atomic load and store operations (PR #153814)

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

<    1   2   3   4   >