Displaying 20 results from an estimated 500 matches similar to: "coro transformations insert unreachable in destroy fn?"
2018 Jun 27
2
can debug info for coroutines be improved?
I'm going to show the same function, first normally, and then as a
coroutine, and show how gdb can see the variable when it's a normal
function, but not when it's a coroutine. I'd like to understand if this can
be improved.
I'm trying to debug a real world problem, but the lack of debug info on
variables in coroutines is making it difficult. Should I file a bug? Is
this a
2018 Mar 02
1
is it allowed to use musttail on llvm.coro.resume?
It makes sense that you would be able to do this:
%save1 = llvm.coro.save()
%unused = musttail call llvm.coro.resume(%some_handle)
%x = llvm.coro.suspend()
...
But the docs for musttail say:
> The call must immediately precede a ret instruction, or a pointer bitcast
followed by a ret instruction.
Should this be amended to allow a musttail to be followed by
llvm.coro.suspend() ?
Regards,
2016 Jul 15
2
RFC: Coroutine Optimization Passes
Hi all:
I've included below a brief description of coroutine related optimization
passes and some questions/thoughts related to them. Looking forward to your
feedback, comments and questions.
Thank you!
Roadmap:
========
1) Get agreement on coroutine representation and overall direction.
.. repeat 1) until happy
http://lists.llvm.org/pipermail/llvm-dev/2016-June/100838.html (Initial)
2016 Jun 15
2
[RFC] LLVM Coroutines
Hi Sanjoy,
>> I'm not familiar with fiber-type APIs, but I assume fiber_fork is like
>> setjmp, in that it can "return twice"?
Yes, user-mode stack switching API are somewhat similar to setjmp. Here are
links to a doc page and implementation, just in case you are curious:
http://www.boost.org/doc/libs/1_59_0/libs/context/doc/html/context/context.html
2016 Jun 09
2
[RFC] LLVM Coroutines
On Thu, Jun 9, 2016 at 1:49 PM, Eli Friedman <eli.friedman at gmail.com> wrote:
>> Right... but that doesn't mean the call to the suspend intrinsic has to be
>> the last non-terminator instruction in the basic block before you run
>> CoroSplit. You can split the basic block in CoroSplit so any instructions
>> after the suspend call are part of a different basic
2016 Jun 12
2
[RFC] LLVM Coroutines
Hi Eli:
>> Block1:
>> %0 = call i8 coro.suspend()
>> switch i8 %0, label suspend1 [i8 0 %return] ; or icmp + br i1
>> Suspend1:
>> switch i8 %0, label %resume1 [i8 1 %destroy1] ; or icmp + br i1
>>
>> This doesn't look right: intuitively the suspend happens after the return
>> block runs.
Perhaps, but, that is not the intended
2016 Jun 11
4
[RFC] LLVM Coroutines
On Fri, Jun 10, 2016 at 5:25 PM, Gor Nishanov <gornishanov at gmail.com> wrote:
> Hi Eli:
>
> >> Naively, you would expect that it would be legal to hoist the store...
> >> but that breaks your coroutine semantics because the global could be
> mutated
> >> between the first return and the resume.
>
> Hmmm... I don't see the problem. I think
2018 Feb 26
0
problem with moveSpillUsesAfterCoroBegin
Here's what this function is supposed to do:
// Move early uses of spilled variable after CoroBegin.
// For example, if a parameter had address taken, we may end up with the
code
// like:
// define @f(i32 %n) {
// %n.addr = alloca i32
// store %n, %n.addr
// ...
// call @coro.begin
// we need to move the store after coro.begin
in the
2020 Nov 18
0
[RFC] Coroutine and pthread_self
Hi,
I would like to propose a potential solution to a bug that involves
coroutine and pthread_self().
Description of the bug can be found in
https://bugs.llvm.org/show_bug.cgi?id=47833. Below is a summary:
pthread_self() from glibc is defined with "__attribute__
((__const__))". The const attribute tells the compiler that it does
not read nor write any global state and hence always
2016 Jun 09
2
Fwd: [RFC] LLVM Coroutines
Hi Eli:
Thank you very much for your comments!
>> If you need some sort of unusual control flow construct, make it a
>> proper terminator instruction
I would love to. I was going by the advice in "docs/ExtendingLLVM.rst":
"WARNING: Adding instructions changes the bitcode format, and it will
take some effort to maintain compatibility with the previous
2016 Jun 12
2
[RFC] LLVM Coroutines
(Dropped llvm-dev by accident. Putting it back)
HI Eli:
>> coro.barrier() doesn't work: if the address of the alloca doesn't escape,
>> alias analysis will assume the barrier can't read or write the value of
>> the alloca, so the barrier doesn't actually block code movement.
Got it. I am new to this and learning a lot over the course
of this thread. Thank you
2016 Jun 13
3
[RFC] LLVM Coroutines
Hi Sanjoy:
>> Now in the above CFG %val can be folded to 10, but in reality you need
>> a PHI of 10 and 20
Quick answer: folding %val to 10 is OK, but, I would prefer it to be 'undef'
or even catch it in the verifier as it is a programmer/frontend error.
Details are in the second half of my reply. I would like to start
with the thought experiment you suggested, as it might
2006 Sep 26
1
Followup to "pxe weirdness" in syslinux archives
I'm running across the same weirdness mentioned in the "pxe weirdness"
thread in the archives:
http://syslinux.zytor.com/archives/2003-July/002229.html
I couldn't find any followups to the issue. Was it a misconfiguration
error? My setup is similar to James': I'm attempting to do a PXE install
using DHCP sent via dhcrelay. I get the right IP, netmask, etc. but get
2018 Feb 08
0
llvm.coro.size - why can't we call it from outside the coroutine?
http://llvm.org/docs/Coroutines.html#llvm-coro-size-intrinsic
The @llvm.coro.size intrinsic returns a value which lowers to a constant
representing the number of bytes needed for the coroutine frame of the
current function.
This would presumably be used to call malloc with the return value. I
noticed, however, that the example code does not check for the return value
of malloc being NULL. It is
2016 Jun 12
2
[RFC] LLVM Coroutines
I think I got it. Original model (with coro.fork and two-way coro.suspend)
will work with a tiny tweak.
In the original model, I was replacing coro.suspend with br %return in original
function. The problem was coming from potential phi-nodes introduces into
return block during optimizations.
Let's make sure that there is only entry into the return block.
In the original model, ReturnBB had
2019 Dec 26
2
[RFC] Coroutines passes in the new pass manager
Hello all,
It's been a month since my previous email on the topic, and since then
I've done some initial work on porting the coroutines passes to the
new pass manager. In total there are 6 patches -- that's a lot to
review, so allow me to introduce the changes being made in each of
them.
# What's finished
In these first 6 patches, I focused on lowering coroutine intrinsics
2016 Jul 21
2
RFC: LLVM Coroutine Representation, Round 2
cc llvm-dev
On Thu, Jul 21, 2016 at 9:57 AM, Vadim Chugunov <vadimcn at gmail.com> wrote:
> Hi Gor,
> Does you design support resumption with parameter(s)? (such as Python's
> generator.send(x)). I suppose the "promise" could be used for passing data
> both ways, but if that's the plan, please mention this explicitly in the
> design doc.
> Also, how is
2016 Jun 09
6
Fwd: [RFC] LLVM Coroutines
Hi all:
Below is a proposal to add experimental coroutine support to LLVM. Though this
proposal is motivated primarily by the desire to support C++ Coroutines [1],
the llvm representation is language neutral and can be used to support
coroutines in other languages as well.
Clang + llvm coroutines allows you to take this code:
generator<int> range(int from, int to) {
for(int i =
2018 Jan 10
3
RFC: attribute synthetic("reason")
Summary
I would like to propose that we add the following function attribute to LLVM:
synthetic(<string>)
This attribute can only be applied to functions. It is not a semantic statement about the function it decorates. It is, instead, an explicit directive to LLVM to not attempt to propagate information about the function body outside of the function, including by changing the
2016 Jun 10
2
[RFC] LLVM Coroutines
On Fri, Jun 10, 2016 at 6:36 AM, Gor Nishanov <gornishanov at gmail.com> wrote:
> >> If you're going down that route, that still leaves the question of the
> >> semantics of the fork intrinsic... thinking about it a bit more, I think
> >> you're going to run into problems with trying to keep around a return
> block
> >> through optimizations: