[clang] [CIR] Update tests for global vars (PR #141854)

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

[clang] [CIR] Streamline creation of mlir::IntegerAttrs using mlir::Builder (PR #141830)

2025-05-28 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes approved this pull request. LGTM pending comments from other reviewers https://github.com/llvm/llvm-project/pull/141830 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/list

[clang] [CIR] Upstream global initialization for ComplexType (PR #141369)

2025-05-28 Thread Bruno Cardoso Lopes via cfe-commits
@@ -0,0 +1,11 @@ +// RUN: cir-opt %s -verify-diagnostics -split-input-file + +!s32i = !cir.int bcardosolopes wrote: Seems like you forgot to remove this file https://github.com/llvm/llvm-project/pull/141369 ___ cfe-com

[clang] [CIR] Upstream global initialization for ComplexType (PR #141369)

2025-05-28 Thread Bruno Cardoso Lopes via cfe-commits
@@ -276,4 +276,46 @@ def ConstPtrAttr : CIR_Attr<"ConstPtr", "ptr", [TypedAttrInterface]> { }]; } +//===--===// +// ConstComplexAttr +//===---

[clang] [CIR][NFC] Use actual operand name in adaptor-obtained operands (PR #143028)

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

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

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

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

2025-06-09 Thread Bruno Cardoso Lopes via cfe-commits
@@ -1641,6 +1641,34 @@ LogicalResult cir::VecTernaryOp::verify() { return success(); } +//===--===// +// ComplexCreateOp +//===--===// + +L

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

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/143192 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Add support for accessing members of base classes (PR #143195)

2025-06-09 Thread Bruno Cardoso Lopes via cfe-commits
@@ -2231,4 +2231,48 @@ def VecTernaryOp : CIR_Op<"vec.ternary", let hasVerifier = 1; } +//===--===// +// BaseClassAddrOp +//===--===// + +d

[clang] [CIR] Add support for using enum constants (PR #143214)

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

[clang] [CIR] Add support for accessing members of base classes (PR #143195)

2025-06-09 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes approved this pull request. LGTM, with a non-blocking suggestion https://github.com/llvm/llvm-project/pull/143195 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/c

[clang] [Clang][NFC] Adopt simpified `getTrailingObjects` in CIRGenFunctionInfo (PR #143253)

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/143253 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][NFC] Adopt simpified `getTrailingObjects` in CIRGenFunctionInfo (PR #143253)

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

[clang] [CIR] Add support for accessing members of base classes (PR #143195)

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

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

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

[clang] [Clang][NFC] Adopt simpified `getTrailingObjects` in CIRGenFunctionInfo (PR #143253)

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

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

2025-06-09 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes approved this pull request. Thanks for this folder, one nit and good to go https://github.com/llvm/llvm-project/pull/143260 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/

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

2025-06-09 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/143262 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR][NFS] Add test cases for VecShuffle with -1 index (PR #143304)

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/143304 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

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

[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

[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 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] 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] 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
@@ -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] 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] 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] [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] [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
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
@@ -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] [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-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 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 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
@@ -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
@@ -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 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 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
@@ -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 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] 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] [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
@@ -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
@@ -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][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] 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] 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-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] [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] 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] 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] 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] 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] 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] [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 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
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
@@ -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] 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] 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] 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
@@ -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] 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, +

<    5   6   7   8   9   10