@@ -36,6 +36,18 @@ class ScalarExprEmitter : public
StmtVisitor {
bool ira = false)
: cgf(cgf), builder(builder), ignoreResultAssign(ira) {}
+
//======//
+ //
https://github.com/mmha updated https://github.com/llvm/llvm-project/pull/130690
>From a945e21869e5276c66ac979acd893d9bd9afe2cc Mon Sep 17 00:00:00 2001
From: Morris Hafner
Date: Mon, 10 Mar 2025 16:18:34 -0700
Subject: [PATCH 1/5] [CIR] Upstream CastOp and scalar conversions
This patch upstrea
https://github.com/mmha updated https://github.com/llvm/llvm-project/pull/132420
>From 594005c964b5c1e6605dc8ac170f1b43aa018bea Mon Sep 17 00:00:00 2001
From: Morris Hafner
Date: Fri, 21 Mar 2025 17:55:00 +0100
Subject: [PATCH 1/5] [CIR] Add binary operators
This patch adds upstreams support fo
https://github.com/mmha updated https://github.com/llvm/llvm-project/pull/132420
>From 594005c964b5c1e6605dc8ac170f1b43aa018bea Mon Sep 17 00:00:00 2001
From: Morris Hafner
Date: Fri, 21 Mar 2025 17:55:00 +0100
Subject: [PATCH 1/6] [CIR] Add binary operators
This patch adds upstreams support fo
https://github.com/mmha approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/132468
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -44,3 +44,100 @@ void l0() {
// OGCG: br label %[[FOR_COND:.*]]
// OGCG: [[FOR_COND]]:
// OGCG: br label %[[FOR_COND]]
+
+void l1() {
+ for (int i = 0; ; ) {
+ }
+}
+
+// CIR: cir.func @l1
+// CIR-NEXT: cir.scope {
+// CIR-NEXT: %[[I:.*]] = cir.alloca !s32i,
@@ -293,7 +294,8 @@ void CIRGenFunction::startFunction(GlobalDecl gd, QualType
returnType,
mlir::Value addrVal =
emitAlloca(cast(paramVar)->getName(),
- convertType(paramVar->getType()), paramLoc, alignment);
+ convertType(param
@@ -0,0 +1,81 @@
+//===--===//
+//
+// 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
https://github.com/mmha edited https://github.com/llvm/llvm-project/pull/132468
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/mmha updated https://github.com/llvm/llvm-project/pull/132420
>From 594005c964b5c1e6605dc8ac170f1b43aa018bea Mon Sep 17 00:00:00 2001
From: Morris Hafner
Date: Fri, 21 Mar 2025 17:55:00 +0100
Subject: [PATCH 1/2] [CIR] Add binary operators
This patch adds upstreams support fo
https://github.com/mmha updated https://github.com/llvm/llvm-project/pull/132420
>From 594005c964b5c1e6605dc8ac170f1b43aa018bea Mon Sep 17 00:00:00 2001
From: Morris Hafner
Date: Fri, 21 Mar 2025 17:55:00 +0100
Subject: [PATCH 1/3] [CIR] Add binary operators
This patch adds upstreams support fo
https://github.com/mmha updated https://github.com/llvm/llvm-project/pull/132420
>From 594005c964b5c1e6605dc8ac170f1b43aa018bea Mon Sep 17 00:00:00 2001
From: Morris Hafner
Date: Fri, 21 Mar 2025 17:55:00 +0100
Subject: [PATCH 1/4] [CIR] Add binary operators
This patch adds upstreams support fo
@@ -0,0 +1,81 @@
+//===--===//
+//
+// 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
https://github.com/mmha created https://github.com/llvm/llvm-project/pull/133405
Since SelectOp will only generated by a future pass that transforms a TernaryOp
this only includes the lowering bits.
This patch also improves the testing of the existing binary operators.
>From fc549133df0092c9c2
mmha wrote:
cc @andykaylor @erichkeane @dkolsen-pgi
https://github.com/llvm/llvm-project/pull/133405
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -143,6 +147,114 @@ class CIRBaseBuilderTy : public mlir::OpBuilder {
return createCast(loc, cir::CastKind::bitcast, src, newTy);
}
+ mlir::Value createBinop(mlir::Value lhs, cir::BinOpKind kind,
+ const llvm::APInt &rhs) {
+return create(
https://github.com/mmha edited https://github.com/llvm/llvm-project/pull/132420
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/mmha closed https://github.com/llvm/llvm-project/pull/138317
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
mmha wrote:
@bcardosolopes Adding a test for C++ -> CIR depends on #138003 which adds
lowering for `?:`, `&&` and `||`. Since this one's ready to be merged apart
from your remark IMO I'd add that test in #138003
https://github.com/llvm/llvm-project/pull/138317
_
@@ -1658,6 +1828,170 @@ mlir::Value
ScalarExprEmitter::VisitUnaryExprOrTypeTraitExpr(
cgf.cgm.UInt64Ty, e->EvaluateKnownConstInt(cgf.getContext(;
}
+/// Return true if the specified expression is cheap enough and
side-effect-free
+/// enough to evaluate un
@@ -948,6 +950,165 @@ void CIRGenFunction::emitIgnoredExpr(const Expr *e) {
emitLValue(e);
}
+// Handle the case where the condition is a constant evaluatable simple
integer,
+// which means we don't have to separately handle the true/false blocks.
+static std::optional han
@@ -948,6 +950,165 @@ void CIRGenFunction::emitIgnoredExpr(const Expr *e) {
emitLValue(e);
}
+// Handle the case where the condition is a constant evaluatable simple
integer,
+// which means we don't have to separately handle the true/false blocks.
+static std::optional han
https://github.com/mmha edited https://github.com/llvm/llvm-project/pull/138156
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/mmha edited https://github.com/llvm/llvm-project/pull/138156
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/mmha edited https://github.com/llvm/llvm-project/pull/138156
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1658,6 +1828,170 @@ mlir::Value
ScalarExprEmitter::VisitUnaryExprOrTypeTraitExpr(
cgf.cgm.UInt64Ty, e->EvaluateKnownConstInt(cgf.getContext(;
}
+/// Return true if the specified expression is cheap enough and
side-effect-free
+/// enough to evaluate un
@@ -948,6 +950,165 @@ void CIRGenFunction::emitIgnoredExpr(const Expr *e) {
emitLValue(e);
}
+// Handle the case where the condition is a constant evaluatable simple
integer,
+// which means we don't have to separately handle the true/false blocks.
+static std::optional han
https://github.com/mmha edited https://github.com/llvm/llvm-project/pull/138156
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/mmha updated https://github.com/llvm/llvm-project/pull/138156
>From 66cea1ef63965b27617a6b6995ac1c5f8d8b8ed6 Mon Sep 17 00:00:00 2001
From: Morris Hafner
Date: Thu, 1 May 2025 17:27:23 +0200
Subject: [PATCH 1/4] [CIR] Upstream lowering of lvalue conditional operators
to Terna
@@ -948,6 +950,165 @@ void CIRGenFunction::emitIgnoredExpr(const Expr *e) {
emitLValue(e);
}
+// Handle the case where the condition is a constant evaluatable simple
integer,
+// which means we don't have to separately handle the true/false blocks.
+static std::optional han
@@ -540,3 +540,171 @@ void long_shift_example(long long a, short b) {
// OGCG: store i64 %[[SHL]], ptr %[[X]]
// OGCG: ret void
+
+void b1(bool a, bool b) {
+ bool x = a && b;
+ x = x || b;
+}
+
+// CIR-LABEL: cir.func @_Z2b1bb(
+// CIR-SAME: %[[ARG0:.*]]: !c
https://github.com/mmha closed https://github.com/llvm/llvm-project/pull/138156
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/mmha updated https://github.com/llvm/llvm-project/pull/144719
>From 278750574dd72831347bbba144bd49ded9daaa3c Mon Sep 17 00:00:00 2001
From: Morris Hafner
Date: Wed, 18 Jun 2025 15:09:21 +0100
Subject: [PATCH 1/2] [CIR] Add Minimal Destructor Definition Support
This patch upst
https://github.com/mmha created https://github.com/llvm/llvm-project/pull/144719
This patch upstreams support for writing inline and out of line C++ destructor
definitions. Calling a destructor implcitly or explicitly is left for a future
patch.
Because of that restriction complete destructors
https://github.com/mmha approved this pull request.
LGTM, just a request for three more test cases. I'm not sure if they work
upstream already. If they don't, let's just skip over them for now.
```c++
char oversized[100] = "123";
char exact[4] = "123";
decltype(auto) returns_literal() {
re
https://github.com/mmha closed https://github.com/llvm/llvm-project/pull/144519
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/mmha updated https://github.com/llvm/llvm-project/pull/142981
>From 939ad27d0d0dacc5b796e36ca9bca32d26f6b714 Mon Sep 17 00:00:00 2001
From: Morris Hafner
Date: Mon, 9 Jun 2025 14:52:55 +0200
Subject: [PATCH 1/4] [CIR] Upstream minimal builtin function call support
This patch
https://github.com/mmha created https://github.com/llvm/llvm-project/pull/142673
This is NFC and simply adds an llvm_unreachable
>From 5e67287af5e55e3792e359812e539d8375d32f10 Mon Sep 17 00:00:00 2001
From: Morris Hafner
Date: Tue, 3 Jun 2025 23:19:50 +0200
Subject: [PATCH] [CIR] Fix missing re
https://github.com/mmha approved this pull request.
LGTM (and thanks!)
https://github.com/llvm/llvm-project/pull/142591
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/mmha closed https://github.com/llvm/llvm-project/pull/142673
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/mmha created https://github.com/llvm/llvm-project/pull/142779
This changes clang::CIRGen::RValue to look like current clang::CodeGen::RValue
which was changed in
84780a/[#86923](https://github.com/llvm/llvm-project/issues/86923). This should
be NFC and is preliminary work fo
https://github.com/mmha created https://github.com/llvm/llvm-project/pull/142165
We used to insert a continue Block at the end of a flattened ternary op that
only contained a branch to the remaing operation of the remaining Block. This
patch removes that continue block and changes the true/fals
https://github.com/mmha updated https://github.com/llvm/llvm-project/pull/142165
>From f62994df24f912a3815cabb7fc4a47fa8c8c948e Mon Sep 17 00:00:00 2001
From: Morris Hafner
Date: Fri, 30 May 2025 16:29:05 +0200
Subject: [PATCH 1/2] [CIR] Skip generation of a continue block when flattening
Terna
https://github.com/mmha closed https://github.com/llvm/llvm-project/pull/142779
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/mmha created https://github.com/llvm/llvm-project/pull/143984
This patch upstreams support for builtins that map to a standard library
function. Examples would be abort() and printf().
It also fixes a minor issue with the errorNYI for all remaining unimplemented
builtins usi
https://github.com/mmha updated https://github.com/llvm/llvm-project/pull/143984
>From c60378591a7d8d156306ff9c840aa319396c4f00 Mon Sep 17 00:00:00 2001
From: Morris Hafner
Date: Fri, 13 Jun 2025 00:04:24 +0200
Subject: [PATCH 1/2] [CIR] Add Support For Library Builtins
This patch upstreams sup
https://github.com/mmha updated https://github.com/llvm/llvm-project/pull/143984
>From c60378591a7d8d156306ff9c840aa319396c4f00 Mon Sep 17 00:00:00 2001
From: Morris Hafner
Date: Fri, 13 Jun 2025 00:04:24 +0200
Subject: [PATCH 1/3] [CIR] Add Support For Library Builtins
This patch upstreams sup
@@ -76,3 +76,21 @@ float constant_fp_builtin_single() {
// OGCG: define {{.*}}float @_Z26constant_fp_builtin_singlev()
// OGCG: ret float 0x3FB9A000
// OGCG: }
+
+void library_builtins() {
+ __builtin_printf(nullptr);
mmha wrote:
I added `builtin_prin
https://github.com/mmha approved this pull request.
This fixes the build on my machine with clang 19.1. Thanks!
https://github.com/llvm/llvm-project/pull/143994
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mail
https://github.com/mmha updated https://github.com/llvm/llvm-project/pull/142981
>From 1faee59aebae98bf01ecac07a7a5d70f2f9ca2db Mon Sep 17 00:00:00 2001
From: Morris Hafner
Date: Mon, 9 Jun 2025 14:52:55 +0200
Subject: [PATCH 1/6] [CIR] Upstream minimal builtin function call support
This patch
@@ -229,6 +231,19 @@ class CIRGenBuilderTy : public cir::CIRBaseBuilderTy {
cir::IntType getUInt32Ty() { return typeCache.UInt32Ty; }
cir::IntType getUInt64Ty() { return typeCache.UInt64Ty; }
+ cir::ConstantOp getConstInt(mlir::Location loc, llvm::APSInt intVal);
+
+ cir
https://github.com/mmha closed https://github.com/llvm/llvm-project/pull/142981
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/mmha updated https://github.com/llvm/llvm-project/pull/142981
>From 1e759f0ec3b010e64c44cc4e5f87ffbe8f4e3d21 Mon Sep 17 00:00:00 2001
From: Morris Hafner
Date: Mon, 9 Jun 2025 14:52:55 +0200
Subject: [PATCH 1/5] [CIR] Upstream minimal builtin function call support
This patch
@@ -0,0 +1,453 @@
+//===--===//
+//
+// 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: Apa
https://github.com/mmha closed https://github.com/llvm/llvm-project/pull/144719
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/mmha updated https://github.com/llvm/llvm-project/pull/144719
>From 856aceca89e83604933756e30dfaa24021b604fc Mon Sep 17 00:00:00 2001
From: Morris Hafner
Date: Wed, 18 Jun 2025 15:09:21 +0100
Subject: [PATCH 1/3] [CIR] Add Minimal Destructor Definition Support
This patch upst
https://github.com/mmha updated https://github.com/llvm/llvm-project/pull/144719
>From 856aceca89e83604933756e30dfaa24021b604fc Mon Sep 17 00:00:00 2001
From: Morris Hafner
Date: Wed, 18 Jun 2025 15:09:21 +0100
Subject: [PATCH 1/3] [CIR] Add Minimal Destructor Definition Support
This patch upst
https://github.com/mmha created https://github.com/llvm/llvm-project/pull/149142
This patch upstreams support for creating arrays of classes that require
calling a constructor.
* Adds the ArrayCtor operation
* New lowering pass for lowering ArrayCtor to a loop
>From 2a78522d151c3a970fccef94724
https://github.com/mmha updated https://github.com/llvm/llvm-project/pull/149142
>From 2a78522d151c3a970fccef94724a31fe14547f9d Mon Sep 17 00:00:00 2001
From: Morris Hafner
Date: Wed, 16 Jul 2025 18:48:52 +0200
Subject: [PATCH 1/2] [CIR] Add support for array constructors
This patch upstreams s
@@ -0,0 +1,70 @@
+// RUN: %clang_cc1 -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 -triple x86_64-unknown-linux-gnu -Wno-unused-value
-fclangir -emit-llvm %s -o
https://github.com/mmha updated https://github.com/llvm/llvm-project/pull/149142
>From 2a78522d151c3a970fccef94724a31fe14547f9d Mon Sep 17 00:00:00 2001
From: Morris Hafner
Date: Wed, 16 Jul 2025 18:48:52 +0200
Subject: [PATCH 1/4] [CIR] Add support for array constructors
This patch upstreams s
@@ -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
@@ -0,0 +1,70 @@
+// RUN: %clang_cc1 -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 -triple x86_64-unknown-linux-gnu -Wno-unused-value
-fclangir -emit-llvm %s -o
101 - 163 of 163 matches
Mail list logo