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

2025-07-17 Thread Bruno Cardoso Lopes 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 Bruno Cardoso Lopes via cfe-commits
@@ -2219,6 +2219,50 @@ 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 Bruno Cardoso Lopes via cfe-commits
@@ -805,4 +805,50 @@ bool CIRGenFunction::shouldNullCheckClassCastValue(const CastExpr *ce) { return true; } +/// Computes the length of an array in elements, as well as the base +/// element type and a properly-typed first element pointer. +mlir::Value +CIRGenFunction::emi

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

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

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

2025-07-17 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes approved this pull request. LGTM after existing comments are addressed, nothing else to add on my part. https://github.com/llvm/llvm-project/pull/148999 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://li

[clang] [CIR] Upstream CompoundLiteralExpr for Scalar (PR #148943)

2025-07-17 Thread Bruno Cardoso Lopes via cfe-commits
@@ -1053,6 +1053,68 @@ LValue CIRGenFunction::emitMemberExpr(const MemberExpr *e) { llvm_unreachable("Unhandled member declaration!"); } +/// Evaluate an expression into a given memory location. +void CIRGenFunction::emitAnyExprToMem(const Expr *e, Address location, +

[clang] [Clang] Fix FE crash during CGCoroutine GRO Alloca Emission (PR #148962)

2025-07-15 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/148962 ___ 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 Bruno Cardoso Lopes via cfe-commits
@@ -515,5 +515,35 @@ def BitfieldInfoAttr : CIR_Attr<"BitfieldInfo", "bitfield_info"> { ]; } +//===--===// +// AddressPointAttr +//===--==

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

2025-07-14 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes approved this pull request. 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] Upstream the basic structure of LoweringPrepare pass (PR #148545)

2025-07-14 Thread Bruno Cardoso Lopes via cfe-commits
@@ -72,4 +72,14 @@ def CIRFlattenCFG : Pass<"cir-flatten-cfg"> { let dependentDialects = ["cir::CIRDialect"]; } +def LoweringPrepare : Pass<"cir-lowering-prepare"> { + let summary = "Preparation work before lowering to LLVM dialect"; + let description = [{ +This pass d

[clang] [CIR] Upstream the basic structure of LoweringPrepare pass (PR #148545)

2025-07-14 Thread Bruno Cardoso Lopes via cfe-commits
@@ -72,4 +72,14 @@ def CIRFlattenCFG : Pass<"cir-flatten-cfg"> { let dependentDialects = ["cir::CIRDialect"]; } +def LoweringPrepare : Pass<"cir-lowering-prepare"> { + let summary = "Preparation work before lowering to LLVM dialect"; bcardosolopes wrote: `

[clang] [CIR] Upstream the basic structure of LoweringPrepare pass (PR #148545)

2025-07-14 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes edited https://github.com/llvm/llvm-project/pull/148545 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream the basic structure of LoweringPrepare pass (PR #148545)

2025-07-14 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes approved this pull request. We need to update some of the entries because they are old now, so a few comments on that, otherwise LGTM https://github.com/llvm/llvm-project/pull/148545 ___ cfe-commits mailing list cfe-co

[clang] [Clang] Partial implementation of support for P3074 (trivial unions) (PR #146815)

2025-07-09 Thread Bruno Cardoso Lopes via cfe-commits
@@ -9543,6 +9543,48 @@ bool SpecialMemberDeletionInfo::shouldDeleteForSubobjectCall( if (DiagKind == -1) return false; + if (this->S.Context.getLangOpts().CPlusPlus26 && inUnion() && + CSM == CXXSpecialMemberKind::Destructor) { +// [class.dtor]/7 In C++26, a d

[clang] [Clang] Partial implementation of support for P3074 (trivial unions) (PR #146815)

2025-07-09 Thread Bruno Cardoso Lopes via cfe-commits
@@ -9543,6 +9543,48 @@ bool SpecialMemberDeletionInfo::shouldDeleteForSubobjectCall( if (DiagKind == -1) return false; + if (this->S.Context.getLangOpts().CPlusPlus26 && inUnion() && + CSM == CXXSpecialMemberKind::Destructor) { +// [class.dtor]/7 In C++26, a d

[clang] [Clang] Partial implementation of support for P3074 (trivial unions) (PR #146815)

2025-07-09 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes commented: Added more reviewers and some nits https://github.com/llvm/llvm-project/pull/146815 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Partial implementation of support for P3074 (trivial unions) (PR #146815)

2025-07-09 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes edited https://github.com/llvm/llvm-project/pull/146815 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Partial implementation of support for P3074 (trivial unions) (PR #146815)

2025-07-09 Thread Bruno Cardoso Lopes via cfe-commits
@@ -9543,6 +9543,48 @@ bool SpecialMemberDeletionInfo::shouldDeleteForSubobjectCall( if (DiagKind == -1) return false; + if (this->S.Context.getLangOpts().CPlusPlus26 && inUnion() && + CSM == CXXSpecialMemberKind::Destructor) { +// [class.dtor]/7 In C++26, a d

[clang] [CIR] Add test for parsing bitfield_info attribute (PR #147628)

2025-07-09 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes approved this pull request. Nice, tks! https://github.com/llvm/llvm-project/pull/147628 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream new SetBitfieldOp for handling C and C++ struct bitfields (PR #147609)

2025-07-09 Thread Bruno Cardoso Lopes via cfe-commits
@@ -1669,6 +1669,90 @@ def GetGlobalOp : CIR_Op<"get_global", }]; } +//===--===// +// SetBitfieldOp +//===--===// + +def SetBitfieldOp : CI

[clang] [CIR] Upstream new SetBitfieldOp for handling C and C++ struct bitfields (PR #147609)

2025-07-09 Thread Bruno Cardoso Lopes via cfe-commits
@@ -1669,6 +1669,90 @@ def GetGlobalOp : CIR_Op<"get_global", }]; } +//===--===// +// SetBitfieldOp +//===--===// + +def SetBitfieldOp : CI

[clang] [CIR] Upstream new SetBitfieldOp for handling C and C++ struct bitfields (PR #147609)

2025-07-09 Thread Bruno Cardoso Lopes via cfe-commits
@@ -2384,6 +2385,82 @@ mlir::LogicalResult CIRToLLVMComplexImagOpLowering::matchAndRewrite( return mlir::success(); } +mlir::LogicalResult CIRToLLVMSetBitfieldOpLowering::matchAndRewrite( +cir::SetBitfieldOp op, OpAdaptor adaptor, +mlir::ConversionPatternRewriter &r

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

2025-07-09 Thread Bruno Cardoso Lopes via cfe-commits
@@ -2066,6 +2066,11 @@ LogicalResult cir::ComplexRealOp::verify() { } OpFoldResult cir::ComplexRealOp::fold(FoldAdaptor adaptor) { + if (auto complexCreateOp = dyn_cast_or_null( + getOperand().getDefiningOp())) { +return complexCreateOp.getOperand(0); + } --

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

2025-07-09 Thread Bruno Cardoso Lopes via cfe-commits
bcardosolopes wrote: > if transformations like this should be implemented in cir-simplify For this specific one I agree with @xlauko, it could have already come out of CIRGen like this without any hurting source fidelity. For anything slightly more cir-simplify should be used. We just went thr

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

2025-07-09 Thread Bruno Cardoso Lopes 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 Bruno Cardoso Lopes via cfe-commits
@@ -2521,6 +2521,32 @@ def ComplexImagOp : CIR_Op<"complex.imag", [Pure]> { let hasFolder = 1; } +//===--===// +// ComplexAddOp +//===--===

[clang] Propose new ClangIR Maintainer (PR #147365)

2025-07-09 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes closed 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-translate] Fix crash issue where the data layout string is missing (PR #147209)

2025-07-09 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes approved this pull request. LGTM pending my last comment 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-commi

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

2025-07-09 Thread Bruno Cardoso Lopes 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-translate] Fix crash issue where the data layout string is missing (PR #147209)

2025-07-09 Thread Bruno Cardoso Lopes 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] Upstream __builtin_creal for ComplexType (PR #146927)

2025-07-09 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/146927 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [OpenACC][CIR] 'cache' construct lowering (PR #146915)

2025-07-03 Thread Bruno Cardoso Lopes via cfe-commits
@@ -1204,7 +1204,41 @@ class CIRGenFunction : public CIRGenTypeCache { void updateLoopOpParallelism(mlir::acc::LoopOp &op, bool isOrphan, OpenACCDirectiveKind dk); + // The OpenACC 'cache' construct actually applies to the 'loop' if present.

[clang] [OpenACC][CIR] 'cache' construct lowering (PR #146915)

2025-07-03 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes approved this pull request. Overall looks good, one question and one nit! https://github.com/llvm/llvm-project/pull/146915 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/l

[clang] [OpenACC][CIR] 'cache' construct lowering (PR #146915)

2025-07-03 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes edited https://github.com/llvm/llvm-project/pull/146915 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [OpenACC][CIR] 'cache' construct lowering (PR #146915)

2025-07-03 Thread Bruno Cardoso Lopes via cfe-commits
bcardosolopes wrote: > This did require some work to ensure that the cache doesn't have 'vars' that > aren't inside of the loop, but Sema is taking care of that with a warning Because it's a warning, is there anything we can add to existing verifiers to sanity check the invariant? https://git

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

2025-07-02 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes edited 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] Add nothrow attribute to the call operation (PR #145178)

2025-07-02 Thread Bruno Cardoso Lopes via cfe-commits
@@ -662,13 +665,17 @@ static void printCallCommon(mlir::Operation *op, } printer << "(" << ops << ")"; + if (isNothrow) +printer << " nothrow"; bcardosolopes wrote: Fair, this should go away if we end up using a tablegen based printer/parser at some

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

2025-07-02 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes commented: Thanks for updating the other attributes names as well, way to go. https://github.com/llvm/llvm-project/pull/145178 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mail

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

2025-07-01 Thread Bruno Cardoso Lopes via cfe-commits
@@ -77,17 +77,38 @@ void CIRGenFunction::emitAggregateStore(mlir::Value value, Address dest) { builder.createStore(*currSrcLoc, value, dest); } +static void addAttributesFromFunctionProtoType(CIRGenBuilderTy &builder, + mlir::Na

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

2025-07-01 Thread Bruno Cardoso Lopes via cfe-commits
@@ -662,13 +665,17 @@ static void printCallCommon(mlir::Operation *op, } printer << "(" << ops << ")"; + if (isNothrow) +printer << " nothrow"; bcardosolopes wrote: and here! https://github.com/llvm/llvm-project/pull/145178 _

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

2025-07-01 Thread Bruno Cardoso Lopes via cfe-commits
@@ -611,6 +611,9 @@ static mlir::ParseResult parseCallCommon(mlir::OpAsmParser &parser, if (parser.parseRParen()) return mlir::failure(); + if (parser.parseOptionalKeyword("nothrow").succeeded()) +result.addAttribute("nothrow", mlir::UnitAttr::get(parser.getContext

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

2025-07-01 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes commented: Thanks for the changes, more comments! 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] Add nothrow attribute to the call operation (PR #145178)

2025-07-01 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes edited 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] Add nothrow attribute to the call operation (PR #145178)

2025-07-01 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes edited 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] Add nothrow attribute to the call operation (PR #145178)

2025-07-01 Thread Bruno Cardoso Lopes via cfe-commits
@@ -227,26 +227,24 @@ class CIRBaseBuilderTy : public mlir::OpBuilder { //======// cir::CallOp createCallOp(mlir::Location loc, mlir::SymbolRefAttr callee, - mlir::Type returnTyp

[clang] [CIR] Add basic support for operator new (PR #145802)

2025-06-26 Thread Bruno Cardoso Lopes via cfe-commits
@@ -95,6 +95,7 @@ CIRGenModule::CIRGenModule(mlir::MLIRContext &mlirContext, // TODO(CIR): Should be updated once TypeSizeInfoAttr is upstreamed const unsigned sizeTypeSize = astContext.getTypeSize(astContext.getSignedSizeType()); + SizeSizeInBytes = astContext.toCha

[clang] [CIR] Add basic support for operator new (PR #145802)

2025-06-26 Thread Bruno Cardoso Lopes via cfe-commits
@@ -95,6 +95,7 @@ CIRGenModule::CIRGenModule(mlir::MLIRContext &mlirContext, // TODO(CIR): Should be updated once TypeSizeInfoAttr is upstreamed const unsigned sizeTypeSize = astContext.getTypeSize(astContext.getSignedSizeType()); + SizeSizeInBytes = astContext.toCha

[clang] [CIR] Add basic support for operator new (PR #145802)

2025-06-26 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes approved this pull request. LGTM, one minor comment https://github.com/llvm/llvm-project/pull/145802 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Add basic support for operator new (PR #145802)

2025-06-26 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes edited https://github.com/llvm/llvm-project/pull/145802 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Add support for constructor aliases (PR #145792)

2025-06-26 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes edited https://github.com/llvm/llvm-project/pull/145792 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Add support for constructor aliases (PR #145792)

2025-06-26 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes approved this pull request. LGTM one minor comment https://github.com/llvm/llvm-project/pull/145792 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Add support for constructor aliases (PR #145792)

2025-06-26 Thread Bruno Cardoso Lopes via cfe-commits
@@ -1772,7 +1772,8 @@ def FuncOp : CIR_Op<"func", [ OptionalAttr:$sym_visibility, UnitAttr:$comdat, OptionalAttr:$arg_attrs, - OptionalAttr:$res_attrs); + OptionalAt

[clang] [CIR] Initial extra attributes for call operation (PR #145178)

2025-06-26 Thread Bruno Cardoso Lopes via cfe-commits
@@ -368,4 +368,34 @@ def CIR_VisibilityAttr : CIR_Attr<"Visibility", "visibility"> { }]; } +//===--===// +// ExtraFuncAttributesAttr +//===---

[clang] [CIR] Add support for bitfields in unions (PR #145096)

2025-06-24 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes closed https://github.com/llvm/llvm-project/pull/145096 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Restore the underscore in dso_local (PR #145551)

2025-06-24 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes approved this pull request. https://github.com/llvm/llvm-project/pull/145551 ___ 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_expect (PR #144726)

2025-06-24 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes closed https://github.com/llvm/llvm-project/pull/144726 ___ 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_expect (PR #144726)

2025-06-23 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes approved this pull request. LGTM w one extra minor suggestion https://github.com/llvm/llvm-project/pull/144726 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-

[clang] [CIR] Add bitfield offset calculation for big-endian targets (PR #145067)

2025-06-23 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes approved this pull request. Nice to see this done Incrementally, LGTM. https://github.com/llvm/llvm-project/pull/145067 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/list

[clang] [CIR] Upstream ChooseExpr for ComplexType (PR #145163)

2025-06-23 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/145163 ___ 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_expect (PR #144726)

2025-06-23 Thread Bruno Cardoso Lopes via cfe-commits
@@ -989,6 +989,19 @@ mlir::LogicalResult CIRToLLVMConstantOpLowering::matchAndRewrite( return mlir::success(); } +mlir::LogicalResult CIRToLLVMExpectOpLowering::matchAndRewrite( +cir::ExpectOp op, OpAdaptor adaptor, +mlir::ConversionPatternRewriter &rewriter) const

[clang] [CIR] Add support for DumpRecordLayouts (PR #145058)

2025-06-23 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes approved this pull request. Pretty straightforward, thanks! Do you mind backporting this to the incubator when you get the chance? https://github.com/llvm/llvm-project/pull/145058 ___ cfe-commits mailing list cfe-commi

[clang] [CIR] Clean up enum attributes (PR #144999)

2025-06-23 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes approved this pull request. Thanks for all these cleanups, great! https://github.com/llvm/llvm-project/pull/144999 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/

[clang] [CIR] Remove redundant operation trait and use AllTypesMatch instead (PR #144950)

2025-06-23 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes approved this pull request. Awesome! https://github.com/llvm/llvm-project/pull/144950 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream support for builtin_vectorelements (PR #144877)

2025-06-23 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/144877 ___ 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_expect (PR #144726)

2025-06-23 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes edited https://github.com/llvm/llvm-project/pull/144726 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream __imag__ for ComplexType (PR #144262)

2025-06-23 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes approved this pull request. https://github.com/llvm/llvm-project/pull/144262 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream __real__ for ComplexType (PR #144261)

2025-06-23 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes approved this pull request. https://github.com/llvm/llvm-project/pull/144261 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Add support for member initialization from constructors (PR #144583)

2025-06-18 Thread Bruno Cardoso Lopes via cfe-commits
@@ -53,19 +53,135 @@ bool CIRGenFunction::isConstructorDelegationValid( return true; } +static void emitLValueForAnyFieldInitialization(CIRGenFunction &cgf, +CXXCtorInitializer *memberInit, +

[clang] [CIR] Add support for member initialization from constructors (PR #144583)

2025-06-18 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes edited https://github.com/llvm/llvm-project/pull/144583 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Add support for member initialization from constructors (PR #144583)

2025-06-18 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes approved this pull request. LGTM module few nits https://github.com/llvm/llvm-project/pull/144583 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Add support for member initialization from constructors (PR #144583)

2025-06-18 Thread Bruno Cardoso Lopes via cfe-commits
@@ -53,19 +53,135 @@ bool CIRGenFunction::isConstructorDelegationValid( return true; } +static void emitLValueForAnyFieldInitialization(CIRGenFunction &cgf, +CXXCtorInitializer *memberInit, +

[clang] [CIR] Add support for member initialization from constructors (PR #144583)

2025-06-18 Thread Bruno Cardoso Lopes via cfe-commits
@@ -84,6 +200,34 @@ Address CIRGenFunction::loadCXXThisAddress() { return Address(loadCXXThis(), cxxThisAlignment); } +void CIRGenFunction::emitInitializerForField(FieldDecl *field, LValue lhs, + Expr *init) { + QualType fieldType

[clang] [CIR] Add support for member initialization from constructors (PR #144583)

2025-06-18 Thread Bruno Cardoso Lopes via cfe-commits
@@ -53,19 +53,135 @@ bool CIRGenFunction::isConstructorDelegationValid( return true; } +static void emitLValueForAnyFieldInitialization(CIRGenFunction &cgf, +CXXCtorInitializer *memberInit, +

[clang] [CIR] Add support for member initialization from constructors (PR #144583)

2025-06-18 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes edited https://github.com/llvm/llvm-project/pull/144583 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Implement folder for VecSplatOp (PR #143771)

2025-06-18 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes approved this pull request. https://github.com/llvm/llvm-project/pull/143771 ___ 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 bitfields in structs (PR #142041)

2025-06-18 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes approved this pull request. LGTM once all existing comments are addressed. https://github.com/llvm/llvm-project/pull/142041 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/

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

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

[clang] [CIR] Handle global string literals as char array initializer (PR #144384)

2025-06-17 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes approved this pull request. https://github.com/llvm/llvm-project/pull/144384 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-06-17 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes approved this pull request. Nice, LGTM https://github.com/llvm/llvm-project/pull/144376 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream ComplexRealPtrOp for ComplexType (PR #144235)

2025-06-17 Thread Bruno Cardoso Lopes via cfe-commits
bcardosolopes wrote: > I have concerns about the CIR representation here. I think we should be > aligning our representation of complex operations with the MLIR complex > dialect ... We'll still need to go to the memory representation when it gets > lowered to LLVM IR, but I would like to keep

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

2025-06-17 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes approved this pull request. I don't have anything else to add besides current reviews, LGTM once it's updated to incorporate the other landed change. https://github.com/llvm/llvm-project/pull/144225 ___ cfe-commits mai

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

2025-06-17 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes approved this pull request. https://github.com/llvm/llvm-project/pull/144201 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

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

[clang] [CIR][NFC] Refactor constant pointer l-value handling (PR #144165)

2025-06-16 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/144165 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream support for IncompleteArrayType (PR #144138)

2025-06-16 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/144138 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Add Support For Library Builtins (PR #143984)

2025-06-16 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes approved this pull request. LGTM, one nit https://github.com/llvm/llvm-project/pull/143984 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Add Support For Library Builtins (PR #143984)

2025-06-16 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes edited https://github.com/llvm/llvm-project/pull/143984 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Add Support For Library Builtins (PR #143984)

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

[clang] [CIR] Implement folder for VecSplatOp (PR #143771)

2025-06-16 Thread Bruno Cardoso Lopes via cfe-commits
@@ -142,7 +142,8 @@ void CIRCanonicalizePass::runOnOperation() { // Many operations are here to perform a manual `fold` in // applyOpPatternsGreedily. if (isa(op)) +VecExtractOp, VecShuffleOp, VecShuffleDynamicOp, VecSplatOp, +VecTernaryOp>(o

[clang] [CIR] Add initial support for bitfields in structs (PR #142041)

2025-06-16 Thread Bruno Cardoso Lopes via cfe-commits
bcardosolopes wrote: > To be clear, this is a matter of idealism. There's no doubt that I can write > code to handle both types, and all the information I want is available. A > program processing CIR probably won't have a problem with this. It's more of > an issue for a person reading the CIR

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

2025-06-09 Thread Bruno Cardoso Lopes via cfe-commits
@@ -274,6 +274,12 @@ class AggValueSlot { public: enum IsZeroed_t { IsNotZeroed, IsZeroed }; + /// ignored - Returns an aggregate value slot indicating that the aggregate bcardosolopes wrote: "ignored - " not necessary https://github.com/llvm/llvm-project

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

2025-06-09 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes approved this pull request. LGTM, some nits https://github.com/llvm/llvm-project/pull/143377 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

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

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

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

[clang] [CIR] Implement folder for VecCreateOp (PR #143355)

2025-06-09 Thread Bruno Cardoso Lopes via cfe-commits
@@ -1533,6 +1533,17 @@ LogicalResult cir::GetMemberOp::verify() { // VecCreateOp //===--===// +OpFoldResult cir::VecCreateOp::fold(FoldAdaptor adaptor) { + auto elements = getElements(); + if (std::any_of(e

[clang] [CIR] Upstream CreateOp for ComplexType with folder (PR #143192)

2025-06-09 Thread Bruno Cardoso Lopes via cfe-commits
@@ -0,0 +1,81 @@ +#include "CIRGenBuilder.h" +#include "CIRGenFunction.h" + +#include "clang/AST/StmtVisitor.h" + +using namespace clang; +using namespace clang::CIRGen; + +namespace { +class ComplexExprEmitter : public StmtVisitor { + CIRGenFunction &cgf; + CIRGenBuilderTy &bu

[clang] [CIR] Implement folder for VecCreateOp (PR #143355)

2025-06-09 Thread Bruno Cardoso Lopes via cfe-commits
@@ -77,12 +77,8 @@ void foo() { // CIR: %[[VEC_F:.*]] = cir.alloca !cir.vector<4 x !s32i>, !cir.ptr>, ["f", init] // CIR: %[[VEC_G:.*]] = cir.alloca !cir.vector<4 x !s32i>, !cir.ptr>, ["g", init] // CIR: %[[VEC_H:.*]] = cir.alloca !cir.vector<4 x !s32i>, !cir.ptr>, ["h", ini

[clang] [CIR] Implement folder for VecShuffleOp (PR #143260)

2025-06-09 Thread Bruno Cardoso Lopes via cfe-commits
@@ -1580,9 +1580,46 @@ OpFoldResult cir::VecExtractOp::fold(FoldAdaptor adaptor) { } //===--===// -// VecShuffle +// VecShuffleOp //===--

[clang] [CIR] Extend VecShuffleOp verifier to catch invalid index (PR #143262)

2025-06-09 Thread Bruno Cardoso Lopes via cfe-commits
@@ -1599,6 +1599,14 @@ LogicalResult cir::VecShuffleOp::verify() { << " and " << getResult().getType() << " don't match"; } + const uint64_t maxValidIndex = + getVec1().getType().getSize() + getVec2().getType().getSize() - 1; + for (const auto

[clang] [CIR] Implement folder for VecCmpOp (PR #143322)

2025-06-09 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes approved this pull request. https://github.com/llvm/llvm-project/pull/143322 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

  1   2   3   4   5   6   7   8   9   10   >