[PATCH] D81885: [Coroutines] Return false on error of buildSuspends

2020-06-15 Thread Xun Li via Phabricator via cfe-commits
lxfind created this revision. lxfind added a reviewer: modocache. Herald added a project: clang. Herald added a subscriber: cfe-commits. I believe we need to return false when buildSuspends failed, to indicate that ActOnCoroutineBodyStart failed. Repository: rG LLVM Github Monorepo https://r

[PATCH] D81885: [Coroutines] Return false on error of buildSuspends

2020-06-15 Thread Xun Li via Phabricator via cfe-commits
lxfind updated this revision to Diff 270929. lxfind added a comment. Adjust tests Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81885/new/ https://reviews.llvm.org/D81885 Files: clang/lib/Sema/SemaCoroutine.cpp clang/test/SemaCXX/coroutines.cp

[PATCH] D82029: [Coroutines] Ensure co_await promise.final_suspend() does not throw

2020-06-17 Thread Xun Li via Phabricator via cfe-commits
lxfind created this revision. lxfind added reviewers: lewissbaker, modocache. Herald added a project: clang. Herald added a subscriber: cfe-commits. This patch addresses https://bugs.llvm.org/show_bug.cgi?id=46256 The spec of coroutine requires that the expression co_­await promise.final_­suspend

[PATCH] D82928: [Coroutines] Fix code coverage for coroutine

2020-07-01 Thread Xun Li via Phabricator via cfe-commits
lxfind updated this revision to Diff 274836. lxfind added a comment. Rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D82928/new/ https://reviews.llvm.org/D82928 Files: clang/lib/CodeGen/CoverageMappingGen.cpp clang/test/CoverageMapping/cor

[PATCH] D82314: [Coroutines] Optimize the lifespan of temporary co_await object

2020-07-01 Thread Xun Li via Phabricator via cfe-commits
lxfind added a comment. In D82314#2124662 , @junparser wrote: > In D82314#2124661 , @junparser wrote: > > > @lxfind This patch causes some mismatch when variable is used in both > > resume and destroy function. Bes

[PATCH] D82928: [Coroutines] Fix code coverage for coroutine

2020-07-01 Thread Xun Li via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG565e37c7702d: [Coroutines] Fix code coverage for coroutine (authored by lxfind). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D82928/new/ https://reviews.ll

[PATCH] D82928: [Coroutines] Fix code coverage for coroutine

2020-07-01 Thread Xun Li via Phabricator via cfe-commits
lxfind added a comment. In D82928#2126018 , @fhahn wrote: > Looks like this causes a bunch of build bot failures, e.g > http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/31465 b > > It would be great if you could take a look. Looks like

[PATCH] D82984: Revert "[Coroutines] Fix code coverage for coroutine"

2020-07-01 Thread Xun Li via Phabricator via cfe-commits
lxfind created this revision. lxfind added reviewers: fhahn, modocache. Herald added a project: clang. Herald added a subscriber: cfe-commits. lxfind abandoned this revision. lxfind added a comment. Fix up in https://reviews.llvm.org/D82986 This reverts commit 565e37c7702d181804c12d36b6010c513c9

[PATCH] D82928: [Coroutines] Fix code coverage for coroutine

2020-07-01 Thread Xun Li via Phabricator via cfe-commits
lxfind added a comment. In D82928#2126018 , @fhahn wrote: > Looks like this causes a bunch of build bot failures, e.g > http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/31465 b > > It would be great if you could take a look. Let me rev

[PATCH] D82984: Revert "[Coroutines] Fix code coverage for coroutine"

2020-07-01 Thread Xun Li via Phabricator via cfe-commits
lxfind abandoned this revision. lxfind added a comment. Fix up in https://reviews.llvm.org/D82986 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D82984/new/ https://reviews.llvm.org/D82984 ___ cfe-commit

[PATCH] D82986: [Coroutines] Fix test breakage in D82928

2020-07-01 Thread Xun Li via Phabricator via cfe-commits
lxfind created this revision. lxfind added reviewers: modocache, fhahn. Herald added a project: clang. Herald added a subscriber: cfe-commits. modocache accepted this revision. modocache added a comment. This revision is now accepted and ready to land. Thanks for the fix! The test file in D82928

[PATCH] D82928: [Coroutines] Fix code coverage for coroutine

2020-07-01 Thread Xun Li via Phabricator via cfe-commits
lxfind added a comment. In D82928#2126018 , @fhahn wrote: > Looks like this causes a bunch of build bot failures, e.g > http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/31465 b > > It would be great if you could take a look. Fix patch

[PATCH] D82986: [Coroutines] Fix test breakage in D82928

2020-07-01 Thread Xun Li via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGddcf063dd52f: [Coroutines] Fix test breakage in D82928 (authored by lxfind). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D82986/new/ https://reviews.llvm.o

[PATCH] D82992: clang CoverageMapping tests bot cleanup

2020-07-01 Thread Xun Li via Phabricator via cfe-commits
lxfind created this revision. lxfind added a reviewer: thakis. Herald added a project: clang. Herald added a subscriber: cfe-commits. D82928 generated unexpected tmp files in the CoverageMapping test directory. This patch cleans it up and remove the file in the

[PATCH] D82986: [Coroutines] Fix test breakage in D82928

2020-07-01 Thread Xun Li via Phabricator via cfe-commits
lxfind added a comment. In D82986#2126479 , @thakis wrote: > That's not enough, you also need to add an rm to remove the stale .LL file > still on disk, see my comment on your original change. It's in https://reviews.llvm.org/D82992 if you could help ac

[PATCH] D82992: clang CoverageMapping tests bot cleanup

2020-07-01 Thread Xun Li via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG9fc877213e07: clang CoverageMapping tests bot cleanup (authored by lxfind). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D82992/new/ https://reviews.llvm.or

[PATCH] D82992: clang CoverageMapping tests bot cleanup

2020-07-01 Thread Xun Li via Phabricator via cfe-commits
lxfind added a comment. In D82992#2126898 , @MaskRay wrote: > Hi, your git commit contains extra Phabricator tags. You can drop > `Reviewers:` `Subscribers:` `Tags:` and the text `Summary:` from the git > commit with the following script: > > arcfilter

[PATCH] D81885: [Coroutines] Return false on error of buildSuspends

2020-06-18 Thread Xun Li via Phabricator via cfe-commits
lxfind abandoned this revision. lxfind added a comment. Makes sense. I will abandon this change. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81885/new/ https://reviews.llvm.org/D81885 ___ cfe-commits

[PATCH] D82029: [Coroutines] Ensure co_await promise.final_suspend() does not throw

2020-06-18 Thread Xun Li via Phabricator via cfe-commits
lxfind updated this revision to Diff 271801. lxfind added a comment. Herald added a subscriber: arphaman. Address feedback and update failed tests Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D82029/new/ https://reviews.llvm.org/D82029 Files: cl

[PATCH] D82029: [Coroutines] Ensure co_await promise.final_suspend() does not throw

2020-06-18 Thread Xun Li via Phabricator via cfe-commits
lxfind marked an inline comment as done. lxfind added inline comments. Comment at: clang/test/SemaCXX/coroutine-final-suspend-noexcept.cpp:14 +struct coroutine_handle { + static coroutine_handle from_address(void *); // expected-note {{must be declared with 'noexcept'}} +}; ---

[PATCH] D82029: [Coroutines] Ensure co_await promise.final_suspend() does not throw

2020-06-19 Thread Xun Li via Phabricator via cfe-commits
lxfind updated this revision to Diff 272109. lxfind added a comment. Addressed comments: Updated error message, and sorted notes. The tests are kept unchanged. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D82029/new/ https://reviews.llvm.org/D8202

[PATCH] D82029: [Coroutines] Ensure co_await promise.final_suspend() does not throw

2020-06-22 Thread Xun Li via Phabricator via cfe-commits
lxfind added a comment. All tests are passing now. Thanks for reviewing! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D82029/new/ https://reviews.llvm.org/D82029 ___ cfe-commits mailing list cfe-commit

[PATCH] D82314: [RFC][Coroutines] Optimize the lifespan of temporary co_await object

2020-06-22 Thread Xun Li via Phabricator via cfe-commits
lxfind created this revision. lxfind added reviewers: lewissbaker, modocache, junparser. Herald added a project: clang. Herald added a subscriber: cfe-commits. If we ever assign co_await to a temporary variable, such as foo(co_await expr), we generate AST that looks like this: MaterializedTempora

[PATCH] D82029: [Coroutines] Ensure co_await promise.final_suspend() does not throw

2020-06-22 Thread Xun Li via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG516803dc8685: [Coroutines] Ensure co_await promise.final_suspend() does not throw (authored by lxfind). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D82029/n

[PATCH] D82029: [Coroutines] Ensure co_await promise.final_suspend() does not throw

2020-06-23 Thread Xun Li via Phabricator via cfe-commits
lxfind added a comment. Test failures are being fixed in https://reviews.llvm.org/D82338/new/ Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D82029/new/ https://reviews.llvm.org/D82029 ___ cfe-commits ma

[PATCH] D82314: [RFC][Coroutines] Optimize the lifespan of temporary co_await object

2020-06-23 Thread Xun Li via Phabricator via cfe-commits
lxfind added a comment. In D82314#2107910 , @junparser wrote: > Rather than doing it here, can we build await_resume call expression with > MaterializedTemporaryExpr when expand the coawait expression. That's how gcc > does. There doesn't appear to be

[PATCH] D82332: [Coroutines] Handle dependent promise types for final_suspend non-throw check

2020-06-23 Thread Xun Li via Phabricator via cfe-commits
lxfind created this revision. Herald added subscribers: cfe-commits, modocache. Herald added a project: clang. lxfind updated this revision to Diff 272553. lxfind added a comment. lxfind added reviewers: Benabik, lewissbaker, junparser. lxfind updated this revision to Diff 272786. lxfind edited the

[PATCH] D82314: [RFC][Coroutines] Optimize the lifespan of temporary co_await object

2020-06-23 Thread Xun Li via Phabricator via cfe-commits
lxfind added a comment. @rsmith Thanks. That's a good point. Do you know if there already exists optimization passes in LLVM that attempts to shrink the range of lifetime intrinsics? If so, I am curious why that does not help in this case. Or is it generally unsafe to move the lifetime intrinsi

[PATCH] D82415: [Coroutines] Special handle __builtin_coro_resume for final_suspend nothrow check

2020-06-23 Thread Xun Li via Phabricator via cfe-commits
lxfind created this revision. Herald added subscribers: cfe-commits, modocache. Herald added a project: clang. lxfind added reviewers: modocache, lewissbaker, junparser. lxfind requested review of this revision. In https://reviews.llvm.org/D82029 we added the conformance check that the expression

[PATCH] D82314: [RFC][Coroutines] Optimize the lifespan of temporary co_await object

2020-06-23 Thread Xun Li via Phabricator via cfe-commits
lxfind updated this revision to Diff 272904. lxfind added a comment. Herald added subscribers: llvm-commits, hiraditya. Herald added a project: LLVM. Tackle this problem inside CoroSplit as an optimization. Instead of only handling one particular case, we now look at every local variable in the

[PATCH] D82415: [Coroutines] Special handle __builtin_coro_resume for final_suspend nothrow check

2020-06-23 Thread Xun Li via Phabricator via cfe-commits
lxfind updated this revision to Diff 272905. lxfind added a comment. Address lint Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D82415/new/ https://reviews.llvm.org/D82415 Files: clang/lib/Sema/SemaCoroutine.cpp Index: clang/lib/Sema/SemaCorout

[PATCH] D82415: [Coroutines] Special handle __builtin_coro_resume for final_suspend nothrow check

2020-06-23 Thread Xun Li via Phabricator via cfe-commits
lxfind updated this revision to Diff 272910. lxfind added a comment. rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D82415/new/ https://reviews.llvm.org/D82415 Files: clang/lib/Sema/SemaCoroutine.cpp Index: clang/lib/Sema/SemaCoroutine.cp

[PATCH] D82314: [RFC][Coroutines] Optimize the lifespan of temporary co_await object

2020-06-24 Thread Xun Li via Phabricator via cfe-commits
lxfind updated this revision to Diff 272916. lxfind added a comment. Address test failures Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D82314/new/ https://reviews.llvm.org/D82314 Files: llvm/lib/Transforms/Coroutines/CoroSplit.cpp llvm/test/T

[PATCH] D82314: [RFC][Coroutines] Optimize the lifespan of temporary co_await object

2020-06-24 Thread Xun Li via Phabricator via cfe-commits
lxfind marked an inline comment as done. lxfind added inline comments. Comment at: llvm/lib/Transforms/Coroutines/CoroSplit.cpp:1286 +continue; + if (CastInst) { +// If we have multiple cast instructions for the alloca, don't junparser wrote:

[PATCH] D82314: [RFC][Coroutines] Optimize the lifespan of temporary co_await object

2020-06-24 Thread Xun Li via Phabricator via cfe-commits
lxfind updated this revision to Diff 273169. lxfind added a comment. Actually it seems pretty easy to handle the case of multiple BitCastInst, so did it here. Also added a test. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D82314/new/ https://revi

[PATCH] D82314: [RFC][Coroutines] Optimize the lifespan of temporary co_await object

2020-06-24 Thread Xun Li via Phabricator via cfe-commits
lxfind updated this revision to Diff 273171. lxfind added a comment. A few unintended changes Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D82314/new/ https://reviews.llvm.org/D82314 Files: llvm/lib/Transforms/Coroutines/CoroSplit.cpp llvm/tes

[PATCH] D82314: [RFC][Coroutines] Optimize the lifespan of temporary co_await object

2020-06-24 Thread Xun Li via Phabricator via cfe-commits
lxfind updated this revision to Diff 273173. lxfind added a comment. Remove unused variable Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D82314/new/ https://reviews.llvm.org/D82314 Files: llvm/lib/Transforms/Coroutines/CoroSplit.cpp llvm/test/

[PATCH] D82415: [Coroutines] Special handle __builtin_coro_resume for final_suspend nothrow check

2020-06-25 Thread Xun Li via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. lxfind marked an inline comment as done. Closed by commit rG366159566df3: [Coroutines] Special handle __builtin_coro_resume for final_suspend nothrow… (authored by lxfind). Changed prior to commit: https://reviews.llvm.or

[PATCH] D82332: [Coroutines] Handle dependent promise types for final_suspend non-throw check

2020-06-25 Thread Xun Li via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGc25acec84594: [Coroutines] Handle dependent promise types for final_suspend non-throw check (authored by lxfind). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.or

[PATCH] D82314: [Coroutines] Optimize the lifespan of temporary co_await object

2020-06-26 Thread Xun Li via Phabricator via cfe-commits
lxfind added a comment. In D82314#2117543 , @lewissbaker wrote: > > There are still room for improvements, in particular, GCC has a 4K frame > > for this function. > > I think GCC having a smaller coroutine frame is probably because it does not > yet i

[PATCH] D82314: [Coroutines] Optimize the lifespan of temporary co_await object

2020-06-29 Thread Xun Li via Phabricator via cfe-commits
lxfind updated this revision to Diff 273946. lxfind added a comment. Rebase before landing Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D82314/new/ https://reviews.llvm.org/D82314 Files: llvm/lib/Transforms/Coroutines/CoroSplit.cpp llvm/test/T

[PATCH] D82314: [Coroutines] Optimize the lifespan of temporary co_await object

2020-06-29 Thread Xun Li via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGc8755b6378c2: [Coroutines] Optimize the lifespan of temporary co_await object (authored by lxfind). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D82314/new/

[PATCH] D82928: [Coroutines] Fix code coverage for coroutine

2020-06-30 Thread Xun Li via Phabricator via cfe-commits
lxfind created this revision. lxfind added reviewers: lewissbaker, modocache, junparser. Herald added a project: clang. Herald added a subscriber: cfe-commits. Previously, source-based coverage analysis does not work properly for coroutine. This patch adds processing of coroutine body and co_retur

[PATCH] D79219: [CMake] Simplify CMake handling for zlib

2020-08-07 Thread Xun Li via Phabricator via cfe-commits
lxfind added a comment. @phosek, Under this change, now when I build LLVM (with a basic config `cmake -G Ninja --LLVM_ENABLE_PROJECTS="clang" ../llvm`), in file `build_dir/lib/cmake/llvm/LLVMExports.cmake`, I see this: set_target_properties(LLVMSupport PROPERTIES INTERFACE_LINK_LIBRARIES

[PATCH] D79219: [CMake] Simplify CMake handling for zlib

2020-08-08 Thread Xun Li via Phabricator via cfe-commits
lxfind added a comment. In D79219#2201415 , @phosek wrote: > In D79219#2201109 , @lxfind wrote: > >> @phosek, Under this change, now when I build LLVM (with a basic config >> `cmake -G Ninja --LLVM_ENABLE_PROJECTS=

[PATCH] D87470: [Coroutine][Sema] Tighten the lifetime of symmetric transfer returned handle

2020-09-10 Thread Xun Li via Phabricator via cfe-commits
lxfind added a comment. In D87470#2267060 , @junparser wrote: > Thanks for the change. LGTM, and testcase? Not sure how to add a test case for this though. We don't seem to explicitly test AST output. Repository: rG LLVM Github Monorepo CHANGES SINC

[PATCH] D87470: [Coroutine][Sema] Tighten the lifetime of symmetric transfer returned handle

2020-09-10 Thread Xun Li via Phabricator via cfe-commits
lxfind updated this revision to Diff 291140. lxfind added a comment. Add test case. Verify that the size of the frame reduced by 8. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87470/new/ https://reviews.llvm.org/D87470 Files: clang/lib/Sema/Se

[PATCH] D87470: [Coroutine][Sema] Tighten the lifetime of symmetric transfer returned handle

2020-09-11 Thread Xun Li via Phabricator via cfe-commits
lxfind added a comment. hmm @rjmccall, I don't think there is a stable way to test this. The code generated for symmetric transfer is way too complicated to stably pattern match one less item in the frame. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.

[PATCH] D87470: [Coroutine][Sema] Tighten the lifetime of symmetric transfer returned handle

2020-09-11 Thread Xun Li via Phabricator via cfe-commits
lxfind updated this revision to Diff 291255. lxfind added a comment. Remove unstable test Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87470/new/ https://reviews.llvm.org/D87470 Files: clang/lib/Sema/SemaCoroutine.cpp Index: clang/lib/Sema/Se

[PATCH] D87470: [Coroutine][Sema] Tighten the lifetime of symmetric transfer returned handle

2020-09-11 Thread Xun Li via Phabricator via cfe-commits
lxfind updated this revision to Diff 291321. lxfind added a comment. Add test to verify that lifetime.end appears right after the address call. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87470/new/ https://reviews.llvm.org/D87470 Files: clang

[PATCH] D87470: [Coroutine][Sema] Tighten the lifetime of symmetric transfer returned handle

2020-09-11 Thread Xun Li via Phabricator via cfe-commits
lxfind updated this revision to Diff 291324. lxfind added a comment. remove asan option, not needed Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87470/new/ https://reviews.llvm.org/D87470 Files: clang/lib/Sema/SemaCoroutine.cpp clang/test/Cod

[PATCH] D87470: [Coroutine][Sema] Tighten the lifetime of symmetric transfer returned handle

2020-09-11 Thread Xun Li via Phabricator via cfe-commits
lxfind added a comment. In D87470#2268911 , @rjmccall wrote: > Thanks, LGTM. Thank you for reviewing and the suggestions on testcase! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87470/new/ https://review

[PATCH] D87470: [Coroutine][Sema] Tighten the lifetime of symmetric transfer returned handle

2020-09-11 Thread Xun Li via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGdf477db5f9e0: [Coroutine][Sema] Tighten the lifetime of symmetric transfer returned handle (authored by lxfind). Repository: rG LLVM Github Monore

[PATCH] D87470: [Coroutine][Sema] Tighten the lifetime of symmetric transfer returned handle

2020-09-15 Thread Xun Li via Phabricator via cfe-commits
lxfind added a comment. In D87470#2273310 , @junparser wrote: > @lxfind , could you backport this to branch 11? I am actually seeing some problems with this change. Still investigating. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D87470: [Coroutine][Sema] Tighten the lifetime of symmetric transfer returned handle

2020-09-10 Thread Xun Li via Phabricator via cfe-commits
lxfind created this revision. lxfind added reviewers: lewissbaker, wenlei, hoy, bruno, junparser, rjmccall. Herald added subscribers: cfe-commits, dexonsmith, modocache. Herald added a project: clang. lxfind requested review of this revision. In generating the code for symmetric transfer, a tempor

[PATCH] D92661: [RFC] Fix TLS and Coroutine

2020-12-08 Thread Xun Li via Phabricator via cfe-commits
lxfind added inline comments. Comment at: llvm/include/llvm/IR/Intrinsics.td:1309 +// Intrinsic to obtain the address of a thread_local variable. +def int_threadlocal : Intrinsic<[llvm_ptr_ty], [llvm_ptr_ty]>; + hoy wrote: > lxfind wrote: > > hoy wrote: > > > lxf

[PATCH] D92661: [RFC] Fix TLS and Coroutine

2020-12-09 Thread Xun Li via Phabricator via cfe-commits
lxfind updated this revision to Diff 310575. lxfind added a comment. Herald added subscribers: nikic, kerbowa, jvesely. Fix all failing tests Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D92661/new/ https://reviews.llvm.org/D92661 Files: clang/l

[PATCH] D92662: [Clang][Coroutine] Drop const attribute on pthread_self when coroutine is enabled

2020-12-09 Thread Xun Li via Phabricator via cfe-commits
lxfind updated this revision to Diff 310599. lxfind added a comment. Fix test Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D92662/new/ https://reviews.llvm.org/D92662 Files: clang/lib/Sema/SemaDecl.cpp clang/test/CodeGenCoroutines/coro-pthread

[PATCH] D92662: [Clang][Coroutine] Drop const attribute on pthread_self when coroutine is enabled

2020-12-09 Thread Xun Li via Phabricator via cfe-commits
lxfind added a comment. In D92662#2443970 , @MaskRay wrote: > If the attribute is not suitable, glibc should drop it. The compiler can add > `readnone`/`readonly` if appropriate. It's a C library interface though, and Coroutine is likely too new for this

[PATCH] D92662: [Clang][Coroutine] Drop const attribute on pthread_self when coroutine is enabled

2020-12-10 Thread Xun Li via Phabricator via cfe-commits
lxfind added a comment. In D92662#2446777 , @jyknight wrote: > I don't think we should change the meaning of `__attribute__((const))` to > exclude depending on thread-id. > > However, if we do want to do so, and call the existing uses of > `__attribute__

[PATCH] D90990: [Coroutine][Sema] Cleanup temporaries as early as possible

2020-11-06 Thread Xun Li via Phabricator via cfe-commits
lxfind created this revision. Herald added subscribers: cfe-commits, modimo, wenlei, modocache. Herald added a project: clang. lxfind requested review of this revision. The original bug was discovered in T75057860. Clang front-end emits an AST that looks like this for an co_await expression: | -

[PATCH] D90990: [Coroutine][Sema] Cleanup temporaries as early as possible

2020-11-10 Thread Xun Li via Phabricator via cfe-commits
lxfind added inline comments. Comment at: clang/lib/Sema/SemaCoroutine.cpp:475 + if (!AwaitSuspend) +return Calls; if (!AwaitSuspend->getType()->isDependentType()) { bruno wrote: > In case `AwaitSuspend` is null, is there any need to set `Calls.IsInvalid`

[PATCH] D90990: [Coroutine][Sema] Cleanup temporaries as early as possible

2020-11-10 Thread Xun Li via Phabricator via cfe-commits
lxfind added inline comments. Comment at: clang/lib/Sema/SemaCoroutine.cpp:475 + if (!AwaitSuspend) +return Calls; if (!AwaitSuspend->getType()->isDependentType()) { lxfind wrote: > bruno wrote: > > In case `AwaitSuspend` is null, is there any need to set

[PATCH] D90990: [Coroutine][Sema] Cleanup temporaries as early as possible

2020-11-10 Thread Xun Li via Phabricator via cfe-commits
lxfind updated this revision to Diff 304233. lxfind added a comment. Add AST test Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90990/new/ https://reviews.llvm.org/D90990 Files: clang/lib/Sema/SemaCoroutine.cpp clang/test/AST/Inputs/std-corout

[PATCH] D90990: [Coroutine][Sema] Cleanup temporaries as early as possible

2020-11-10 Thread Xun Li via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG19f077092343: [Coroutine][Sema] Cleanup temporaries as early as possible (authored by lxfind). Repository: rG LLVM Github Monorepo CHANGES SINCE

[PATCH] D86853: [modules] Fix crash in call to `FunctionDecl::setPure()`

2020-11-18 Thread Xun Li via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGc6c8d4a13ebd: [modules] Fix crash in call to `FunctionDecl::setPure()` (authored by andrewjcg, committed by lxfind). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm

[PATCH] D86853: [modules] Fix crash in call to `FunctionDecl::setPure()`

2020-11-18 Thread Xun Li via Phabricator via cfe-commits
lxfind added a comment. @rsmith, @v.g.vassilev hey I stamped this patch assuming it looks ok. But definitely shout at me if more feedback needs to be addressed. Happy to follow up. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D86853/new/ https://

[PATCH] D89066: [Coroutine][Sema] Only tighten the suspend call temp lifetime for final awaiter

2020-10-08 Thread Xun Li via Phabricator via cfe-commits
lxfind created this revision. lxfind added reviewers: lewissbaker, wenlei, bruno, junparser, rjmccall. Herald added subscribers: cfe-commits, modimo, dexonsmith, modocache. Herald added a project: clang. lxfind requested review of this revision. In https://reviews.llvm.org/D87470 I added the chang

[PATCH] D89066: [Coroutine][Sema] Only tighten the suspend call temp lifetime for final awaiter

2020-10-11 Thread Xun Li via Phabricator via cfe-commits
lxfind added a comment. In D89066#2324115 , @junparser wrote: > why we should not do this with normal await call? To be honest, I don't know yet. My understanding of how expression cleanup and temp lifetime management is insufficient at the moment. But f

[PATCH] D89066: [Coroutine][Sema] Only tighten the suspend call temp lifetime for final awaiter

2020-10-12 Thread Xun Li via Phabricator via cfe-commits
lxfind added a comment. In D89066#2324291 , @junparser wrote: > In D89066#2324151 , @lxfind wrote: > >> In D89066#2324115 , @junparser >> wrote: >> >>> why we should not do

[PATCH] D89066: [Coroutine][Sema] Only tighten the suspend call temp lifetime for final awaiter

2020-10-12 Thread Xun Li via Phabricator via cfe-commits
lxfind updated this revision to Diff 297656. lxfind added a comment. Add more comments and TODO Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89066/new/ https://reviews.llvm.org/D89066 Files: clang/lib/Sema/SemaCoroutine.cpp clang/test/CodeGen

[PATCH] D89066: [Coroutine][Sema] Only tighten the suspend call temp lifetime for final awaiter

2020-10-12 Thread Xun Li via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGdce8f2bb25ea: [Coroutine][Sema] Only tighten the suspend call temp lifetime for final awaiter (authored by lxfind). Repository: rG LLVM Github Mon

[PATCH] D89066: [Coroutine][Sema] Only tighten the suspend call temp lifetime for final awaiter

2020-10-12 Thread Xun Li via Phabricator via cfe-commits
lxfind added a comment. There seems to be build failures in the buildbot, but I don't understand why it's happening.. (unable to repro locally and the patterns seem reasonable) http://lab.llvm.org:8011/#/builders/12/builds/92/steps/7/logs/FAIL__Clang__coro-semmetric-transfer_cpp Repository: r

[PATCH] D89269: [Coroutine] Rename coro-semmetric-transfer.cpp and possibly fix test failure

2020-10-12 Thread Xun Li via Phabricator via cfe-commits
lxfind created this revision. lxfind added reviewers: wenlei, junparser. Herald added subscribers: cfe-commits, modimo, modocache. Herald added a project: clang. lxfind requested review of this revision. Some tests start to fail after https://reviews.llvm.org/D89066. It's because the size of point

[PATCH] D89066: [Coroutine][Sema] Only tighten the suspend call temp lifetime for final awaiter

2020-10-12 Thread Xun Li via Phabricator via cfe-commits
lxfind added a comment. Test failures are being fixed in https://reviews.llvm.org/D89269. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89066/new/ https://reviews.llvm.org/D89066 ___ cfe-commits mailing

[PATCH] D89269: [Coroutine] Rename coro-semmetric-transfer.cpp and fix test failure

2020-10-12 Thread Xun Li via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGd80ecdf27faf: [Coroutine] Rename coro-semmetric-transfer.cpp and possibly fix test failure (authored by lxfind). Repository: rG LLVM Github Monore

[PATCH] D92661: [RFC] Fix TLS and Coroutine

2020-12-04 Thread Xun Li via Phabricator via cfe-commits
lxfind created this revision. Herald added subscribers: hoy, modimo, wenlei, steven_wu, modocache, hiraditya, mgorny. lxfind requested review of this revision. Herald added a reviewer: jdoerfert. Herald added subscribers: llvm-commits, cfe-commits, sstefan1, jdoerfert. Herald added projects: clang

[PATCH] D92662: [Clang][Coroutine] Drop const attribute on pthread_self when coroutine is enabled

2020-12-04 Thread Xun Li via Phabricator via cfe-commits
lxfind created this revision. Herald added subscribers: hoy, modimo, wenlei, modocache. lxfind requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. This patch is to address https://bugs.llvm.org/show_bug.cgi?id=47833 A relevant discussion can al

[PATCH] D92661: [RFC] Fix TLS and Coroutine

2020-12-04 Thread Xun Li via Phabricator via cfe-commits
lxfind added inline comments. Comment at: llvm/include/llvm/IR/Intrinsics.td:1309 +// Intrinsic to obtain the address of a thread_local variable. +def int_threadlocal : Intrinsic<[llvm_ptr_ty], [llvm_ptr_ty]>; + hoy wrote: > hoy wrote: > > With the intrinsic, can

[PATCH] D92661: [RFC] Fix TLS and Coroutine

2020-12-04 Thread Xun Li via Phabricator via cfe-commits
lxfind added inline comments. Comment at: llvm/include/llvm/IR/Intrinsics.td:1309 +// Intrinsic to obtain the address of a thread_local variable. +def int_threadlocal : Intrinsic<[llvm_ptr_ty], [llvm_ptr_ty]>; + hoy wrote: > lxfind wrote: > > hoy wrote: > > > hoy

[PATCH] D102465: [Coroutines] Mark every parameter

2021-05-13 Thread Xun Li via Phabricator via cfe-commits
lxfind created this revision. Herald added subscribers: ChuanqiXu, hoy, modimo, wenlei, hiraditya. lxfind requested review of this revision. Herald added subscribers: llvm-commits, cfe-commits, jdoerfert. Herald added projects: clang, LLVM. Repository: rG LLVM Github Monorepo https://reviews.ll

[PATCH] D107155: [clang][deps] Substitute clang-scan-deps executable in lit tests

2021-07-30 Thread Xun Li via Phabricator via cfe-commits
lxfind accepted this revision. lxfind added a comment. This revision is now accepted and ready to land. Thank you! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107155/new/ https://reviews.llvm.org/D107155 _

[PATCH] D43477: [CFG] [analyzer] Add MaterializeTemporaryExpr into the construction context.

2021-08-02 Thread Xun Li via Phabricator via cfe-commits
lxfind added a comment. Herald added subscribers: manas, steakhal, ASDenysPetrov, martong, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, baloghadamsoftware. Hi! I have a question regarding the implementation of "VisitMaterializeTemporaryExpr". Specifically, I wonder if we should skip visiting

[PATCH] D105877: [Coroutines] Run coroutine passes by default

2021-08-03 Thread Xun Li via Phabricator via cfe-commits
lxfind added a comment. In D105877#2923257 , @nikic wrote: > I noticed that this change had a measurable impact on `O0` memory usage, > which I wouldn't have expected > (https://llvm-compile-time-tracker.com/compare.php?from=0f9e6451a836886f39137818c4f0

[PATCH] D105066: [Coroutines] Remove CoroElide from O0 pipeline

2021-06-28 Thread Xun Li via Phabricator via cfe-commits
lxfind created this revision. lxfind added reviewers: ChuanqiXu, rjmccall. Herald added subscribers: hoy, modimo, wenlei, hiraditya. lxfind requested review of this revision. Herald added projects: clang, LLVM. Herald added subscribers: llvm-commits, cfe-commits. CoroElide pass works only when a p

[PATCH] D105066: [Coroutines] Remove CoroElide from O0 pipeline

2021-06-28 Thread Xun Li via Phabricator via cfe-commits
lxfind updated this revision to Diff 355073. lxfind added a comment. update tests Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D105066/new/ https://reviews.llvm.org/D105066 Files: clang/test/CodeGenCoroutines/coro-newpm-pipeline.cpp llvm/lib/P

[PATCH] D105066: [Coroutines] Remove CoroElide from O0 pipeline

2021-06-28 Thread Xun Li via Phabricator via cfe-commits
lxfind added a comment. In D105066#2845958 , @ChuanqiXu wrote: > On O0, it is possible to inline if the user marked the function with > `always_inline`. > Since CoroElide is kind of optimization, it should be OK to skip in O0. > Out of curiosity, what's

[PATCH] D105066: [Coroutines] Remove CoroElide from O0 pipeline

2021-06-28 Thread Xun Li via Phabricator via cfe-commits
lxfind added a comment. > Yeah, but it may be inlined after splitting, which could trigger coro elide. In O0, there is no inliner pass (after CoroSplit), so inlining should never happen. >> in fact, we should make it illegal to mark a coroutine "always_inline", >> because there is no guarante

[PATCH] D105066: [Coroutines] Remove CoroElide from O0 pipeline

2021-06-28 Thread Xun Li via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG31eb696fc4cd: [Coroutines] Remove CoroElide from O0 pipeline (authored by lxfind). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D105066/new/ https://reviews

[PATCH] D95807: [RFC][Coroutines] Add the newly generated SCCs back to the CGSCC work queue after CoroSplit actually happened

2021-06-28 Thread Xun Li via Phabricator via cfe-commits
lxfind updated this revision to Diff 355110. lxfind added a comment. Herald added subscribers: cfe-commits, qcolombet. Herald added a project: clang. After removing the legacy test command, I was finally able to update this patch. It's now ready for review. I will update the decription to reflect

[PATCH] D95807: [Coroutines] Add the newly generated SCCs back to the CGSCC work queue after CoroSplit actually happened

2021-06-29 Thread Xun Li via Phabricator via cfe-commits
lxfind added a comment. In D95807#2846358 , @ChuanqiXu wrote: >> note that we don't really need to run Inliner again on the ramp function >> after split > > This isn't accurate. The inline may run again for ramp function after split > and it's required b

[PATCH] D95807: [Coroutines] Add the newly generated SCCs back to the CGSCC work queue after CoroSplit actually happened

2021-06-29 Thread Xun Li via Phabricator via cfe-commits
lxfind added a comment. In D95807#2849053 , @aeubanks wrote: > this will run the function simplification pipeline twice on every single > function when coroutines are enabled, I don't think that's the intention > > I thought the intention was to do all th

[PATCH] D95807: [Coroutines] Add the newly generated SCCs back to the CGSCC work queue after CoroSplit actually happened

2021-06-29 Thread Xun Li via Phabricator via cfe-commits
lxfind added a comment. > If coroutine ramp function couldn't get inlined, it would disable coroutine > elide optimization. Could you elaborate more on why do you want to do that? Ramp function will eventually be inlined, but not when you run Inliner on the inlinee. Let's say coroutine A calls

[PATCH] D95807: [Coroutines] Add the newly generated SCCs back to the CGSCC work queue after CoroSplit actually happened

2021-06-29 Thread Xun Li via Phabricator via cfe-commits
lxfind updated this revision to Diff 355431. lxfind added a comment. Put the post-split ramp function back to the CGSCC worklist Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D95807/new/ https://reviews.llvm.org/D95807 Files: clang/test/CodeGenCo

[PATCH] D95807: [Coroutines] Add the newly generated SCCs back to the CGSCC work queue after CoroSplit actually happened

2021-06-30 Thread Xun Li via Phabricator via cfe-commits
lxfind added inline comments. Comment at: llvm/lib/Transforms/Coroutines/CoroSplit.cpp:2112-2114 StringRef Value = Attr.getValueAsString(); LLVM_DEBUG(dbgs() << "CoroSplit: Processing coroutine '" << F.getName() << "' state: " << Value << "\n"); -

[PATCH] D95807: [Coroutines] Add the newly generated SCCs back to the CGSCC work queue after CoroSplit actually happened

2021-06-30 Thread Xun Li via Phabricator via cfe-commits
lxfind updated this revision to Diff 355607. lxfind added a comment. fix warning Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D95807/new/ https://reviews.llvm.org/D95807 Files: clang/test/CodeGenCoroutines/coro-newpm-pipeline.cpp llvm/lib/Pass

[PATCH] D95807: [Coroutines] Add the newly generated SCCs back to the CGSCC work queue after CoroSplit actually happened

2021-06-30 Thread Xun Li via Phabricator via cfe-commits
lxfind added inline comments. Comment at: llvm/lib/Transforms/Coroutines/CoroSplit.cpp:2001 -if ((Shape.ABI == coro::ABI::Async || Shape.ABI == coro::ABI::Retcon || - Shape.ABI == coro::ABI::RetconOnce) && -!Shape.CoroSuspends.empty()) { - // Run the CG

[PATCH] D95807: [Coroutines] Add the newly generated SCCs back to the CGSCC work queue after CoroSplit actually happened

2021-06-30 Thread Xun Li via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG822b92aae439: [Coroutines] Add the newly generated SCCs back to the CGSCC work queue after… (authored by lxfind). Repository: rG LLVM Github Monor

[PATCH] D108696: [Coroutines] [Frontend] Lookup in std namespace first

2021-11-03 Thread Xun Li via Phabricator via cfe-commits
lxfind accepted this revision. lxfind added a comment. I also agree that we should try to keep the compiler simple and not support the complicated case. It should be fairly straightforward for a codebase to update fully to use std instead of std::experimental (we have a large coroutine codebase

[PATCH] D97915: [Coroutines] Handle overaligned frame allocation

2021-03-04 Thread Xun Li via Phabricator via cfe-commits
lxfind added a comment. Could you describe in more detail what problem this patch solves? Also, since you are adding a new intrinsics, please also update the coroutine documentation regarding this new intrinsics. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews

  1   2   >