Skip to content
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

Generate memset and memmove intrinsics from ccalls #43580

Merged
merged 4 commits into from
Jan 8, 2022

Conversation

pchintalapudi
Copy link
Member

@pchintalapudi pchintalapudi commented Dec 28, 2021

Memset and memmove are recognized LLVM builtins and should be generated as such, since LLVM can run store->load forwarding on small calls of known size. Furthermore, for arrays LLVM builtin memset instructions do not cause escapes, but direct calls to memset in the IR will escape.


Initially this PR only supported memset, but now supports memmove as well.

@N5N3
Copy link
Member

N5N3 commented Dec 29, 2021

It seems good to extend this to memmove, my local bench on win64 shows that llvm's builtin memmove is faster than system memmove.

@pchintalapudi pchintalapudi added the compiler:codegen Generation of LLVM IR and native code label Dec 29, 2021
@pchintalapudi pchintalapudi changed the title Generate memset intrinsic from memset ccalls Generate memset and memmove intrinsics from ccalls Dec 29, 2021
src/ccall.cpp Outdated Show resolved Hide resolved
Co-authored-by: Jameson Nash <vtjnash@gmail.com>
@vchuravy vchuravy merged commit 5f6b8a1 into JuliaLang:master Jan 8, 2022
LilithHafner pushed a commit to LilithHafner/julia that referenced this pull request Feb 22, 2022
@pchintalapudi pchintalapudi deleted the pc/memset branch March 6, 2022 21:59
LilithHafner pushed a commit to LilithHafner/julia that referenced this pull request Mar 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:codegen Generation of LLVM IR and native code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants