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
@@ -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
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
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
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
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
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
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
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
@@ -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
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
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
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
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
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
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
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
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
@@ -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
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
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
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: [
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
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
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
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
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
@@ -460,6 +460,28 @@ mlir::LogicalResult
CIRToLLVMAssumeOpLowering::matchAndRewrite(
return mlir::success();
}
+mlir::LogicalResult CIRToLLVMAssumeAlignedOpLowering::matchAndRewrite(
+cir::AssumeAlignedOp op, OpAdaptor adaptor,
+mlir::ConversionPatternRewriter &rewr
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
@@ -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
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
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
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
@@ -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
@@ -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
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
@@ -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: {
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
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
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
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
@@ -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: {
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:
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
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
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
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
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
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
@@ -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+
@@ -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
@@ -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
@@ -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
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
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
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
@@ -2132,6 +2133,117 @@ LogicalResult cir::ComplexImagPtrOp::verify() {
return success();
}
+//===--===//
+// Bit manipulation operations
+//===---
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
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
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
@@ -2132,6 +2133,117 @@ LogicalResult cir::ComplexImagPtrOp::verify() {
return success();
}
+//===--===//
+// Bit manipulation operations
+//===---
@@ -2132,6 +2133,117 @@ LogicalResult cir::ComplexImagPtrOp::verify() {
return success();
}
+//===--===//
+// Bit manipulation operations
+//===---
@@ -2132,6 +2133,117 @@ LogicalResult cir::ComplexImagPtrOp::verify() {
return success();
}
+//===--===//
+// Bit manipulation operations
+//===---
@@ -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
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
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
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
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
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
@@ -2898,6 +2898,45 @@ def ByteSwapOp : CIR_BitOpBase<"byte_swap",
CIR_UIntOfWidths<[16, 32, 64]>> {
}];
}
+//===--===//
+// RotateOp
+//===--
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
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
@@ -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
@@ -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
@@ -2847,6 +2847,37 @@ def ByteSwapOp : CIR_BitOpBase<"byte_swap",
CIR_UIntOfWidths<[16, 32, 64]>> {
}];
}
+//===--===//
+// RotateOp
+//===--
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
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
@@ -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
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
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
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 `
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
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
@@ -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
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/
@@ -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
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
@@ -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
@@ -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
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/
@@ -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
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/
@@ -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
@@ -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
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
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
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
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
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
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 - 100 of 315 matches
Mail list logo