compilation of empty kernel emits undefined llvm.stackrestore.p0i8 #443
Labels
No Milestone
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: M-Labs/nac3#443
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Replace blink_forever.py with:
Also occurs in other situations, but the empty kernel seems to be the simplest repro.
Try to partially revert
ad4832dc
for all intrinsic functions that take a pointer as its input parameter. This has been reported upstream here: https://github.com/TheDan64/inkwell/issues/496.Some discoveries (on
d6565feed3
):Creating
nac3artiq/demo/demo2.py
with the following:and do
cargo build && python3 demo2.py && llvm-readelf -s module.elf
innac3artiq/demo/
reveals thatllvm.stackrestore.p0i8
is sometimes there and sometimes not, it is non-deterministic.With
llvm.stackrestore
:Without
llvm.stackrestore
:With https://git.m-labs.hk/M-Labs/nac3/commit/ad4832dc reverted (as suggested by @derppening) on top of
d6565feed3
, and running the same steps above. The orphanedllvm.stackrestore.p0i8
issue is eliminated but the output ofreadelf -s
still reveals some form of non-determinism within the code generator in that sometimesrpc_send
andrpc_recv
might or might not be added to the symbol table in this particular example.With
rpc_send
andrpc_recv
:Without
rpc_send
andrpc_recv
:and, as expected, the non-determinism would (or at least seems to) go away when the code generation stage is run only with a single thread. More specifically, doing this in
nac3artiq/src/lib.rs
:Closing, the
llvm.stackrestore.p0i8
problem is fixed by #446.About non-deterministic object outputs, see #7.
It is not fixed, it is worked around.
I think the compilation of kernels part is fixed?
The issue is only caused by Inkwell emitting
llvm.stackrestore.p0i8
due to a bug in Inkwell itself https://github.com/TheDan64/inkwell/issues/496. #446 is a workaround oncall_stackrestore
to make Inkwell spit out the namellvm.stackrestore
correctly.Compilation of certain kernels yielding
llvm.stackrestore.p0i8
randomly is probably due to indeterministic codegen worker outputs and LLVM sometimes couldn't pair upllvm.stackstore
with allvm.stackrestore
(wrongly namedllvm.stackrestore.p0i8
).When there are no more "probably" and "workaround" then we can close this Issue.
Sure