This is an archive of the discontinued LLVM Phabricator instance.

[libc][reland] Fix builtin definition for memory functions
ClosedPublic

Authored by michaelrj on Nov 16 2022, 4:36 PM.

Details

Summary

The memory functions are highly performance sensitive and use builtins
where possible, but also need to define those functions names when they
don't exist to avoid compilation errors. Previously all those
redefinitions were behind the SSE2 flag for x86, which caused errors on
CPUs that supported SSE2 but not AVX512. This patch splits the various
CPU extensions out to avoid errors on such CPUs.

Diff Detail

Event Timeline

michaelrj created this revision.Nov 16 2022, 4:36 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptNov 16 2022, 4:36 PM
michaelrj requested review of this revision.Nov 16 2022, 4:36 PM

This is a reland of https://reviews.llvm.org/D137868 which was reverted for causing macro redefinition errors. This version prevents that issue, although it still has warnings about unused parameters and unused type aliases due to the empty macros making their functions no-ops.

This revision is now accepted and ready to land.Nov 17 2022, 5:14 AM
michaelrj updated this revision to Diff 476235.Nov 17 2022, 2:03 PM

make the conditions match the ones for including the intrinsic headers.