Skip to content

__builtin_memcpy_inline usage introduction. #8614

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

devnexen
Copy link
Member

for now concealed in few places in zend. builtin producing only a load and store
operands and works with compile time lengths.

for now concealed in few places in zend. builtin producing only a load and store
 operands and works with compile time lengths.
@devnexen devnexen force-pushed the builtin_memcpy_inline branch from 86a5380 to 7b29f95 Compare May 23, 2022 21:54
@devnexen
Copy link
Member Author

devnexen commented May 24, 2022

to answer the 'what's for?' question, it is a kind of micro-optimization (unit tests finish ~1 sec faster). Granted it is not available on gcc but clang tough.

@arnaud-lb
Copy link
Member

Is the added complexity worth it ? I would expect compilers to already inline memcpy when the cost/benefits is favorable to inlining.

@devnexen
Copy link
Member Author

devnexen commented May 24, 2022

I would expect compilers to already inline memcpy when the cost/benefits is favorable to inlining.

Not necessarily, not passing any compiler flags but the default ones I get a little bump (tested with clang 14).
The complexity is relative, less impactful than the EXPECT macro nor need to care about arguments changes or anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants