This is an archive of the discontinued LLVM Phabricator instance.

[libc] Implement `exit` for the GPU partially
ClosedPublic

Authored by jhuber6 on Apr 27 2023, 11:07 AM.

Details

Summary

This patch implements the exit function on the GPU. This required
breaking the entrypoints calling eachother on linux since this doesn't
work with a non-aliased target. This is only partial support because
full support requires a malloc / free implementation for the exit
callbacks array.

Diff Detail

Event Timeline

jhuber6 created this revision.Apr 27 2023, 11:07 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptApr 27 2023, 11:07 AM
jhuber6 requested review of this revision.Apr 27 2023, 11:07 AM
sivachandra added inline comments.Apr 27 2023, 11:13 AM
libc/src/stdlib/gpu/_Exit.cpp
1

We can unify the _Exit implementation now as it uses the OSUtil abstraction. Move this to the top-level directory and remove the linux/_Exit.cpp implementation.

sivachandra accepted this revision.Apr 27 2023, 11:23 AM
sivachandra added inline comments.
libc/config/gpu/entrypoints.txt
70

Why are they separated out like this?

This revision is now accepted and ready to land.Apr 27 2023, 11:23 AM
jhuber6 added inline comments.Apr 27 2023, 11:24 AM
libc/config/gpu/entrypoints.txt
70

It was like that in the x64 one so I just copied it.

jhuber6 updated this revision to Diff 517660.Apr 27 2023, 11:25 AM

Fix leftover dep on syscalls.

This revision was landed with ongoing or failed builds.Apr 27 2023, 6:32 PM
This revision was automatically updated to reflect the committed changes.