From 8880d9641dab4e6c19861acfc5821b2d21b52275 Mon Sep 17 00:00:00 2001 From: Tim Besard Date: Fri, 10 Mar 2017 15:08:12 +0100 Subject: [PATCH] Use proper alignment when copying data to a variable. Using align=1 is very expensive on hardware without unaligned ld/st (eg. GPUs). --- src/codegen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/codegen.cpp b/src/codegen.cpp index d79efe233dc48..0a270f14dcf3d 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -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); }