[clang] [CIR] Simplify error emission to return failures directly (PR #141032)

2025-05-22 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko updated https://github.com/llvm/llvm-project/pull/141032 >From c3ffda832255d6b7280a7d6f61c134f0dc890f5d Mon Sep 17 00:00:00 2001 From: xlauko Date: Thu, 22 May 2025 12:24:14 +0200 Subject: [PATCH] [CIR] Simplify error emission to return failures directly Mirrors incub

[clang] [CIR] Simplify error emission to return failures directly (PR #141032)

2025-05-22 Thread Henrich Lauko via cfe-commits
@@ -13,6 +13,7 @@ #include "clang/CIR/Dialect/IR/CIRTypes.h" #include "mlir/IR/DialectImplementation.h" +#include "mlir/Support/LLVM.h" xlauko wrote: Good catch, I missed that it was added by my IDE, it is unnecessary, I will remove it. https://github.com/l

[clang] [CIR] Simplify error emission to return failures directly (PR #141032)

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

[clang] [CIR] Simplify error emission to return failures directly (PR #141032)

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

[clang] [CIR] Allow use different Int types together in Vec Shift Op (PR #141111)

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

[clang] [CIR] Allow use different Int types together in Vec Shift Op (PR #141111)

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

[clang] [CIR] Allow use different Int types together in Vec Shift Op (PR #141111)

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

[clang] [CIR] Allow use different Int types together in Vec Shift Op (PR #141111)

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

[clang] [CIR] Allow use different Int types together in Vec Shift Op (PR #141111)

2025-05-22 Thread Henrich Lauko via cfe-commits
@@ -1427,12 +1427,12 @@ OpFoldResult cir::SelectOp::fold(FoldAdaptor adaptor) { //===--===// LogicalResult cir::ShiftOp::verify() { mlir::Operation *op = getOperation(); - mlir::Type resType = getResult().g

[clang] [CIR] Allow use different Int types together in Vec Shift Op (PR #141111)

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

[clang] [CIR] Simplify error emission to return failures directly (PR #141032)

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

[clang] [CIR] Simplify error emission to return failures directly (PR #141032)

2025-05-22 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko created https://github.com/llvm/llvm-project/pull/141032 Mirrors incubator changes from https://github.com/llvm/clangir/pull/1634 >From f5755844c4937c1d691b393b4be9d70c1f2a1f88 Mon Sep 17 00:00:00 2001 From: xlauko Date: Thu, 22 May 2025 12:24:14 +0200 Subject: [PATCH

[clang] [CIR] Implement `AnyScalarType` constraint (PR #141033)

2025-05-22 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko created https://github.com/llvm/llvm-project/pull/141033 This mirrors changes from https://github.com/llvm/clangir/pull/1625 >From 5331a40eaa4083d698074d9b5c11d22f9bcf3a59 Mon Sep 17 00:00:00 2001 From: xlauko Date: Thu, 22 May 2025 10:39:55 +0200 Subject: [PATCH] [CI

[clang] [CIR] Implement `AnyScalarType` constraint (PR #141033)

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

[clang] [CIR] Implement `AnyScalarType` constraint (PR #141033)

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

[clang] [CIR] Implement `AnyScalarType` constraint (PR #141033)

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

[clang] [CIR] Simplify error emission to return failures directly (PR #141032)

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

[clang] [CIR] Upstream splat op for VectorType (PR #139827)

2025-05-20 Thread Henrich Lauko via cfe-commits
@@ -1773,6 +1774,38 @@ mlir::LogicalResult CIRToLLVMVecInsertOpLowering::matchAndRewrite( return mlir::success(); } +mlir::LogicalResult CIRToLLVMVecSplatOpLowering::matchAndRewrite( +cir::VecSplatOp op, OpAdaptor adaptor, +mlir::ConversionPatternRewriter &rewriter)

[clang] [CIR] Upstream splat op for VectorType (PR #139827)

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

[clang] [CIR] Upstream splat op for VectorType (PR #139827)

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

[clang] [CIR] Upstream comparison ops for VectorType (PR #140597)

2025-05-20 Thread Henrich Lauko via cfe-commits
@@ -1777,6 +1778,35 @@ mlir::LogicalResult CIRToLLVMVecInsertOpLowering::matchAndRewrite( return mlir::success(); } +mlir::LogicalResult CIRToLLVMVecCmpOpLowering::matchAndRewrite( +cir::VecCmpOp op, OpAdaptor adaptor, +mlir::ConversionPatternRewriter &rewriter) con

[clang] [CIR] Upstream comparison ops for VectorType (PR #140597)

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

[clang] [CIR][NFC] Fix an unused variable warning (PR #140783)

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

[clang] [CIR] Add support for recursive record layouts (PR #140811)

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

[clang] [CIR] Add support for recursive record layouts (PR #140811)

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

[clang] [CIR] Upstream support for string literals (PR #140796)

2025-05-21 Thread Henrich Lauko via cfe-commits
@@ -136,6 +139,14 @@ class CIRGenModule : public CIRGenTypeCache { getAddrOfGlobalVar(const VarDecl *d, mlir::Type ty = {}, ForDefinition_t isForDefinition = NotForDefinition); + /// Return a constant array for the given string. + mlir::Attribute getCo

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

2025-05-25 Thread Henrich Lauko via cfe-commits
@@ -577,12 +577,31 @@ mlir::Attribute ConstantEmitter::tryEmitPrivate(const APValue &value, case APValue::Union: cgm.errorNYI("ConstExprEmitter::tryEmitPrivate struct or union"); return {}; - case APValue::FixedPoint: case APValue::ComplexInt: - case APValue::Co

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

2025-05-27 Thread Henrich Lauko via cfe-commits
@@ -385,6 +385,13 @@ mlir::Type CIRGenTypes::convertType(QualType type) { break; } + case Type::Complex: { +const ComplexType *ct = cast(ty); +mlir::Type elementTy = convertType(ct->getElementType()); xlauko wrote: Oh sorry thought this was `ci

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

2025-05-25 Thread Henrich Lauko via cfe-commits
@@ -231,7 +231,8 @@ static LogicalResult checkConstantTypes(mlir::Operation *op, mlir::Type opType, } if (isa(attrType)) { -if (isa(opType)) +if (isa( +opType)) return success(); return op->emitOpError("zero expects struct or array type");

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

2025-05-25 Thread Henrich Lauko via cfe-commits
@@ -385,6 +385,13 @@ mlir::Type CIRGenTypes::convertType(QualType type) { break; } + case Type::Complex: { +const ComplexType *ct = cast(ty); +mlir::Type elementTy = convertType(ct->getElementType()); xlauko wrote: ```suggestion const auto

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

2025-05-25 Thread Henrich Lauko via cfe-commits
@@ -226,6 +227,42 @@ mlir::Value CIRAttrToValue::visitCirAttr(cir::IntAttr intAttr) { loc, converter->convertType(intAttr.getType()), intAttr.getValue()); } +/// FPAttr visitor. +mlir::Value CIRAttrToValue::visitCirAttr(cir::FPAttr fltAttr) { + mlir::Location loc = par

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

2025-05-25 Thread Henrich Lauko via cfe-commits
@@ -276,4 +276,38 @@ def ConstPtrAttr : CIR_Attr<"ConstPtr", "ptr", [TypedAttrInterface]> { }]; } +//===--===// +// ConstComplexAttr +//===---

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

2025-05-25 Thread Henrich Lauko via cfe-commits
@@ -577,12 +577,31 @@ mlir::Attribute ConstantEmitter::tryEmitPrivate(const APValue &value, case APValue::Union: cgm.errorNYI("ConstExprEmitter::tryEmitPrivate struct or union"); return {}; - case APValue::FixedPoint: case APValue::ComplexInt: - case APValue::Co

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

2025-05-25 Thread Henrich Lauko via cfe-commits
@@ -577,12 +577,31 @@ mlir::Attribute ConstantEmitter::tryEmitPrivate(const APValue &value, case APValue::Union: cgm.errorNYI("ConstExprEmitter::tryEmitPrivate struct or union"); return {}; - case APValue::FixedPoint: case APValue::ComplexInt: - case APValue::Co

<    1   2   3