llvm-ci wrote:
LLVM Buildbot has detected a new failure on builder `llvm-clang-aarch64-darwin`
running on `doug-worker-4` while building `clang` at step 6
"test-build-unified-tree-check-all".
Full details are available at:
https://lab.llvm.org/buildbot/#/builders/190/builds/19343
Here is th
https://github.com/Lancern closed
https://github.com/llvm/llvm-project/pull/136810
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/andykaylor approved this pull request.
lgtm
https://github.com/llvm/llvm-project/pull/136810
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Lancern wrote:
Rebased onto the latest `main`. Will land later if no one have more comments.
https://github.com/llvm/llvm-project/pull/136810
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-co
@@ -446,8 +446,31 @@ OpFoldResult cir::CastOp::fold(FoldAdaptor adaptor) {
// CallOp
//===--===//
+mlir::Operation::operand_iterator cir::CallOp::arg_operand_begin() {
+ assert(!cir::MissingFeatures::opCallI
@@ -21,9 +21,24 @@ let cppNamespace = "::cir" in {
// The CIRCallOpInterface must be used instead of CallOpInterface when
looking
// at arguments and other bits of CallOp. This creates a level of abstraction
// that's useful for handling indirect calls and other details.
@@ -1516,6 +1520,41 @@ class CIR_CallOpBase
extra_traits = []>
!listconcat(extra_traits,
[DeclareOpInterfaceMethods,
DeclareOpInterfaceMethods])> {
+ let extraClassDeclaration = [{
+/// Get the argument operands to the c
https://github.com/Lancern updated
https://github.com/llvm/llvm-project/pull/136810
>From e5e7bd931dd409546d04237bd61eab67d6ba6451 Mon Sep 17 00:00:00 2001
From: Sirui Mu
Date: Fri, 2 May 2025 00:31:08 +0800
Subject: [PATCH] [CIR] Upstream cir.call with scalar arguments
---
.../CIR/Dialect/Bu
https://github.com/Lancern updated
https://github.com/llvm/llvm-project/pull/136810
>From e9334137d0d1b968ac4d0e59af9f1b04e6b639ac Mon Sep 17 00:00:00 2001
From: Sirui Mu
Date: Fri, 2 May 2025 00:31:08 +0800
Subject: [PATCH] [CIR] Upstream cir.call with scalar arguments
---
.../CIR/Dialect/Bu
@@ -68,20 +168,70 @@ static cir::CIRCallOpInterface
emitCallLikeOp(CIRGenFunction &cgf,
assert(builder.getInsertionBlock() && "expected valid basic block");
assert(!cir::MissingFeatures::opCallIndirect());
- return builder.createCallOp(callLoc, directFuncOp);
+ return b
@@ -68,20 +168,70 @@ static cir::CIRCallOpInterface
emitCallLikeOp(CIRGenFunction &cgf,
assert(builder.getInsertionBlock() && "expected valid basic block");
assert(!cir::MissingFeatures::opCallIndirect());
- return builder.createCallOp(callLoc, directFuncOp);
+ return b
@@ -17,3 +17,15 @@ int f4() {
// CHECK-LABEL: cir.func @f4() -> !s32i
// CHECK: %[[#x:]] = cir.call @f3() : () -> !s32i
// CHECK-NEXT:cir.store %[[#x]], %{{.+}} : !s32i, !cir.ptr
+
+int f5(int a, int *b, bool c);
+int f6() {
+ int b = 1;
+ return f5(2, &b, false);
https://github.com/Lancern updated
https://github.com/llvm/llvm-project/pull/136810
>From 6fa07927f48cc820fe7babe6d85a32e8e6cc781b Mon Sep 17 00:00:00 2001
From: Sirui Mu
Date: Wed, 23 Apr 2025 12:14:40 +0800
Subject: [PATCH] [CIR] Upstream cir.call with scalar arguments
---
.../CIR/Dialect/B
@@ -17,3 +17,15 @@ int f4() {
// CHECK-LABEL: cir.func @f4() -> !s32i
// CHECK: %[[#x:]] = cir.call @f3() : () -> !s32i
// CHECK-NEXT:cir.store %[[#x]], %{{.+}} : !s32i, !cir.ptr
+
+int f5(int a, int *b, bool c);
+int f6() {
+ int b = 1;
+ return f5(2, &b, false);
@@ -32,7 +32,13 @@ void X8664ABIInfo::computeInfo(CIRGenFunctionInfo &funcInfo)
const {
// Top level CIR has unlimited arguments and return types. Lowering for ABI
// specific concerns should happen during a lowering phase. Assume everything
// is direct for now.
- asse
@@ -68,20 +168,70 @@ static cir::CIRCallOpInterface
emitCallLikeOp(CIRGenFunction &cgf,
assert(builder.getInsertionBlock() && "expected valid basic block");
assert(!cir::MissingFeatures::opCallIndirect());
- return builder.createCallOp(callLoc, directFuncOp);
+ return b
@@ -18,22 +18,118 @@
using namespace clang;
using namespace clang::CIRGen;
-CIRGenFunctionInfo *CIRGenFunctionInfo::create(CanQualType resultType) {
- void *buffer = operator new(totalSizeToAlloc(1));
+CIRGenFunctionInfo *
+CIRGenFunctionInfo::create(CanQualType resultType,
+
@@ -18,22 +18,118 @@
using namespace clang;
using namespace clang::CIRGen;
-CIRGenFunctionInfo *CIRGenFunctionInfo::create(CanQualType resultType) {
- void *buffer = operator new(totalSizeToAlloc(1));
+CIRGenFunctionInfo *
+CIRGenFunctionInfo::create(CanQualType resultType,
+
@@ -18,22 +18,118 @@
using namespace clang;
using namespace clang::CIRGen;
-CIRGenFunctionInfo *CIRGenFunctionInfo::create(CanQualType resultType) {
- void *buffer = operator new(totalSizeToAlloc(1));
+CIRGenFunctionInfo *
+CIRGenFunctionInfo::create(CanQualType resultType,
+
@@ -18,22 +18,118 @@
using namespace clang;
using namespace clang::CIRGen;
-CIRGenFunctionInfo *CIRGenFunctionInfo::create(CanQualType resultType) {
- void *buffer = operator new(totalSizeToAlloc(1));
+CIRGenFunctionInfo *
+CIRGenFunctionInfo::create(CanQualType resultType,
+
@@ -18,22 +18,118 @@
using namespace clang;
using namespace clang::CIRGen;
-CIRGenFunctionInfo *CIRGenFunctionInfo::create(CanQualType resultType) {
- void *buffer = operator new(totalSizeToAlloc(1));
+CIRGenFunctionInfo *
+CIRGenFunctionInfo::create(CanQualType resultType,
+
@@ -1516,6 +1520,41 @@ class CIR_CallOpBase
extra_traits = []>
!listconcat(extra_traits,
[DeclareOpInterfaceMethods,
DeclareOpInterfaceMethods])> {
+ let extraClassDeclaration = [{
+/// Get the argument operands to the c
@@ -214,14 +214,15 @@ class CIRBaseBuilderTy : public mlir::OpBuilder {
//======//
cir::CallOp createCallOp(mlir::Location loc, mlir::SymbolRefAttr callee,
- mlir::Type returnTyp
@@ -152,3 +303,105 @@ RValue CIRGenFunction::emitCall(const CIRGenFunctionInfo
&funcInfo,
return ret;
}
+
+void CIRGenFunction::emitCallArg(CallArgList &args, const clang::Expr *e,
+ clang::QualType argType) {
+ assert(argType->isReferenceTy
@@ -68,20 +168,70 @@ static cir::CIRCallOpInterface
emitCallLikeOp(CIRGenFunction &cgf,
assert(builder.getInsertionBlock() && "expected valid basic block");
assert(!cir::MissingFeatures::opCallIndirect());
- return builder.createCallOp(callLoc, directFuncOp);
+ return b
@@ -18,22 +18,118 @@
using namespace clang;
using namespace clang::CIRGen;
-CIRGenFunctionInfo *CIRGenFunctionInfo::create(CanQualType resultType) {
- void *buffer = operator new(totalSizeToAlloc(1));
+CIRGenFunctionInfo *
+CIRGenFunctionInfo::create(CanQualType resultType,
+
@@ -1496,6 +1496,10 @@ def FuncOp : CIR_Op<"func", [
return getFunctionType().getReturnTypes();
}
+// TODO(cir): this should be an operand attribute, but for now we just
hard-
+// wire this as a function. Will later add a $no_proto argument to this op.
+
https://github.com/Lancern updated
https://github.com/llvm/llvm-project/pull/136810
>From 8f7b72f8dfe2e4fb32669a344f95be7ce04dae3d Mon Sep 17 00:00:00 2001
From: Sirui Mu
Date: Wed, 23 Apr 2025 12:14:40 +0800
Subject: [PATCH] [CIR] Upstream cir.call with scalar arguments
---
.../CIR/Dialect/B
@@ -18,22 +18,118 @@
using namespace clang;
using namespace clang::CIRGen;
-CIRGenFunctionInfo *CIRGenFunctionInfo::create(CanQualType resultType) {
- void *buffer = operator new(totalSizeToAlloc(1));
+CIRGenFunctionInfo *
+CIRGenFunctionInfo::create(CanQualType resultType,
+
@@ -68,20 +168,70 @@ static cir::CIRCallOpInterface
emitCallLikeOp(CIRGenFunction &cgf,
assert(builder.getInsertionBlock() && "expected valid basic block");
assert(!cir::MissingFeatures::opCallIndirect());
- return builder.createCallOp(callLoc, directFuncOp);
+ return b
@@ -21,9 +21,24 @@ let cppNamespace = "::cir" in {
// The CIRCallOpInterface must be used instead of CallOpInterface when
looking
// at arguments and other bits of CallOp. This creates a level of abstraction
// that's useful for handling indirect calls and other details.
@@ -21,9 +21,24 @@ let cppNamespace = "::cir" in {
// The CIRCallOpInterface must be used instead of CallOpInterface when
looking
// at arguments and other bits of CallOp. This creates a level of abstraction
// that's useful for handling indirect calls and other details.
https://github.com/erichkeane commented:
This loop is using a bunch of traditional for loops instead of 'range-for' (and
loops instead of algorithms!). It would be a vast improvement to replace those
with std::algorithms if they end up being 'simple' enough, and at least
range-for loops.
htt
@@ -152,3 +303,105 @@ RValue CIRGenFunction::emitCall(const CIRGenFunctionInfo
&funcInfo,
return ret;
}
+
+void CIRGenFunction::emitCallArg(CallArgList &args, const clang::Expr *e,
+ clang::QualType argType) {
+ assert(argType->isReferenceTy
https://github.com/erichkeane edited
https://github.com/llvm/llvm-project/pull/136810
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -18,22 +18,118 @@
using namespace clang;
using namespace clang::CIRGen;
-CIRGenFunctionInfo *CIRGenFunctionInfo::create(CanQualType resultType) {
- void *buffer = operator new(totalSizeToAlloc(1));
+CIRGenFunctionInfo *
+CIRGenFunctionInfo::create(CanQualType resultType,
+
@@ -68,20 +168,70 @@ static cir::CIRCallOpInterface
emitCallLikeOp(CIRGenFunction &cgf,
assert(builder.getInsertionBlock() && "expected valid basic block");
assert(!cir::MissingFeatures::opCallIndirect());
- return builder.createCallOp(callLoc, directFuncOp);
+ return b
@@ -68,20 +168,70 @@ static cir::CIRCallOpInterface
emitCallLikeOp(CIRGenFunction &cgf,
assert(builder.getInsertionBlock() && "expected valid basic block");
assert(!cir::MissingFeatures::opCallIndirect());
- return builder.createCallOp(callLoc, directFuncOp);
+ return b
@@ -1496,6 +1496,10 @@ def FuncOp : CIR_Op<"func", [
return getFunctionType().getReturnTypes();
}
+// TODO(cir): this should be an operand attribute, but for now we just
hard-
+// wire this as a function. Will later add a $no_proto argument to this op.
+
llvmbot wrote:
@llvm/pr-subscribers-clang
Author: Sirui Mu (Lancern)
Changes
This PR upstreams support for scalar arguments in `cir.call` operation.
Related to #132487 .
---
Patch is 40.42 KiB, truncated to 20.00 KiB below, full version:
https://github.com/llvm/llvm-project/pull/136810
https://github.com/Lancern created
https://github.com/llvm/llvm-project/pull/136810
This PR upstreams support for scalar arguments in `cir.call` operation.
Related to #132487 .
>From 557cae2daea53723010390cdf545721dd9ad7de4 Mon Sep 17 00:00:00 2001
From: Sirui Mu
Date: Wed, 23 Apr 2025 12:14:
41 matches
Mail list logo