[clang] [CIR] Add support for array constructors (PR #149142)

2025-07-17 Thread Henrich Lauko via cfe-commits
@@ -22,15 +24,97 @@ struct LoweringPreparePass : public LoweringPrepareBase { void runOnOperation() override; void runOnOp(Operation *op); + void lowerArrayCtor(ArrayCtor op); }; } // namespace -void LoweringPreparePass::runOnOp(Operation *op) {} +void LoweringPrep

[clang] [CIR] Upstream builtin_conj for ComplexType (PR #149170)

2025-07-17 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko approved this pull request. lgtm https://github.com/llvm/llvm-project/pull/149170 ___ 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 constructors (PR #149142)

2025-07-17 Thread Henrich Lauko via cfe-commits
@@ -22,15 +24,97 @@ struct LoweringPreparePass : public LoweringPrepareBase { void runOnOperation() override; void runOnOp(Operation *op); + void lowerArrayCtor(ArrayCtor op); }; } // namespace -void LoweringPreparePass::runOnOp(Operation *op) {} +void LoweringPrep

[clang] [CIR] Add support for array constructors (PR #149142)

2025-07-17 Thread Henrich Lauko via cfe-commits
@@ -22,15 +24,97 @@ struct LoweringPreparePass : public LoweringPrepareBase { void runOnOperation() override; void runOnOp(Operation *op); + void lowerArrayCtor(ArrayCtor op); }; } // namespace -void LoweringPreparePass::runOnOp(Operation *op) {} +void LoweringPrep

[clang] [CIR] Add support for array constructors (PR #149142)

2025-07-17 Thread Henrich Lauko via cfe-commits
@@ -22,15 +24,97 @@ struct LoweringPreparePass : public LoweringPrepareBase { void runOnOperation() override; void runOnOp(Operation *op); + void lowerArrayCtor(ArrayCtor op); }; } // namespace -void LoweringPreparePass::runOnOp(Operation *op) {} +void LoweringPrep

[clang] [CIR] Add support for array constructors (PR #149142)

2025-07-17 Thread Henrich Lauko via cfe-commits
@@ -22,15 +24,97 @@ struct LoweringPreparePass : public LoweringPrepareBase { void runOnOperation() override; void runOnOp(Operation *op); + void lowerArrayCtor(ArrayCtor op); }; } // namespace -void LoweringPreparePass::runOnOp(Operation *op) {} +void LoweringPrep

[clang] [CIR] Add support for array constructors (PR #149142)

2025-07-17 Thread Henrich Lauko via cfe-commits
@@ -22,15 +24,97 @@ struct LoweringPreparePass : public LoweringPrepareBase { void runOnOperation() override; void runOnOp(Operation *op); + void lowerArrayCtor(ArrayCtor op); }; } // namespace -void LoweringPreparePass::runOnOp(Operation *op) {} +void LoweringPrep

[clang] [CIR] Add support for array constructors (PR #149142)

2025-07-17 Thread Henrich Lauko via cfe-commits
@@ -22,15 +24,97 @@ struct LoweringPreparePass : public LoweringPrepareBase { void runOnOperation() override; void runOnOp(Operation *op); + void lowerArrayCtor(ArrayCtor op); }; } // namespace -void LoweringPreparePass::runOnOp(Operation *op) {} +void LoweringPrep

[clang] [CIR] Add support for array constructors (PR #149142)

2025-07-17 Thread Henrich Lauko via cfe-commits
@@ -311,6 +312,115 @@ void CIRGenFunction::emitInitializerForField(FieldDecl *field, LValue lhs, assert(!cir::MissingFeatures::requiresCleanups()); } +/// Emit a loop to call a particular constructor for each of several members +/// of an array. +/// +/// \param ctor the co

[clang] [CIR] Add support for array constructors (PR #149142)

2025-07-17 Thread Henrich Lauko via cfe-commits
@@ -22,15 +24,97 @@ struct LoweringPreparePass : public LoweringPrepareBase { void runOnOperation() override; void runOnOp(Operation *op); + void lowerArrayCtor(ArrayCtor op); }; } // namespace -void LoweringPreparePass::runOnOp(Operation *op) {} +void LoweringPrep

[clang] [CIR] Add support for array constructors (PR #149142)

2025-07-17 Thread Henrich Lauko via cfe-commits
@@ -22,15 +24,97 @@ struct LoweringPreparePass : public LoweringPrepareBase { void runOnOperation() override; void runOnOp(Operation *op); + void lowerArrayCtor(ArrayCtor op); }; } // namespace -void LoweringPreparePass::runOnOp(Operation *op) {} +void LoweringPrep

[clang] [CIR] Add support for array constructors (PR #149142)

2025-07-17 Thread Henrich Lauko via cfe-commits
@@ -22,15 +24,97 @@ struct LoweringPreparePass : public LoweringPrepareBase { void runOnOperation() override; void runOnOp(Operation *op); + void lowerArrayCtor(ArrayCtor op); xlauko wrote: ```suggestion void lowerArrayCtor(cir::ArrayCtor op); ``` ht

[clang] [CIR] Add support for array constructors (PR #149142)

2025-07-17 Thread Henrich Lauko via cfe-commits
@@ -22,15 +24,97 @@ struct LoweringPreparePass : public LoweringPrepareBase { void runOnOperation() override; void runOnOp(Operation *op); + void lowerArrayCtor(ArrayCtor op); }; } // namespace -void LoweringPreparePass::runOnOp(Operation *op) {} +void LoweringPrep

[clang] [CIR] Add support for array constructors (PR #149142)

2025-07-17 Thread Henrich Lauko via cfe-commits
@@ -2219,6 +2219,42 @@ def CIR_TrapOp : CIR_Op<"trap", [Terminator]> { let assemblyFormat = "attr-dict"; } +//===--===// +// ArrayCtor +//===--

[clang] [CIR] Add support for array constructors (PR #149142)

2025-07-17 Thread Henrich Lauko via cfe-commits
@@ -22,15 +24,97 @@ struct LoweringPreparePass : public LoweringPrepareBase { void runOnOperation() override; void runOnOp(Operation *op); + void lowerArrayCtor(ArrayCtor op); }; } // namespace -void LoweringPreparePass::runOnOp(Operation *op) {} +void LoweringPrep

[clang] [CIR] Fix alignment when lowering set/get bitfield operations (PR #148999)

2025-07-16 Thread Henrich Lauko via cfe-commits
@@ -1720,20 +1720,24 @@ def SetBitfieldOp : CIR_Op<"set_bitfield"> { %2 = cir.load %0 : !cir.ptr>, !cir.ptr %3 = cir.get_member %2[1] {name = "e"} : !cir.ptr -> !cir.ptr -%4 = cir.set_bitfield(#bfi_e, %3 :

[clang] [CIR] Fix alignment when lowering set/get bitfield operations (PR #148999)

2025-07-16 Thread Henrich Lauko via cfe-commits
@@ -1720,20 +1720,24 @@ def SetBitfieldOp : CIR_Op<"set_bitfield"> { %2 = cir.load %0 : !cir.ptr>, !cir.ptr %3 = cir.get_member %2[1] {name = "e"} : !cir.ptr -> !cir.ptr -%4 = cir.set_bitfield(#bfi_e, %3 :

[clang] [CIR][NFC] Fix LoweringPrepare pass multi lines summary (PR #148826)

2025-07-15 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko edited https://github.com/llvm/llvm-project/pull/148826 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR][NFC] Fix LoweringPrepare pass multi lines summary (PR #148826)

2025-07-15 Thread Henrich Lauko via cfe-commits
@@ -73,8 +73,8 @@ def CIRFlattenCFG : Pass<"cir-flatten-cfg"> { } def LoweringPrepare : Pass<"cir-lowering-prepare"> { - let summary = "Lower to more fine-grained CIR operations before lowering to -other dialects"; + let summary = "Lower to more fine-grained CIR operatio

[clang] [CIR][NFC] Fix typo in assertion message (Must) (PR #148704)

2025-07-15 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko closed https://github.com/llvm/llvm-project/pull/148704 ___ 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-15 Thread Henrich Lauko via cfe-commits
@@ -2898,6 +2898,45 @@ def ByteSwapOp : CIR_BitOpBase<"byte_swap", CIR_UIntOfWidths<[16, 32, 64]>> { }]; } +//===--===// +// RotateOp +//===--

[clang] [CIR] Reformat Ops to use common `CIR_` prefix and definition traits style (PR #148865)

2025-07-15 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko closed https://github.com/llvm/llvm-project/pull/148865 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Reformat Ops to use common `CIR_` prefix and definition traits style (PR #148865)

2025-07-15 Thread Henrich Lauko via cfe-commits
xlauko wrote: ### Merge activity * **Jul 15, 4:07 PM UTC**: A user started a stack merge that includes this pull request via [Graphite](https://app.graphite.dev/github/pr/llvm/llvm-project/148865). https://github.com/llvm/llvm-project/pull/148865 _

[clang] [CIR] Reformat Ops to use common `CIR_` prefix and definition traits style (PR #148865)

2025-07-15 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko ready_for_review https://github.com/llvm/llvm-project/pull/148865 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Reformat Ops to use common `CIR_` prefix and definition traits style (PR #148865)

2025-07-15 Thread Henrich Lauko via cfe-commits
xlauko wrote: * **#148865** https://app.graphite.dev/github/pr/llvm/llvm-project/148865?utm_source=stack-comment-icon"; target="_blank">https://static.graphite.dev/graphite-32x32-black.png"; alt="Graphite" width="10px" height="10px"/> 👈 https://app.graphite.dev/github/pr/llvm/llvm-project/14886

[clang] [CIR] Reformat Ops to use common `CIR_` prefix and definition traits style (PR #148865)

2025-07-15 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko created https://github.com/llvm/llvm-project/pull/148865 - This adds common CIR_ prefix to all operation disambiguating them when used with other dialects. - Unifies traits style in operation definitions. This mirrors incubator changes from https://github.com/llvm/cla

[clang] [CIR] Add VTableAddrPointOp (PR #148730)

2025-07-15 Thread Henrich Lauko via cfe-commits
@@ -1669,6 +1669,51 @@ def GetGlobalOp : CIR_Op<"get_global", }]; } +//===--===// +// VTableAddrPointOp +//===--===// + +def VTableAddrPoin

[clang] [CIR] Upstream unary not for ComplexType (PR #148857)

2025-07-15 Thread Henrich Lauko via cfe-commits
@@ -22,15 +24,68 @@ struct LoweringPreparePass : public LoweringPrepareBase { void runOnOperation() override; void runOnOp(Operation *op); + void lowerUnaryOp(UnaryOp op); }; } // namespace -void LoweringPreparePass::runOnOp(Operation *op) {} +void LoweringPrepareP

[clang] [CIR] Upstream unary not for ComplexType (PR #148857)

2025-07-15 Thread Henrich Lauko via cfe-commits
@@ -22,15 +24,68 @@ struct LoweringPreparePass : public LoweringPrepareBase { void runOnOperation() override; void runOnOp(Operation *op); + void lowerUnaryOp(UnaryOp op); }; } // namespace -void LoweringPreparePass::runOnOp(Operation *op) {} +void LoweringPrepareP

[clang] [CIR] Upstream unary not for ComplexType (PR #148857)

2025-07-15 Thread Henrich Lauko via cfe-commits
@@ -22,15 +24,68 @@ struct LoweringPreparePass : public LoweringPrepareBase { void runOnOperation() override; void runOnOp(Operation *op); + void lowerUnaryOp(UnaryOp op); }; } // namespace -void LoweringPreparePass::runOnOp(Operation *op) {} +void LoweringPrepareP

[clang] [CIR] Upstream unary not for ComplexType (PR #148857)

2025-07-15 Thread Henrich Lauko via cfe-commits
@@ -22,15 +24,68 @@ struct LoweringPreparePass : public LoweringPrepareBase { void runOnOperation() override; void runOnOp(Operation *op); + void lowerUnaryOp(UnaryOp op); }; } // namespace -void LoweringPreparePass::runOnOp(Operation *op) {} +void LoweringPrepareP

[clang] [CIR] Separate CIR EnumAttr definitions to be includable without the rest of attributes (PR #148850)

2025-07-15 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko closed https://github.com/llvm/llvm-project/pull/148850 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Separate CIR EnumAttr definitions to be includable without the rest of attributes (PR #148850)

2025-07-15 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko updated https://github.com/llvm/llvm-project/pull/148850 >From af05c669896f4b7433454b02c43506702f3a76a4 Mon Sep 17 00:00:00 2001 From: xlauko Date: Tue, 15 Jul 2025 15:34:45 +0200 Subject: [PATCH] [CIR] Separate CIR EnumAttr definitions to be includable without the re

[clang] [CIR] Refactor include guards to use a consistent naming (NFC) (PR #148849)

2025-07-15 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko closed https://github.com/llvm/llvm-project/pull/148849 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Separate CIR EnumAttr definitions to be includable without the rest of attributes (PR #148850)

2025-07-15 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko edited https://github.com/llvm/llvm-project/pull/148850 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Refactor include guards to use a consistent naming (NFC) (PR #148849)

2025-07-15 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko updated https://github.com/llvm/llvm-project/pull/148849 >From 9dbdad18c07e44eafaf5c8abe867e9311e11eb68 Mon Sep 17 00:00:00 2001 From: xlauko Date: Tue, 15 Jul 2025 15:29:04 +0200 Subject: [PATCH] [CIR] Refactor include guards to use a consistent naming (NFC) --- cl

[clang] [CIR] Refactor include guards to use a consistent naming (NFC) (PR #148849)

2025-07-15 Thread Henrich Lauko via cfe-commits
xlauko wrote: ### Merge activity * **Jul 15, 2:11 PM UTC**: A user started a stack merge that includes this pull request via [Graphite](https://app.graphite.dev/github/pr/llvm/llvm-project/148849). https://github.com/llvm/llvm-project/pull/148849 _

[clang] [CIR][NFC] Fix typo in assertion message (Must) (PR #148704)

2025-07-15 Thread Henrich Lauko via cfe-commits
xlauko wrote: ### Merge activity * **Jul 15, 1:52 PM UTC**: A user started a stack merge that includes this pull request via [Graphite](https://app.graphite.dev/github/pr/llvm/llvm-project/148704). https://github.com/llvm/llvm-project/pull/148704 _

[clang] [CIR] Refactor include guards to use a consistent naming (NFC) (PR #148849)

2025-07-15 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko ready_for_review https://github.com/llvm/llvm-project/pull/148849 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Refactor include guards to use a consistent naming (NFC) (PR #148849)

2025-07-15 Thread Henrich Lauko via cfe-commits
xlauko wrote: * **#148850** https://app.graphite.dev/github/pr/llvm/llvm-project/148850?utm_source=stack-comment-icon"; target="_blank">https://static.graphite.dev/graphite-32x32-black.png"; alt="Graphite" width="10px" height="10px"/> * **#148849** https://app.graphite.dev/github/pr/llvm/llvm-p

[clang] [CIR] Refactor include guards to use a consistent naming (NFC) (PR #148849)

2025-07-15 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko created https://github.com/llvm/llvm-project/pull/148849 None >From 961c62aa95b65a5c605da0b40b21c770f9f2ccb1 Mon Sep 17 00:00:00 2001 From: xlauko Date: Tue, 15 Jul 2025 15:29:04 +0200 Subject: [PATCH] [CIR] Refactor include guards to use a consistent naming (NFC) -

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

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

[clang] [CIR] Add VTableAddrPointOp (PR #148730)

2025-07-15 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko edited https://github.com/llvm/llvm-project/pull/148730 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Add VTableAddrPointOp (PR #148730)

2025-07-15 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko edited https://github.com/llvm/llvm-project/pull/148730 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Add VTableAddrPointOp (PR #148730)

2025-07-15 Thread Henrich Lauko via cfe-commits
@@ -515,5 +515,35 @@ def BitfieldInfoAttr : CIR_Attr<"BitfieldInfo", "bitfield_info"> { ]; } +//===--===// +// AddressPointAttr +//===--==

[clang] [CIR] Add VTableAddrPointOp (PR #148730)

2025-07-15 Thread Henrich Lauko via cfe-commits
@@ -515,5 +515,35 @@ def BitfieldInfoAttr : CIR_Attr<"BitfieldInfo", "bitfield_info"> { ]; } +//===--===// +// AddressPointAttr +//===--==

[clang] [CIR] Add VTableAddrPointOp (PR #148730)

2025-07-15 Thread Henrich Lauko via cfe-commits
@@ -1669,6 +1669,51 @@ def GetGlobalOp : CIR_Op<"get_global", }]; } +//===--===// +// VTableAddrPointOp +//===--===// + +def VTableAddrPoin

[clang] [CIR] Add VTableAddrPointOp (PR #148730)

2025-07-15 Thread Henrich Lauko via cfe-commits
@@ -515,5 +515,35 @@ def BitfieldInfoAttr : CIR_Attr<"BitfieldInfo", "bitfield_info"> { ]; } +//===--===// +// AddressPointAttr +//===--==

[clang] [CIR] Add VTableAddrPointOp (PR #148730)

2025-07-15 Thread Henrich Lauko via cfe-commits
@@ -1669,6 +1669,51 @@ def GetGlobalOp : CIR_Op<"get_global", }]; } +//===--===// +// VTableAddrPointOp +//===--===// + +def VTableAddrPoin

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

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

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

2025-07-14 Thread Henrich Lauko 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 Henrich Lauko 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] Upstream ComplexImagPtrOp for ComplexType (PR #144236)

2025-07-14 Thread Henrich Lauko via cfe-commits
@@ -2642,6 +2642,36 @@ def ComplexRealPtrOp : CIR_Op<"complex.real_ptr", [Pure]> { let hasVerifier = 1; } +//===--===// +// ComplexImagPtrOp +//===---

[clang] [CIR] Upstream ComplexImagPtrOp for ComplexType (PR #144236)

2025-07-14 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko edited https://github.com/llvm/llvm-project/pull/144236 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream ComplexImagPtrOp for ComplexType (PR #144236)

2025-07-14 Thread Henrich Lauko via cfe-commits
@@ -2642,6 +2642,36 @@ def ComplexRealPtrOp : CIR_Op<"complex.real_ptr", [Pure]> { let hasVerifier = 1; } +//===--===// +// ComplexImagPtrOp +//===---

[clang] [CIR] Upstream ComplexImagPtrOp for ComplexType (PR #144236)

2025-07-14 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko approved this pull request. lgtm, with minor nits https://github.com/llvm/llvm-project/pull/144236 ___ 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 Henrich Lauko 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 Henrich Lauko 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 Henrich Lauko 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 Henrich Lauko 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 Henrich Lauko 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 Henrich Lauko via cfe-commits
@@ -872,6 +872,21 @@ mlir::LogicalResult CIRToLLVMReturnOpLowering::matchAndRewrite( return mlir::LogicalResult::success(); } +mlir::LogicalResult CIRToLLVMRotateOpLowering::matchAndRewrite( +cir::RotateOp op, OpAdaptor adaptor, +mlir::ConversionPatternRewriter &rew

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

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

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

2025-07-14 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko approved this pull request. lgtm, please apply these changes to incubator as well https://github.com/llvm/llvm-project/pull/148378 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/

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

2025-07-14 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko edited 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 support for non-virtual base class initialization (PR #148080)

2025-07-11 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko approved this pull request. lgtm https://github.com/llvm/llvm-project/pull/148080 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Implement AddOp for ComplexType (PR #147578)

2025-07-09 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko edited https://github.com/llvm/llvm-project/pull/147578 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Implement AddOp for ComplexType (PR #147578)

2025-07-09 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko edited https://github.com/llvm/llvm-project/pull/147578 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Implement AddOp for ComplexType (PR #147578)

2025-07-09 Thread Henrich Lauko via cfe-commits
@@ -2357,6 +2358,56 @@ mlir::LogicalResult CIRToLLVMVecTernaryOpLowering::matchAndRewrite( return mlir::success(); } +mlir::LogicalResult CIRToLLVMComplexAddOpLowering::matchAndRewrite( +cir::ComplexAddOp op, OpAdaptor adaptor, +mlir::ConversionPatternRewriter &rewr

[clang] [CIR] Implement AddOp for ComplexType (PR #147578)

2025-07-09 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko approved this pull request. lgtm with minot nit https://github.com/llvm/llvm-project/pull/147578 ___ 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-09 Thread Henrich Lauko 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] Fold ComplexRealOp from ComplexCreateOp (PR #147592)

2025-07-09 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko edited https://github.com/llvm/llvm-project/pull/147592 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Fold ComplexRealOp from ComplexCreateOp (PR #147592)

2025-07-09 Thread Henrich Lauko via cfe-commits
xlauko wrote: I don't see real use of not allowing this by default, as this is essentially identity folding, not really optimization? And applying folds is way cheaper then rewrite patterns later. Though yes, I agree we should have discussion where is the borderline, for instance `UnaryOp::fol

[clang] [CIR] Fold ComplexRealOp from ComplexCreateOp (PR #147592)

2025-07-09 Thread Henrich Lauko via cfe-commits
@@ -1,4 +1,4 @@ -// RUN: cir-opt %s -cir-canonicalize -o - | FileCheck %s +// RUN: cir-opt %s -cir-canonicalize -o - -split-input-file | FileCheck %s xlauko wrote: ```suggestion // RUN: cir-opt %s -cir-canonicalize -o - -split-input-file | FileCheck %s ``` http

[clang] [CIR] Implement AddOp for ComplexType (PR #147578)

2025-07-09 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko edited https://github.com/llvm/llvm-project/pull/147578 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Implement AddOp for ComplexType (PR #147578)

2025-07-09 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko edited https://github.com/llvm/llvm-project/pull/147578 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Implement AddOp for ComplexType (PR #147578)

2025-07-09 Thread Henrich Lauko via cfe-commits
@@ -2521,6 +2521,32 @@ def ComplexImagOp : CIR_Op<"complex.imag", [Pure]> { let hasFolder = 1; } +//===--===// +// ComplexAddOp +//===--===

[clang] [CIR] Implement AddOp for ComplexType (PR #147578)

2025-07-09 Thread Henrich Lauko via cfe-commits
@@ -2521,6 +2521,32 @@ def ComplexImagOp : CIR_Op<"complex.imag", [Pure]> { let hasFolder = 1; } +//===--===// +// ComplexAddOp +//===--===

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

2025-07-08 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko edited 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] Propose new ClangIR Maintainer (PR #147365)

2025-07-08 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko approved this pull request. https://github.com/llvm/llvm-project/pull/147365 ___ 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-08 Thread Henrich Lauko 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]>> { xlauko wrote: These are inherited from `CIR_BitOpBase`. https://github.com/llvm/llvm-project

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

2025-07-08 Thread Henrich Lauko 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 Henrich Lauko 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 Henrich Lauko 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 Henrich Lauko 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]>> { xlauko wrote: I would also suggest to rename to `bitreverse` to mirror builtins name. Also d

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

2025-07-08 Thread Henrich Lauko 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]>> { xlauko wrote: ```suggestion def CIR_BitReverseOp : CIR_BitOpBase<"bit.reverse", CIR_UI

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

2025-07-08 Thread Henrich Lauko 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 support for parsing complete records (PR #147403)

2025-07-08 Thread Henrich Lauko via cfe-commits
xlauko wrote: Can you add to CIR_RecordType description an example with packed/padded flag? https://github.com/llvm/llvm-project/pull/147403 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-com

[clang] [CIR] Implement CXXScalarValueInitExpr for ComplexType (PR #147143)

2025-07-07 Thread Henrich Lauko via cfe-commits
@@ -165,12 +165,8 @@ mlir::Value ComplexExprEmitter::VisitChooseExpr(ChooseExpr *e) { mlir::Value ComplexExprEmitter::VisitCXXScalarValueInitExpr(CXXScalarValueInitExpr *e) { mlir::Location loc = cgf.getLoc(e->getExprLoc()); - QualType complexElemTy = - e->getType()->c

[clang] [cir-translate] Fix crash issue where the data layout string is missing (PR #147209)

2025-07-07 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko deleted https://github.com/llvm/llvm-project/pull/147209 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [cir-translate] Fix crash issue where the data layout string is missing (PR #147209)

2025-07-07 Thread Henrich Lauko via cfe-commits
@@ -82,12 +85,17 @@ llvm::LogicalResult prepareCIRModuleDataLayout(mlir::ModuleOp mod, // Data layout is fully determined by the target triple. Here we only pass the // triple to get the data layout. + llvm::IntrusiveRefCntPtr diagID( + new clang::DiagnosticIDs); +

[clang] [CIR] Implement functional cast to ComplexType (PR #147147)

2025-07-06 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko approved this pull request. lgtm https://github.com/llvm/llvm-project/pull/147147 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Implement functional cast to ComplexType (PR #147147)

2025-07-06 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko edited https://github.com/llvm/llvm-project/pull/147147 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Untie Type and Attribute definitions (PR #146663)

2025-07-02 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko closed https://github.com/llvm/llvm-project/pull/146663 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Untie Type and Attribute definitions (PR #146663)

2025-07-02 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko updated https://github.com/llvm/llvm-project/pull/146663 >From 71407d50dc2599e351d8c2e46b9f826308d349f8 Mon Sep 17 00:00:00 2001 From: xlauko Date: Wed, 2 Jul 2025 12:16:53 +0200 Subject: [PATCH] [CIR] Untie Type and Attribute definitions This will allow to use Attrib

[clang] [CIR] Untie Type and Attribute definitions (PR #146663)

2025-07-02 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko updated https://github.com/llvm/llvm-project/pull/146663 >From 465c4650e33610c812b5240a05fd28f1b03b800a Mon Sep 17 00:00:00 2001 From: xlauko Date: Wed, 2 Jul 2025 12:16:53 +0200 Subject: [PATCH] [CIR] Untie Type and Attribute definitions This will allow to use Attrib

[clang] [CIR] Untie Type and Attribute definitions (PR #146663)

2025-07-02 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko updated https://github.com/llvm/llvm-project/pull/146663 >From aa3016db7986982d72aee5cb1a1e6b40ef9be68b Mon Sep 17 00:00:00 2001 From: xlauko Date: Wed, 2 Jul 2025 12:16:53 +0200 Subject: [PATCH] [CIR] Untie Type and Attribute definitions This will allow to use Attrib

[clang] [CIR] Untie Type and Attribute definitions (PR #146663)

2025-07-02 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko edited https://github.com/llvm/llvm-project/pull/146663 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Clean up FPAttr (PR #146662)

2025-07-02 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko closed https://github.com/llvm/llvm-project/pull/146662 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Clean up FPAttr (PR #146662)

2025-07-02 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko updated https://github.com/llvm/llvm-project/pull/146662 >From 5d8c80501735c96f600e6454adec33a6c5ead4e0 Mon Sep 17 00:00:00 2001 From: xlauko Date: Wed, 2 Jul 2025 09:56:38 +0200 Subject: [PATCH] [CIR] Clean up FPAttr - Adds CIR_ prefix to the definition - Removes red

  1   2   3   4   5   >