[clang] [CIR] More atomic load and store (PR #155168)

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

[clang] [CIR] More atomic load and store (PR #155168)

2025-08-27 Thread Sirui Mu via cfe-commits
@@ -507,9 +509,11 @@ RValue CIRGenFunction::emitAtomicExpr(AtomicExpr *e) { } bool isStore = e->getOp() == AtomicExpr::AO__c11_atomic_store || - e->getOp() == AtomicExpr::AO__atomic_store; Lancern wrote: Updated. https://github.com/llvm/l

[clang] [CIR] More atomic load and store (PR #155168)

2025-08-27 Thread Sirui Mu via cfe-commits
https://github.com/Lancern updated https://github.com/llvm/llvm-project/pull/155168 >From 0b6f6f7897f0bd6d22252ffd05b3aa7bc7740f4e Mon Sep 17 00:00:00 2001 From: Sirui Mu Date: Sun, 24 Aug 2025 21:33:31 +0800 Subject: [PATCH] [CIR] More atomic load and store This patch adds support for `__atom

[clang] [CIR] More atomic load and store (PR #155168)

2025-08-24 Thread Sirui Mu via cfe-commits
https://github.com/Lancern created https://github.com/llvm/llvm-project/pull/155168 This patch adds support for `__atomic_load_n` and `__atomic_store_n` that were missed by #153814. >From 0c6441a912b0326d502cfe54932de32430b7de66 Mon Sep 17 00:00:00 2001 From: Sirui Mu Date: Sun, 24 Aug 2025 2

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

2025-08-20 Thread Sirui Mu via cfe-commits
Lancern wrote: > LGTM! Any chance you could backport this to incubator? Yes, I will backport this later. https://github.com/llvm/llvm-project/pull/154540 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/li

[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 closed https://github.com/llvm/llvm-project/pull/154540 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[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 updated https://github.com/llvm/llvm-project/pull/154540 >From dc46a49bbfafe220f7006bbccd08212b26dae890 Mon Sep 17 00:00:00 2001 From: Sirui Mu Date: Wed, 20 Aug 2025 21:42:09 +0800 Subject: [PATCH] [CIR][NFC] Use Op::create to create CIR operations in CIRGenBuilder

[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

[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
@@ -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 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][NFC] Fix regression by #153819 (PR #154346)

2025-08-19 Thread Sirui Mu via cfe-commits
Lancern wrote: @darkbuck I noticed that you have pushed a commit to `main` that resolves the regression by changing the test code. But I believe the correct way to resolve this problem would be to update the CIRGen code as in this patch. Could you revert that commit? https://github.com/llvm/l

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

2025-08-19 Thread Sirui Mu via cfe-commits
https://github.com/Lancern updated https://github.com/llvm/llvm-project/pull/153814 >From aba98c654053fc43e5470f360ee3f0713bb8236e 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][NFC] Fix regression by #153819 (PR #154346)

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

[clang] [CIR][NFC] Fix regression by #153819 (PR #154346)

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

[clang] [CIR][NFC] Fix regression by #153819 (PR #154346)

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

[clang] [CIR][NFC] Fix regression by #153819 (PR #154346)

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

[clang] [CIR][NFC] Fix regression by #153819 (PR #154346)

2025-08-19 Thread Sirui Mu via cfe-commits
https://github.com/Lancern created https://github.com/llvm/llvm-project/pull/154346 This patch fixes a regression introduced by #153819. The evaluation order of the arguments to `emitVAStart` is unspecified, but the test requires the arguments to be evaluated in left-to-right order. >From de4

[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 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-15 Thread Sirui Mu via cfe-commits
https://github.com/Lancern created https://github.com/llvm/llvm-project/pull/153814 This patch adds support for atomic loads and stores. Specifically, it adds support for the following intrinsic calls: - `__atomic_load` and `__atomic_store`; - `__c11_atomic_load` and `__c11_atomic_store`. >Fr

[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 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 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-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-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 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 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 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-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-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 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
@@ -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
@@ -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 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-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 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
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-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-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 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 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 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 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-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 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 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 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-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
@@ -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 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 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 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-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 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
@@ -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
@@ -0,0 +1,129 @@ +// RUN: cir-opt -cir-canonicalize -cir-simplify -o %t.cir %s +// RUN: FileCheck --input-file=%t.cir %s + +!s32i = !cir.int +!u32i = !cir.int + +module { + cir.func @fold_clrsb() -> !s32i { +%0 = cir.const #cir.int<114514> : !s32i Lancern wr

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

2025-07-24 Thread Sirui Mu via cfe-commits
https://github.com/Lancern updated https://github.com/llvm/llvm-project/pull/150235 >From d216fcd22b52fc090cd7e7fb9cbdd3ddf0b717a2 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-23 Thread Sirui Mu via cfe-commits
https://github.com/Lancern created https://github.com/llvm/llvm-project/pull/150235 This patch adds folders for the bit manipulation operations, namely: `clrsb`, `clz`, `ctz`, `parity`, `popcount`, `bitreverse`, `byte_swap`, and `rotate`. >From 7b5e3cd1c293b1d5f64672e2f008f3e6918e680c Mon Sep

[clang] [CIR] Add assume_separate_storage operation (PR #149696)

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

[clang] [CIR] Add assume_separate_storage operation (PR #149696)

2025-07-21 Thread Sirui Mu via cfe-commits
https://github.com/Lancern updated https://github.com/llvm/llvm-project/pull/149696 >From 5cf3d2b203866d812c3dba0f8f6ef5ed3cde321b Mon Sep 17 00:00:00 2001 From: Sirui Mu Date: Sun, 20 Jul 2025 16:22:27 +0800 Subject: [PATCH] [CIR] Add assume_separate_storage operation This patch adds the `cir

[clang] [CIR] Add assume_separate_storage operation (PR #149696)

2025-07-20 Thread Sirui Mu via cfe-commits
https://github.com/Lancern created https://github.com/llvm/llvm-project/pull/149696 This patch adds the `cir.assume_separate_storage` operation for the `__builtin_assume_separate_storage` builtin function. >From 54fc10bc7152748c2e889e5c20948a3cb99c1912 Mon Sep 17 00:00:00 2001 From: Sirui Mu

[clang] [CIR] Add rotate operation (PR #148426)

2025-07-16 Thread Sirui Mu via cfe-commits
@@ -2898,6 +2898,45 @@ def ByteSwapOp : CIR_BitOpBase<"byte_swap", CIR_UIntOfWidths<[16, 32, 64]>> { }]; } +//===--===// +// RotateOp +//===--

[clang] [CIR] Add rotate operation (PR #148426)

2025-07-16 Thread Sirui Mu via cfe-commits
https://github.com/Lancern updated https://github.com/llvm/llvm-project/pull/148426 >From 06a18f792e92ea4ff7f576f33d92c26c30045f85 Mon Sep 17 00:00:00 2001 From: Sirui Mu Date: Sun, 13 Jul 2025 20:14:41 +0800 Subject: [PATCH] [CIR] Add rotate operation --- clang/include/clang/CIR/Dialect/IR/C

[clang] [CIR] Add rotate operation (PR #148426)

2025-07-15 Thread Sirui Mu via cfe-commits
https://github.com/Lancern updated https://github.com/llvm/llvm-project/pull/148426 >From 4d0e8a07d8503187f00a57e688e5711c1dc73aea Mon Sep 17 00:00:00 2001 From: Sirui Mu Date: Sun, 13 Jul 2025 20:14:41 +0800 Subject: [PATCH] [CIR] Add rotate operation --- clang/include/clang/CIR/Dialect/IR/C

[clang] [CIR] Add rotate operation (PR #148426)

2025-07-14 Thread Sirui Mu via cfe-commits
@@ -57,6 +57,20 @@ static RValue emitBuiltinBitOp(CIRGenFunction &cgf, const CallExpr *e, return RValue::get(result); } +RValue CIRGenFunction::emitRotate(const CallExpr *e, bool isRotateLeft) { + mlir::Value input = emitScalarExpr(e->getArg(0)); + mlir::Value amount = em

[clang] [CIR] Add rotate operation (PR #148426)

2025-07-14 Thread Sirui Mu via cfe-commits
@@ -219,6 +233,28 @@ RValue CIRGenFunction::emitBuiltinExpr(const GlobalDecl &gd, unsigned builtinID, mlir::Value arg = emitScalarExpr(e->getArg(0)); return RValue::get(builder.create(loc, arg)); } + + case Builtin::BI__builtin_rotateleft8: + case Builtin::BI__buil

[clang] [CIR] Add rotate operation (PR #148426)

2025-07-14 Thread Sirui Mu via cfe-commits
@@ -2847,6 +2847,37 @@ def ByteSwapOp : CIR_BitOpBase<"byte_swap", CIR_UIntOfWidths<[16, 32, 64]>> { }]; } +//===--===// +// RotateOp +//===--

[clang] [CIR] Add rotate operation (PR #148426)

2025-07-14 Thread Sirui Mu via cfe-commits
https://github.com/Lancern updated https://github.com/llvm/llvm-project/pull/148426 >From 996ddacdb181385b5b26a54d884f00df38a835a7 Mon Sep 17 00:00:00 2001 From: Sirui Mu Date: Sun, 13 Jul 2025 20:14:41 +0800 Subject: [PATCH] [CIR] Add rotate operation --- clang/include/clang/CIR/Dialect/IR/C

[clang] [CIR] Add rotate operation (PR #148426)

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

[clang] [CIR] Add rotate operation (PR #148426)

2025-07-14 Thread Sirui Mu via cfe-commits
@@ -57,6 +57,20 @@ static RValue emitBuiltinBitOp(CIRGenFunction &cgf, const CallExpr *e, return RValue::get(result); } +RValue CIRGenFunction::emitRotate(const CallExpr *e, bool isRotateLeft) { + mlir::Value input = emitScalarExpr(e->getArg(0)); + mlir::Value amount = em

[clang] [CIR][NFC] Resolve various nits for builtin bit operations (PR #148378)

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

[clang] [CIR] Add rotate operation (PR #148426)

2025-07-13 Thread Sirui Mu via cfe-commits
https://github.com/Lancern created https://github.com/llvm/llvm-project/pull/148426 This patch adds `cir.rotate` operation for the `__builtin_rotateleft` and `__builtin_rotateright` families of builtin calls. >From 1df58fbc1a0fa5aec67300eb240dd1ca21a30819 Mon Sep 17 00:00:00 2001 From: Sirui M

[clang] [CIR][NFC] Resolve various nits for builtin bit operations (PR #148378)

2025-07-12 Thread Sirui Mu via cfe-commits
https://github.com/Lancern created https://github.com/llvm/llvm-project/pull/148378 This patch contains fixes for various nits mentioned in #147200: - This patch removes the `bit.` prefix in the op mnemonic. The operation names now directly correspond to the builtin function names except for `

[clang] [CIR] Add bit reverse and byte reverse operations (PR #147200)

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

[clang] [CIR] Add bit reverse and byte reverse operations (PR #147200)

2025-07-11 Thread Sirui Mu via cfe-commits
Lancern wrote: I'm going to merge this and I'll send another patch to resolve the various nits in the comments. https://github.com/llvm/llvm-project/pull/147200 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mai

[clang] [CIR] Add bit reverse and byte reverse operations (PR #147200)

2025-07-11 Thread Sirui Mu via cfe-commits
@@ -2661,6 +2661,45 @@ def BitPopcountOp : CIR_BitOpBase<"bit.popcnt", }]; } +def BitReverseOp : CIR_BitOpBase<"bit.reverse", + CIR_UIntOfWidths<[8, 16, 32, 64]>> { + let summary = "Reverse the bit pattern of the operand integer"; + let desc

[clang] [CIR] Add bit reverse and byte reverse operations (PR #147200)

2025-07-11 Thread Sirui Mu via cfe-commits
https://github.com/Lancern updated https://github.com/llvm/llvm-project/pull/147200 >From fb556207b6a0504e0b767dd655ae5df146a70f30 Mon Sep 17 00:00:00 2001 From: Sirui Mu Date: Mon, 7 Jul 2025 00:45:48 +0800 Subject: [PATCH] [CIR] Add bit reverse and byte reverse operations --- clang/include/

[clang] [CIR] Add bit reverse and byte reverse operations (PR #147200)

2025-07-10 Thread Sirui Mu via cfe-commits
@@ -2661,6 +2661,45 @@ def BitPopcountOp : CIR_BitOpBase<"bit.popcnt", }]; } +def BitReverseOp : CIR_BitOpBase<"bit.reverse", + CIR_UIntOfWidths<[8, 16, 32, 64]>> { + let summary = "Reverse the bit pattern of the operand integer"; + let desc

[clang] [CIR] Add bit reverse and byte reverse operations (PR #147200)

2025-07-10 Thread Sirui Mu via cfe-commits
https://github.com/Lancern updated https://github.com/llvm/llvm-project/pull/147200 >From cf2bf0bf66f22e8fdc35baf8d4176aa5af6588d2 Mon Sep 17 00:00:00 2001 From: Sirui Mu Date: Mon, 7 Jul 2025 00:45:48 +0800 Subject: [PATCH 1/2] [CIR] Add bit reverse and byte reverse operations --- clang/incl

[clang] [CIR] Add bit reverse and byte reverse operations (PR #147200)

2025-07-10 Thread Sirui Mu via cfe-commits
@@ -2661,6 +2661,45 @@ def BitPopcountOp : CIR_BitOpBase<"bit.popcnt", }]; } +def BitReverseOp : CIR_BitOpBase<"bit.reverse", + CIR_UIntOfWidths<[8, 16, 32, 64]>> { + let summary = "Reverse the bit pattern of the operand integer"; + let desc

[clang] [CIR] Add bit reverse and byte reverse operations (PR #147200)

2025-07-09 Thread Sirui Mu via cfe-commits
@@ -2661,6 +2661,55 @@ def BitPopcountOp : CIR_BitOpBase<"bit.popcnt", }]; } +def BitReverseOp : CIR_BitOpBase<"bit.reverse", CIR_UIntOfWidths<[8, 16, 32, 64]>> { + let summary = "Reverse the bit pattern of the operand integer"; + let description = [{ +The `cir.bit.re

[clang] [CIR] Add bit reverse and byte reverse operations (PR #147200)

2025-07-09 Thread Sirui Mu via cfe-commits
https://github.com/Lancern updated https://github.com/llvm/llvm-project/pull/147200 >From cf2bf0bf66f22e8fdc35baf8d4176aa5af6588d2 Mon Sep 17 00:00:00 2001 From: Sirui Mu Date: Mon, 7 Jul 2025 00:45:48 +0800 Subject: [PATCH] [CIR] Add bit reverse and byte reverse operations --- clang/include/

[clang] [CIR] Add bit reverse and byte reverse operations (PR #147200)

2025-07-08 Thread Sirui Mu via cfe-commits
@@ -190,6 +190,26 @@ RValue CIRGenFunction::emitBuiltinExpr(const GlobalDecl &gd, unsigned builtinID, expectedValue, probAttr); return RValue::get(result); } + + case Builtin::BI__builtin_bswap16: + case Builtin::BI__buil

[clang] [CIR] Add bit reverse and byte reverse operations (PR #147200)

2025-07-08 Thread Sirui Mu via cfe-commits
https://github.com/Lancern updated https://github.com/llvm/llvm-project/pull/147200 >From 2dc9775f797f944cb0f12f68bc914a0b4bb89609 Mon Sep 17 00:00:00 2001 From: Sirui Mu Date: Mon, 7 Jul 2025 00:45:48 +0800 Subject: [PATCH] [CIR] Add bit reverse and byte reverse operations --- clang/include/

[clang] [CIR] Add bit reverse and byte reverse operations (PR #147200)

2025-07-08 Thread Sirui Mu via cfe-commits
@@ -2661,6 +2661,55 @@ def BitPopcountOp : CIR_BitOpBase<"bit.popcnt", }]; } +def BitReverseOp : CIR_BitOpBase<"bit.reverse", CIR_UIntOfWidths<[8, 16, 32, 64]>> { + let summary = "Reverse the bit pattern of the operand integer"; + let description = [{ +The `cir.bit.re

[clang] [CIR] Add bit reverse and byte reverse operations (PR #147200)

2025-07-08 Thread Sirui Mu via cfe-commits
@@ -2661,6 +2661,55 @@ def BitPopcountOp : CIR_BitOpBase<"bit.popcnt", }]; } +def BitReverseOp : CIR_BitOpBase<"bit.reverse", CIR_UIntOfWidths<[8, 16, 32, 64]>> { Lancern wrote: Well I think we need to think about what the exact scope of `CIR_BitOpBase` is

[clang] [CIR] Add bit reverse and byte reverse operations (PR #147200)

2025-07-06 Thread Sirui Mu via cfe-commits
https://github.com/Lancern created https://github.com/llvm/llvm-project/pull/147200 This patch adds support for the following two builtin functions: - `__builtin_bswap`, represented by the `cir.bswap` operation. - `__builtin_bitreverse`, represented by the `cir.bit.reverse` operation. >From 35

[clang] [CIR] Bit manipulation builtin functions (PR #146529)

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

[clang] [CIR] Add nothrow attribute to the call operation (PR #145178)

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

[clang] [CIR] Bit manipulation builtin functions (PR #146529)

2025-07-03 Thread Sirui Mu via cfe-commits
https://github.com/Lancern updated https://github.com/llvm/llvm-project/pull/146529 >From c00abbed243cf4048317031c3abde185a050a2d4 Mon Sep 17 00:00:00 2001 From: Sirui Mu Date: Tue, 1 Jul 2025 21:26:23 +0800 Subject: [PATCH] [CIR] Bit manipulation builtin functions This patch adds CIR support

[clang] [CIR] Add nothrow attribute to the call operation (PR #145178)

2025-07-03 Thread Sirui Mu via cfe-commits
https://github.com/Lancern updated https://github.com/llvm/llvm-project/pull/145178 >From ce5ccf394f039188b6a180b46979fba23b3d9d83 Mon Sep 17 00:00:00 2001 From: Sirui Mu Date: Sun, 29 Jun 2025 20:06:51 +0800 Subject: [PATCH] [CIR] Add nothrow attribute to call operations This patch adds nothr

[clang] [CIR] Add OptInfo attribute (PR #146261)

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

  1   2   3   4   >