This is an archive of the discontinued LLVM Phabricator instance.

[libc][memfunctions] Explicit error when platform in not supported
ClosedPublic

Authored by gchatelet on Jul 18 2023, 6:30 AM.

Diff Detail

Event Timeline

gchatelet created this revision.Jul 18 2023, 6:30 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJul 18 2023, 6:30 AM
gchatelet requested review of this revision.Jul 18 2023, 6:30 AM
gchatelet accepted this revision.Jul 18 2023, 6:50 AM
This revision is now accepted and ready to land.Jul 18 2023, 6:50 AM
This revision was landed with ongoing or failed builds.Jul 18 2023, 6:53 AM
This revision was automatically updated to reflect the committed changes.

I think this has broken amdgpu. Why are author and reviewer the same name?

Broke CI two hours ago. https://lab.llvm.org/staging/#/builders/247/builds/3194

gchatelet added a comment.EditedJul 18 2023, 9:11 AM

I think this has broken amdgpu. Why are author and reviewer the same name?

Normally I would commit such small (and presumably benign) changes without review but I've been told that all libc patches should go through Phabricator.
I made sure to run the patch on all our CI machines before submitting (ARM, aarch64, riscv and x86).

Broke CI two hours ago. https://lab.llvm.org/staging/#/builders/247/builds/3194

Thx for the heads up.
I'm monitoring https://lab.llvm.org/buildbot/#/grid?tag=libc for breakage when I submit such patches, it seems that openmp-offload-libc-amdgpu-runtime is not tagged with libc. If you are the maintainer of the build bot can you make sure it is tagged with libc?

I still want to make it explicitly visible what platform we support for memory functions. Do I understand correctly that AMDGPU will receive trivial implementations as defined in https://github.com/llvm/llvm-project/blob/main/libc/src/string/memory_utils/generic/byte_per_byte.h?

Thx.

gchatelet reopened this revision.Jul 18 2023, 9:26 AM

@JonChesterfield I will reland this patch with an explicit support for AMDGPU. I'll add you as a reviewer when it's ready.

This revision is now accepted and ready to land.Jul 18 2023, 9:26 AM
gchatelet updated this revision to Diff 541601.Jul 18 2023, 9:32 AM
  • Add explicit support for AMDGPU
gchatelet edited reviewers, added: JonChesterfield; removed: gchatelet.Jul 18 2023, 9:33 AM
This revision now requires review to proceed.Jul 18 2023, 9:33 AM

I think Joseph is running that bot. My understanding is that amdgpu would like faster implementations but hasn't written them yet, so the generic one will do for now

JonChesterfield accepted this revision.Jul 18 2023, 11:04 AM

Change looks good here. I'm away from desk, asked Joseph if he's available to check it builds. Suggest you land it in a few minutes if he doesn't say anything and the linked bot can serve as the sanity check. Thanks!

This revision is now accepted and ready to land.Jul 18 2023, 11:04 AM
jhuber6 accepted this revision.Jul 18 2023, 11:12 AM

Works on my machine, thanks.

This revision was landed with ongoing or failed builds.Jul 19 2023, 1:45 AM
This revision was automatically updated to reflect the committed changes.

Thx for checking the patch!
@jhuber6 any chance you can add the libc tag to the bot? That would be helpful.

Also I'd be happy to add GPU specific implementations but I'm not too familiar with the specifics of these architectures. Let me know if you already have optimized versions on your side and I can try to integrate them.

jhuber6 added a subscriber: arsenm.Jul 19 2023, 7:07 AM

Thx for checking the patch!
@jhuber6 any chance you can add the libc tag to the bot? That would be helpful.

Also I'd be happy to add GPU specific implementations but I'm not too familiar with the specifics of these architectures. Let me know if you already have optimized versions on your side and I can try to integrate them.

According to @arsenm, for the GPU these should just map to intrinsics, but I don't have a good view of the benefits of having something impolemented in source, vs leaving it to the backend.

Thx for checking the patch!
@jhuber6 any chance you can add the libc tag to the bot? That would be helpful.

Also I'd be happy to add GPU specific implementations but I'm not too familiar with the specifics of these architectures. Let me know if you already have optimized versions on your side and I can try to integrate them.

According to @arsenm, for the GPU these should just map to intrinsics, but I don't have a good view of the benefits of having something impolemented in source, vs leaving it to the backend.

These should just emit llvm.{memcpy|memmove|memset}. If you implemented it source ideally we would pattern recognize it into the intrinsics