This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP][DeviceRTL] Implement libc function `memcmp`
ClosedPublic

Authored by tianshilei1992 on Aug 4 2022, 10:30 AM.

Details

Summary

We will add some simple implementation of libc functions starting from
this patch, and the first one is memcmp, which is reported in #56929. Note that
malloc and free are not included in this patch because of the use of
declare variant. In the near future we will implement the two functions w/o
using any vendor provided function.

This fixes #56929.

Diff Detail

Event Timeline

tianshilei1992 created this revision.Aug 4 2022, 10:30 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 4 2022, 10:30 AM
tianshilei1992 requested review of this revision.Aug 4 2022, 10:30 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 4 2022, 10:30 AM

remove one extra check

jhuber6 accepted this revision.Aug 4 2022, 10:38 AM
This revision is now accepted and ready to land.Aug 4 2022, 10:38 AM

https://discourse.llvm.org/t/llvm-embedded-toolchains-working-group-sync-up/63270/7
There was a discussion to use the in-tree libc for GPUs at their last meeting.

https://discourse.llvm.org/t/llvm-embedded-toolchains-working-group-sync-up/63270/7
There was a discussion to use the in-tree libc for GPUs at their last meeting.

yeah, this will move again soon. For now we need to fix a bug (reported for OpenMP but existing for all GPU + C++ languages).

https://discourse.llvm.org/t/llvm-embedded-toolchains-working-group-sync-up/63270/7
There was a discussion to use the in-tree libc for GPUs at their last meeting.

Thanks for the info. Will join in the meeting next time.

Will push a change to fix the printf issue on AMDGPU.

Will push a change to fix the printf issue on AMDGPU.

thanks for being on top of this

Will push a change to fix the printf issue on AMDGPU.

thanks for being on top of this

https://github.com/llvm/llvm-project/commit/459e3c51840a7f09536a7839deb7184b53bd7e92 should do it.