[clang] [CIR] Complex Unary plus and minus with promoted type (PR #155486)

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

[clang] [CIR][NFC] Add errors for unhandled AggExprEmitter visitors (PR #155469)

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

[clang] [CIR] Fix element type and alignment handling in emitDestroy for arrays (PR #155333)

2025-08-27 Thread Bruno Cardoso Lopes via cfe-commits
bcardosolopes wrote: Thanks for the PR. I expect a change to existing tests or a new test that exercises what's missing! https://github.com/llvm/llvm-project/pull/155333 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cg

[clang] [CIR] Add CIR vtable attribute (PR #154415)

2025-08-20 Thread Bruno Cardoso Lopes via cfe-commits
@@ -496,6 +496,72 @@ def CIR_GlobalViewAttr : CIR_Attr<"GlobalView", "global_view", [ }]; } +//===--===// +// VTableAttr +//===--===// + +

[clang] [CIR] Upstream GotoSolver pass (PR #154596)

2025-08-20 Thread Bruno Cardoso Lopes via cfe-commits
@@ -0,0 +1,52 @@ +#include "PassDetail.h" bcardosolopes wrote: You need LLVM header here! https://github.com/llvm/llvm-project/pull/154596 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/

[clang] [CIR] Add CIR vtable attribute (PR #154415)

2025-08-20 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes approved this pull request. LGTM, minor suggestion https://github.com/llvm/llvm-project/pull/154415 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Add CIR vtable attribute (PR #154415)

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

[clang] [CIR] Upstream GotoSolver pass (PR #154596)

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

[clang] [CIR] Upstream GotoSolver pass (PR #154596)

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

[clang] [CIR] Upstream GotoSolver pass (PR #154596)

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

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

2025-08-20 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes approved this pull request. LGTM! Any chance you could backport this to incubator? https://github.com/llvm/llvm-project/pull/154540 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/

[clang] [CIR] Run LoweringPrepare pass only for non CIR output (PR #154107)

2025-08-20 Thread Bruno Cardoso Lopes via cfe-commits
@@ -110,9 +110,10 @@ class CIRGenConsumer : public clang::ASTConsumer { if (!FEOptions.ClangIRDisablePasses) { // Setup and run CIR pipeline. + bool EnableLoweringPrepare = Action != CIRGenAction::OutputType::EmitCIR; bcardosolopes wrote: Altho

[clang] [CIR] Handle FunctionToPointerDecay casts (#153657) (PR #154060)

2025-08-19 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes approved this pull request. LGTM with the other proposed changes https://github.com/llvm/llvm-project/pull/154060 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/c

[clang] [CIR] Implement codegen for inline assembly with output operands (PR #154014)

2025-08-19 Thread Bruno Cardoso Lopes via cfe-commits
@@ -26,6 +28,98 @@ static AsmFlavor inferFlavor(const CIRGenModule &cgm, const AsmStmt &s) { return isa(&s) ? AsmFlavor::x86_intel : gnuAsmFlavor; } +// FIXME(cir): This should be a common helper between CIRGen bcardosolopes wrote: Works for me! https://g

[clang] [CIR] Implement__builtin_va_arg (PR #153834)

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

[clang] [OpenACC] Implement firstprivate lowering except init. (PR #153847)

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

[clang] [CIR] Implement__builtin_va_arg (PR #153834)

2025-08-15 Thread Bruno Cardoso Lopes via cfe-commits
bcardosolopes wrote: > Depends on #153819. For making the review process a bit more convenient I suggest you use some stacked approach, see https://llvm.org/docs/GitHub.html#stacked-pull-requests https://github.com/llvm/llvm-project/pull/153834 ___ c

[clang] [CIR] Upstream __builtin_va_start and __builtin_va_end (PR #153819)

2025-08-15 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes approved this pull request. LGTM, nothing to add on top of Andy's comments https://github.com/llvm/llvm-project/pull/153819 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/

[clang] [CIR] Upstream __builtin_va_start and __builtin_va_end (PR #153819)

2025-08-15 Thread Bruno Cardoso Lopes via cfe-commits
@@ -3415,4 +3415,81 @@ def CIR_FAbsOp : CIR_UnaryFPToFPBuiltinOp<"fabs", "FAbsOp"> { }]; } +//===--===// +// Variadic Operations +//===--=

[clang] [CIR] Upstream __builtin_va_start and __builtin_va_end (PR #153819)

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

[clang] [CIR] Upstream __builtin_va_start and __builtin_va_end (PR #153819)

2025-08-15 Thread Bruno Cardoso Lopes via cfe-commits
@@ -3415,4 +3415,81 @@ def CIR_FAbsOp : CIR_UnaryFPToFPBuiltinOp<"fabs", "FAbsOp"> { }]; } +//===--===// +// Variadic Operations +//===--=

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

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

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

2025-08-15 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes approved this pull request. LGTM pending a nit/question https://github.com/llvm/llvm-project/pull/153814 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commit

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

2025-08-15 Thread Bruno Cardoso Lopes via cfe-commits
@@ -187,12 +244,85 @@ void AtomicInfo::emitCopyIntoMemory(RValue rvalue) const { } } +static void emitAtomicOp(CIRGenFunction &cgf, AtomicExpr *expr, Address dest, + Address ptr, Address val1, uint64_t size, + cir::MemOrder ord

[clang] [CIR] Upstream GotoOp (PR #153701)

2025-08-15 Thread Bruno Cardoso Lopes via cfe-commits
@@ -1649,7 +1651,26 @@ void cir::FuncOp::print(OpAsmPrinter &p) { // TODO(CIR): The properties of functions that require verification haven't // been implemented yet. -mlir::LogicalResult cir::FuncOp::verify() { return success(); } +mlir::LogicalResult cir::FuncOp::verify() {

[clang] [CIR] Upstream GotoOp (PR #153701)

2025-08-15 Thread Bruno Cardoso Lopes via cfe-commits
@@ -1649,7 +1651,26 @@ void cir::FuncOp::print(OpAsmPrinter &p) { // TODO(CIR): The properties of functions that require verification haven't // been implemented yet. -mlir::LogicalResult cir::FuncOp::verify() { return success(); } +mlir::LogicalResult cir::FuncOp::verify() {

[clang] [CIR] Upstream GotoOp (PR #153701)

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

[clang] [CIR] Upstream GotoOp (PR #153701)

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

[clang] [CIR] Implement Statement Expressions (PR #153677)

2025-08-15 Thread Bruno Cardoso Lopes via cfe-commits
@@ -561,7 +558,6 @@ cir::FuncOp CIRGenFunction::generateCode(clang::GlobalDecl gd, cir::FuncOp fn, emitImplicitAssignmentOperatorBody(args); } else if (body) { if (mlir::failed(emitFunctionBody(body))) { -fn.erase(); bcardosolopes wrote

[clang] [CIR] Implement __builtin_return_address and __builtin_frame_address (PR #153698)

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

[clang] [CIR] Implement __builtin_return_address and __builtin_frame_address (PR #153698)

2025-08-15 Thread Bruno Cardoso Lopes via cfe-commits
@@ -1097,6 +1117,24 @@ mlir::LogicalResult CIRToLLVMCallOpLowering::matchAndRewrite( getTypeConverter(), op.getCalleeAttr()); } +mlir::LogicalResult CIRToLLVMReturnAddrOpLowering::matchAndRewrite( +cir::ReturnAddrOp op, OpAdaptor adaptor, +

[clang] [CIR] Implement __builtin_return_address and __builtin_frame_address (PR #153698)

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

[clang] [CIR] Implement Statement Expressions (PR #153677)

2025-08-15 Thread Bruno Cardoso Lopes via cfe-commits
@@ -23,16 +25,57 @@ using namespace clang; using namespace clang::CIRGen; using namespace cir; -void CIRGenFunction::emitCompoundStmtWithoutScope(const CompoundStmt &s) { - for (auto *curStmt : s.body()) { -if (emitStmt(curStmt, /*useCurrentScope=*/false).failed()) -

[clang] [CIR] Implement Statement Expressions (PR #153677)

2025-08-15 Thread Bruno Cardoso Lopes via cfe-commits
@@ -561,7 +558,6 @@ cir::FuncOp CIRGenFunction::generateCode(clang::GlobalDecl gd, cir::FuncOp fn, emitImplicitAssignmentOperatorBody(args); } else if (body) { if (mlir::failed(emitFunctionBody(body))) { -fn.erase(); bcardosolopes wrote

[clang] [CIR] Add cir.vtable.get_vptr operation (PR #153630)

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

[clang] [CIR] Implement codegen for inline assembly without input and output operands (PR #153546)

2025-08-15 Thread Bruno Cardoso Lopes via cfe-commits
@@ -0,0 +1,136 @@ +//===--- CIRGenAsm.cpp - Inline Assembly Support for CIR CodeGen -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apac

[clang] [CIR] Implement codegen for inline assembly without input and output operands (PR #153546)

2025-08-15 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes approved this pull request. LGTM modulo minor nits https://github.com/llvm/llvm-project/pull/153546 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Implement codegen for inline assembly without input and output operands (PR #153546)

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

[clang] [CIR] Use a loop for array initialization (PR #153499)

2025-08-13 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes approved this pull request. LGTM! @tommymcm note that after this land you can also put a PR up for your array initialization improvements upstream. https://github.com/llvm/llvm-project/pull/153499 ___ cfe-commits mai

[clang] [CIR] Add `InlineAsmOp` (PR #153362)

2025-08-13 Thread Bruno Cardoso Lopes via cfe-commits
@@ -2406,6 +2406,208 @@ OpFoldResult RotateOp::fold(FoldAdaptor adaptor) { return IntAttr::get(input.getContext(), input.getType(), resultValue); } +//===--===// +// InlineAsmOp +//===---

[clang] [CIR] Add index support for global_view (PR #153254)

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

[clang] [CIR] Add index support for global_view (PR #153254)

2025-08-13 Thread Bruno Cardoso Lopes via cfe-commits
@@ -66,6 +66,62 @@ clang::CIRGen::CIRGenBuilderTy::getConstFP(mlir::Location loc, mlir::Type t, return create(loc, cir::FPAttr::get(t, fpVal)); } +void CIRGenBuilderTy::computeGlobalViewIndicesFromFlatOffset( +int64_t offset, mlir::Type ty, cir::CIRDataLayout layout, +

[clang] [CIR] Add index support for global_view (PR #153254)

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

[clang] [CIR] Add lowering for the cir.vtable.address_point operation (PR #153243)

2025-08-13 Thread Bruno Cardoso Lopes via cfe-commits
@@ -2391,6 +2396,45 @@ mlir::LogicalResult CIRToLLVMTrapOpLowering::matchAndRewrite( return mlir::success(); } +static mlir::Value +getValueForVTableSymbol(mlir::Operation *op, +mlir::ConversionPatternRewriter &rewriter, +cons

[clang] [CIR] Add lowering for the cir.vtable.address_point operation (PR #153243)

2025-08-13 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes approved this pull request. LGTM, minor suggestion that can be addressed (or not) as follow up. https://github.com/llvm/llvm-project/pull/153243 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm

[clang] [CIR] Add lowering for the cir.vtable.address_point operation (PR #153243)

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

[clang] [CIR][Dialect] Add SourceLangAttr (PR #152511)

2025-08-07 Thread Bruno Cardoso Lopes via cfe-commits
@@ -50,6 +50,43 @@ class CIR_UnitAttr traits = []> let isOptional = 1; } +//===--===// +// SourceLanguageAttr +//===--===// + +def CIR_Sour

[clang] [CIR][Dialect] Add SourceLangAttr (PR #152511)

2025-08-07 Thread Bruno Cardoso Lopes via cfe-commits
@@ -495,6 +498,27 @@ void CIRGenModule::setNonAliasAttributes(GlobalDecl gd, mlir::Operation *op) { assert(!cir::MissingFeatures::setTargetAttributes()); } +cir::SourceLanguage CIRGenModule::getCIRSourceLanguage() const { + using ClangStd = clang::LangStandard; + using CI

[clang] [CIR][Dialect] Add SourceLangAttr (PR #152511)

2025-08-07 Thread Bruno Cardoso Lopes via cfe-commits
@@ -50,6 +50,43 @@ class CIR_UnitAttr traits = []> let isOptional = 1; } +//===--===// +// SourceLanguageAttr +//===--===// + +def CIR_Sour

[clang] [CIR][Dialect] Add SourceLangAttr (PR #152511)

2025-08-07 Thread Bruno Cardoso Lopes via cfe-commits
@@ -495,6 +498,27 @@ void CIRGenModule::setNonAliasAttributes(GlobalDecl gd, mlir::Operation *op) { assert(!cir::MissingFeatures::setTargetAttributes()); } +cir::SourceLanguage CIRGenModule::getCIRSourceLanguage() const { + using ClangStd = clang::LangStandard; + using CI

[clang] [CIR] Mul CompoundAssignment support for ComplexType (PR #152354)

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

[clang] [CIR] Upstream EHScopeStack memory allocator (PR #152215)

2025-08-07 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes approved this pull request. LGTM, nothing to add on top of existing comments https://github.com/llvm/llvm-project/pull/152215 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailma

[clang] [CIR] Add support for __builtin_assume_aligned (PR #152152)

2025-08-07 Thread Bruno Cardoso Lopes via cfe-commits
@@ -3143,6 +3143,45 @@ def CIR_AssumeOp : CIR_Op<"assume"> { }]; } +def CIR_AssumeAlignedOp : CIR_Op<"assume_aligned", [ + Pure, AllTypesMatch<["pointer", "result"]> +]> { + let summary = "Tell the optimizer that a pointer is aligned"; + let description = [{ +The `cir

[clang] [CIR] Add support for __builtin_assume_aligned (PR #152152)

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

[clang] [CIR] Add support for __builtin_assume_aligned (PR #152152)

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

[clang] [CIR] add support for file scope assembly (PR #152093)

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

[clang] [CIR] add support for file scope assembly (PR #152093)

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

[clang] [CIR] Upstream builtin lowering emitter & FAbs op (PR #151750)

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

[clang] [CIR] Upstream builtin lowering emitter & FAbs op (PR #151750)

2025-08-07 Thread Bruno Cardoso Lopes via cfe-commits
@@ -0,0 +1,108 @@ +//===- CIRLoweringEmitter.cpp - Generate lowering of builtins --=-*- C++ -*--=// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [CIR] Upstream builtin lowering emitter & FAbs op (PR #151750)

2025-08-07 Thread Bruno Cardoso Lopes via cfe-commits
@@ -0,0 +1,108 @@ +//===- CIRLoweringEmitter.cpp - Generate lowering of builtins --=-*- C++ -*--=// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [CIR] Upstream builtin lowering emitter & FAbs op (PR #151750)

2025-08-07 Thread Bruno Cardoso Lopes via cfe-commits
@@ -0,0 +1,108 @@ +//===- CIRLoweringEmitter.cpp - Generate lowering of builtins --=-*- C++ -*--=// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [CIR] Upstream builtin lowering emitter & FAbs op (PR #151750)

2025-08-07 Thread Bruno Cardoso Lopes via cfe-commits
@@ -410,3 +410,7 @@ def calculate_arch_features(arch_string): # possibly be present in system and user configuration files, so disable # default configs for the test runs. config.environment["CLANG_NO_DEFAULT_CONFIG"] = "1" + +# Check if clangir is enabled. +if config.clang_ena

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

2025-08-07 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes approved this pull request. LGTM 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] [flang] [mlir] [mlir] Reland `Move InitAll*** implementation into static library` (PR #151150)

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

[clang] [CIR] Support more declarations without any codegen (PR #151076)

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

[clang] [CIR] Upstream support for function-level variable decompositions (PR #151073)

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

[clang] [CIR] Upstream support for function-level variable decompositions (PR #151073)

2025-07-29 Thread Bruno Cardoso Lopes via cfe-commits
@@ -0,0 +1,55 @@ +// RUN: %clang_cc1 -std=c++17 -triple x86_64-pc-linux-gnu -fclangir -emit-cir %s -o %t.cir +// RUN: FileCheck --check-prefix=CIR --input-file=%t.cir %s +// RUN: %clang_cc1 -std=c++17 -triple x86_64-pc-linux-gnu -fclangir -emit-llvm %s -o %t-cir.ll +// RUN: File

[clang] [CIR] Upstream support for variable template specializations (PR #151069)

2025-07-29 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes approved this pull request. Awesome! (Same nit from test spacing) https://github.com/llvm/llvm-project/pull/151069 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/

[clang] [CIR] Add support for C++ conversion operators (PR #151066)

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

[clang] [CIR] Add support for C++ conversion operators (PR #151066)

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

[clang] [CIR] Add support for C++ conversion operators (PR #151066)

2025-07-29 Thread Bruno Cardoso Lopes via cfe-commits
@@ -0,0 +1,130 @@ +// RUN: %clang_cc1 -std=c++11 -triple aarch64-none-linux-android21 -fclangir -emit-cir %s -o %t.cir +// RUN: FileCheck --check-prefix=CIR --input-file=%t.cir %s +// RUN: %clang_cc1 -std=c++11 -triple aarch64-none-linux-android21 -fclangir -emit-llvm %s -o %t-c

[clang] [CIR] Add bit ffs operation (PR #150997)

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

[clang] [CIR] Upstream MulOp for ComplexType (PR #150834)

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

[clang] [CIR] Upstream MulOp for ComplexType (PR #150834)

2025-07-28 Thread Bruno Cardoso Lopes via cfe-commits
bcardosolopes wrote: > Regarding the option for running the LoweringPrepare pass only if the target > file is not CIR, I will need modifications on Complex unary, cast and > ArrayCtor. Seems like a natural incremental change to me. https://github.com/llvm/llvm-project/pull/150834

[clang] [CIR] Plus & Minus CompoundAssignment support for ComplexType (PR #150759)

2025-07-28 Thread Bruno Cardoso Lopes via cfe-commits
https://github.com/bcardosolopes approved this pull request. https://github.com/llvm/llvm-project/pull/150759 ___ 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 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

  1   2   3   4   5   6   7   8   9   10   >