Skip to content

Commit

Permalink
Use proper alignment when copying data to a variable.
Browse files Browse the repository at this point in the history
Using align=1 is very expensive on hardware without unaligned ld/st (eg. GPUs).
  • Loading branch information
maleadt committed Mar 10, 2017
1 parent 3b5a0eb commit 8880d96
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3850,7 +3850,7 @@ static void emit_assignment(jl_value_t *l, jl_value_t *r, jl_codectx_t *ctx)
builder.CreateMemCpy(vi.value.V,
data_pointer(rval_info, ctx, T_pint8),
copy_bytes,
/*TODO: min_align*/1,
((jl_datatype_t*)rval_info.typ)->layout->alignment,
vi.isVolatile,
tbaa);
}
Expand Down

0 comments on commit 8880d96

Please sign in to comment.