@@ -55,6 +55,7 @@ class CIRGenerator : public clang::ASTConsumer {
void Initialize(clang::ASTContext &astContext) override;
bool HandleTopLevelDecl(clang::DeclGroupRef group) override;
mlir::ModuleOp getModule() const;
+ mlir::MLIRContext &getContext() { return *mlirCont
dkolsen-pgi wrote:
I like the idea of changing the assembly format for function types from
`!cir.func` to `!cir.func<(!argType) -> !returnType>`.
That is
1. Easier to parse.
2. Consistent with function types in other MLIR dialects.
3. Consistent with the assembly format for function definition
https://github.com/dkolsen-pgi created
https://github.com/llvm/llvm-project/pull/128601
Support the type `bool` and the literals `true` and `false`. Add the type
`cir::BoolType` and the attribute `cir::BoolAttr` to ClangIR. Add code in all
the necessary places in ClangIR CodeGen to handle and
@@ -331,9 +335,38 @@ FuncType FuncType::clone(TypeRange inputs, TypeRange
results) const {
return get(llvm::to_vector(inputs), results[0], isVarArg());
}
-mlir::ParseResult parseFuncTypeArgs(mlir::AsmParser &p,
-llvm::SmallVector ¶ms,
-
https://github.com/dkolsen-pgi updated
https://github.com/llvm/llvm-project/pull/127674
>From c0f10395ec6bff05bdb9eb04ed2c1f349c647d50 Mon Sep 17 00:00:00 2001
From: David Olsen
Date: Tue, 18 Feb 2025 09:41:35 -0800
Subject: [PATCH 1/2] [CIR] Upstream simple function bodies
Enable ClangIR gene
https://github.com/dkolsen-pgi closed
https://github.com/llvm/llvm-project/pull/127674
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -424,6 +424,10 @@ LogicalResult cir::FuncOp::verifyType() {
if (!isa(type))
return emitOpError("requires '" + getFunctionTypeAttrName().str() +
"' attribute of function type");
+ if (auto rt = type.getReturnTypes();
dkolsen-pgi
https://github.com/dkolsen-pgi updated
https://github.com/llvm/llvm-project/pull/128787
>From 3e396ab2f69d0dcf98605179f69411f04da68f49 Mon Sep 17 00:00:00 2001
From: David Olsen
Date: Tue, 25 Feb 2025 15:21:30 -0800
Subject: [PATCH 1/2] [CIR] Function type return type improvements
When a C or
@@ -0,0 +1,82 @@
+//===--===//
+//
+// 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
@@ -424,6 +424,10 @@ LogicalResult cir::FuncOp::verifyType() {
if (!isa(type))
return emitOpError("requires '" + getFunctionTypeAttrName().str() +
"' attribute of function type");
+ if (auto rt = type.getReturnTypes();
dkolsen-pgi
https://github.com/dkolsen-pgi created
https://github.com/llvm/llvm-project/pull/128787
When a C or C++ function has a return type of `void`, the function type is now
represented in MLIR as having no return type rather than having a return type
of `!cir.void`. This avoids breaking MLIR invari
dkolsen-pgi wrote:
This combines https://github.com/llvm/clangir/pull/1249 (fix handling of void
return) and https://github.com/llvm/clangir/pull/1391(trailing return type)
into a single upstream PR.
https://github.com/llvm/llvm-project/pull/128787
dkolsen-pgi wrote:
I am merging this now because it fixes a build breakage. If I messed up, it is
easy enough to undo.
https://github.com/llvm/llvm-project/pull/128772
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cg
https://github.com/dkolsen-pgi closed
https://github.com/llvm/llvm-project/pull/128772
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/dkolsen-pgi created
https://github.com/llvm/llvm-project/pull/128772
In #128754, `DataLayoutTypeInterface` was changed to give
`getPreferredAlignment` a default implemention. As a result, table-gen no
longer declared `getPreferredAlignment` when defining a class that contai
dkolsen-pgi wrote:
@bcardosolopes @lanza You will run into this same problem with the next
incubator rebase. The fix should be the same, though there will be more
`getPreferredAlignment` functions to delete.
https://github.com/llvm/llvm-project/pull/128772
__
https://github.com/dkolsen-pgi closed
https://github.com/llvm/llvm-project/pull/128089
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/dkolsen-pgi closed
https://github.com/llvm/llvm-project/pull/128601
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
dkolsen-pgi wrote:
Abandoning this PR. I will redo it soon with the new assembly format for
function types.
https://github.com/llvm/llvm-project/pull/128089
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailm
https://github.com/dkolsen-pgi updated
https://github.com/llvm/llvm-project/pull/128601
>From bbadebdf7444ed453721f064e4e30ac2917c5fe9 Mon Sep 17 00:00:00 2001
From: David Olsen
Date: Mon, 24 Feb 2025 15:50:19 -0800
Subject: [PATCH 1/2] [CIR] Upstream type `bool`
Support the type `bool` and th
@@ -266,6 +266,22 @@ def CIR_PointerType : CIR_Type<"Pointer", "ptr",
}];
}
+//===--===//
+// BoolType
+//===--===//
+
+def CIR_BoolType :
101 - 121 of 121 matches
Mail list logo