https://github.com/vogelsgesang commented:
Looks good to me, but at the same time: I am not experienced in the
clang-frontend, so please wait for an approval of a more experienced
clang-frontend contributor
https://github.com/llvm/llvm-project/pull/108474
__
@@ -880,14 +898,12 @@ ExprResult
Sema::BuildUnresolvedCoawaitExpr(SourceLocation Loc, Expr *Operand,
}
auto *RD = Promise->getType()->getAsCXXRecordDecl();
- bool AwaitElidable =
- isCoroAwaitElidableCall(Operand) &&
- isAttributedCoroAwaitElidable(
-
@@ -8261,12 +8261,19 @@ def CoroAwaitElidableDoc : Documentation {
The ``[[clang::coro_await_elidable]]`` is a class attribute which can be
applied
to a coroutine return type.
-When a coroutine function that returns such a type calls another coroutine
function,
-the compiler
@@ -880,14 +898,12 @@ ExprResult
Sema::BuildUnresolvedCoawaitExpr(SourceLocation Loc, Expr *Operand,
}
auto *RD = Promise->getType()->getAsCXXRecordDecl();
- bool AwaitElidable =
- isCoroAwaitElidableCall(Operand) &&
- isAttributedCoroAwaitElidable(
-
https://github.com/vogelsgesang edited
https://github.com/llvm/llvm-project/pull/108474
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/vogelsgesang edited
https://github.com/llvm/llvm-project/pull/108474
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/vogelsgesang commented:
Thanks for implementing this! Looking forward to using it 🙂
https://github.com/llvm/llvm-project/pull/108474
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/list
@@ -8261,12 +8261,19 @@ def CoroAwaitElidableDoc : Documentation {
The ``[[clang::coro_await_elidable]]`` is a class attribute which can be
applied
to a coroutine return type.
-When a coroutine function that returns such a type calls another coroutine
function,
-the compiler
@@ -880,14 +898,12 @@ ExprResult
Sema::BuildUnresolvedCoawaitExpr(SourceLocation Loc, Expr *Operand,
}
auto *RD = Promise->getType()->getAsCXXRecordDecl();
- bool AwaitElidable =
- isCoroAwaitElidableCall(Operand) &&
- isAttributedCoroAwaitElidable(
-
@@ -84,4 +84,35 @@ Task nonelidable() {
co_return 1;
}
+// CHECK-LABEL: define{{.*}} @_Z8addTasksO4TaskIiES1_{{.*}} {
+Task addTasks([[clang::coro_must_await]] Task &&t1, Task &&t2) {
+ int i1 = co_await t1;
+ int i2 = co_await t2;
+ co_return i1 + i2;
+}
+
+// CHECK-LABE
@@ -8261,12 +8261,19 @@ def CoroAwaitElidableDoc : Documentation {
The ``[[clang::coro_await_elidable]]`` is a class attribute which can be
applied
to a coroutine return type.
vogelsgesang wrote:
```suggestion
to a coroutine return type. It provides a hint to
@@ -84,4 +84,35 @@ Task nonelidable() {
co_return 1;
}
+// CHECK-LABEL: define{{.*}} @_Z8addTasksO4TaskIiES1_{{.*}} {
+Task addTasks([[clang::coro_must_await]] Task &&t1, Task &&t2) {
+ int i1 = co_await t1;
+ int i2 = co_await t2;
+ co_return i1 + i2;
+}
+
+// CHECK-LABE
@@ -8281,8 +8288,62 @@ Example:
co_await t;
}
-The behavior is undefined if the caller coroutine is destroyed earlier than the
-callee coroutine.
+Such elision replaces the heap allocated activation frame of the callee
coroutine
+with a local variable within the enclosi
@@ -8281,8 +8288,62 @@ Example:
co_await t;
}
-The behavior is undefined if the caller coroutine is destroyed earlier than the
-callee coroutine.
+Such elision replaces the heap allocated activation frame of the callee
coroutine
+with a local variable within the enclosi
@@ -8261,12 +8261,19 @@ def CoroAwaitElidableDoc : Documentation {
The ``[[clang::coro_await_elidable]]`` is a class attribute which can be
applied
to a coroutine return type.
-When a coroutine function that returns such a type calls another coroutine
function,
-the compiler
@@ -8281,8 +8288,62 @@ Example:
co_await t;
}
-The behavior is undefined if the caller coroutine is destroyed earlier than the
-callee coroutine.
+Such elision replaces the heap allocated activation frame of the callee
coroutine
+with a local variable within the enclosi
@@ -249,7 +249,10 @@ Attribute Changes in Clang
(#GH106864)
- Introduced a new attribute ``[[clang::coro_await_elidable]]`` on coroutine
return types
- to express elideability at call sites where the coroutine is co_awaited as a
prvalue.
+ to express elideability at call
vogelsgesang wrote:
> Unfortunately, it seems we have an "either-or" decision here
Although... Is this even an either-or decision?
Could we add coro-split to the llc unconditionally, also for non-thin-lto
pipelines? Afaict, coro-split is a no-op pass if coroutines were already split
previousl
vogelsgesang wrote:
My 2cts:
I think it would be best for clang-users, if HALO / coroutine optimizations
work out-of-the-box in as many cases as possible.
Unfortunately, it seems we have an "either-or" decision here. Either, the
"thin-lto + HALO" work out-of-the-box or the llc-code-generation
@@ -1217,6 +1217,14 @@ def CoroDisableLifetimeBound : InheritableAttr {
let SimpleHandler = 1;
}
+def CoroAwaitElidable : InheritableAttr {
vogelsgesang wrote:
does this also warrant an entry in `clang/docs/ReleaseNotes.rst`?
https://github.com/llvm/llvm-p
@@ -8108,6 +8108,24 @@ but do not pass them to the underlying coroutine or pass
them by value.
}];
}
+def CoroAwaitElidableDoc : Documentation {
+ let Category = DocCatDecl;
+ let Content = [{
+The ``[[clang::coro_await_elidable]]`` is a class attribute which can be
applie
@@ -8108,6 +8108,24 @@ but do not pass them to the underlying coroutine or pass
them by value.
}];
}
+def CoroAwaitElidableDoc : Documentation {
+ let Category = DocCatDecl;
+ let Content = [{
+The ``[[clang::coro_await_elidable]]`` is a class attribute which can be
applie
@@ -825,6 +826,32 @@ ExprResult Sema::BuildOperatorCoawaitLookupExpr(Scope *S,
SourceLocation Loc) {
return CoawaitOp;
}
+static bool isAttributedCoroInplaceTask(const QualType &QT) {
+ auto *Record = QT->getAsCXXRecordDecl();
+ return Record && Record->hasAttr();
+}
+
+s
https://github.com/vogelsgesang edited
https://github.com/llvm/llvm-project/pull/94693
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/vogelsgesang edited
https://github.com/llvm/llvm-project/pull/94693
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,84 @@
+// This file tests the coro_structured_concurrency attribute semantics.
+// RUN: %clang_cc1 -std=c++20 -disable-llvm-passes -emit-llvm %s -o - |
FileCheck %s
+
+#include "Inputs/coroutine.h"
+#include "Inputs/utility.h"
+
+template
+struct [[clang::coro_struct
@@ -0,0 +1,84 @@
+// This file tests the coro_structured_concurrency attribute semantics.
+// RUN: %clang_cc1 -std=c++20 -disable-llvm-passes -emit-llvm %s -o - |
FileCheck %s
+
+#include "Inputs/coroutine.h"
+#include "Inputs/utility.h"
+
+template
+struct [[clang::coro_struct
@@ -167,7 +167,7 @@ C++2c implementation status
Disallow Binding a Returned Glvalue to a Temporary
https://wg21.link/P2748R5";>P2748R5
- No
+ Clang 19
vogelsgesang wrote:
Ah, I just saw this was already fixed in the meantime - nevermind 🙂
https://git
@@ -167,7 +167,7 @@ C++2c implementation status
Disallow Binding a Returned Glvalue to a Temporary
https://wg21.link/P2748R5";>P2748R5
- No
+ Clang 19
vogelsgesang wrote:
Should be `class="unreleased"` instead of `class="full"`
https://github.com/llvm
@@ -187,7 +187,7 @@ C++2c implementation status
Trivial infinite loops are not Undefined Behavior
https://wg21.link/P2809R3";>P2809R3 (DR)
- Clang 19
+ No
vogelsgesang wrote:
unreleased -> none
https://github.com/llvm/llvm-project/pull/90495
_
@@ -177,7 +177,7 @@ C++2c implementation status
Attributes for Structured Bindings
https://wg21.link/P0609R3";>P0609R3
- No
+ Clang 19
vogelsgesang wrote:
none -> unreleased
But maybe just fix this together when landing #90066...
https://github.com/l
@@ -187,7 +187,7 @@ C++2c implementation status
Trivial infinite loops are not Undefined Behavior
https://wg21.link/P2809R3";>P2809R3 (DR)
- No
+ Clang 19
vogelsgesang wrote:
the wrong paper was marked as implemented
https://github.com/llvm/llvm-proje
Author: Adrian Vogelsgesang
Date: 2023-08-07T21:25:22Z
New Revision: fda777849b0088ba83e28683c53c5c8321ef2558
URL:
https://github.com/llvm/llvm-project/commit/fda777849b0088ba83e28683c53c5c8321ef2558
DIFF:
https://github.com/llvm/llvm-project/commit/fda777849b0088ba83e28683c53c5c8321ef2558.diff
Author: Adrian Vogelsgesang
Date: 2022-09-16T06:29:49-07:00
New Revision: c9cffdde393f646acf62d6160e7fa6613e038508
URL:
https://github.com/llvm/llvm-project/commit/c9cffdde393f646acf62d6160e7fa6613e038508
DIFF:
https://github.com/llvm/llvm-project/commit/c9cffdde393f646acf62d6160e7fa6613e038508
Author: Adrian Vogelsgesang
Date: 2022-08-24T14:40:53-07:00
New Revision: 91389000abe8ef5d06d98cbbefd3fa03ac7e4480
URL:
https://github.com/llvm/llvm-project/commit/91389000abe8ef5d06d98cbbefd3fa03ac7e4480
DIFF:
https://github.com/llvm/llvm-project/commit/91389000abe8ef5d06d98cbbefd3fa03ac7e4480
Author: Adrian Vogelsgesang
Date: 2022-08-09T16:19:13-07:00
New Revision: df9a23e2feda18f0308b6d4dbd591ebe6b605aa4
URL:
https://github.com/llvm/llvm-project/commit/df9a23e2feda18f0308b6d4dbd591ebe6b605aa4
DIFF:
https://github.com/llvm/llvm-project/commit/df9a23e2feda18f0308b6d4dbd591ebe6b605aa4
36 matches
Mail list logo