-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Add src alignment arg to emit_memcpy #51152
Conversation
Value *slot = emit_static_alloca(ctx, to); | ||
unsigned align = julia_alignment(jlto); | ||
cast<AllocaInst>(slot)->setAlignment(Align(align)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably make this an argument, since it is pretty much required now by AllocaInst (it will attempt a bad guess if you don't provide it https://llvm.org/doxygen/Instructions_8cpp.html#a35edfaf69cb59d25d92b1e77f0c27530)
src/cgutils.cpp
Outdated
@@ -3110,7 +3110,7 @@ static void init_bits_cgval(jl_codectx_t &ctx, Value *newv, const jl_cgval_t& v, | |||
{ | |||
// newv should already be tagged | |||
if (v.ispointer()) { | |||
emit_memcpy(ctx, newv, jl_aliasinfo_t::fromTBAA(ctx, tbaa), v, jl_datatype_size(v.typ), sizeof(void*)); | |||
emit_memcpy(ctx, newv, jl_aliasinfo_t::fromTBAA(ctx, tbaa), v, jl_datatype_size(v.typ), sizeof(void*), sizeof(void*)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
newv was a jl_value_t*
, so it had heap-alignment, but v
is not, so it has julia_alignment
Co-authored-by: Jameson Nash <vtjnash@gmail.com>
bump! |
This maybe allows for LLVM to optimize things a bit further since some passes check if both sides have correct/equal alignment