aboutsummaryrefslogtreecommitdiff
path: root/src/analyze.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2018-03-22 20:22:15 -0400
committerAndrew Kelley <superjoe30@gmail.com>2018-03-22 20:22:15 -0400
commitfe38d8142f713c1089cdc02f787184c48b8350b6 (patch)
tree393cddfdb28389da0e50e8e879433eb151c0b7d2 /src/analyze.cpp
parent62668e3e6b3c07d4145a7de3ebb9d5fdd728d75e (diff)
downloadzig-fe38d8142f713c1089cdc02f787184c48b8350b6.tar.gz
zig-fe38d8142f713c1089cdc02f787184c48b8350b6.zip
create multiple llvm.memcpy and llvm.memset with different align params
Diffstat (limited to 'src/analyze.cpp')
-rw-r--r--src/analyze.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/analyze.cpp b/src/analyze.cpp
index 395df229cd..eaace123ef 100644
--- a/src/analyze.cpp
+++ b/src/analyze.cpp
@@ -5681,6 +5681,10 @@ uint32_t zig_llvm_fn_key_hash(ZigLLVMFnKey x) {
return ((uint32_t)(x.data.overflow_arithmetic.bit_count) * 87135777) +
((uint32_t)(x.data.overflow_arithmetic.add_sub_mul) * 31640542) +
((uint32_t)(x.data.overflow_arithmetic.is_signed) ? 1062315172 : 314955820);
+ case ZigLLVMFnIdMemcpy:
+ return x.data.memcpy.dest_align * 2325524557 + x.data.memcpy.src_align * 519976394;
+ case ZigLLVMFnIdMemset:
+ return x.data.memset.dest_align * 388171592;
}
zig_unreachable();
}
@@ -5700,6 +5704,11 @@ bool zig_llvm_fn_key_eql(ZigLLVMFnKey a, ZigLLVMFnKey b) {
return (a.data.overflow_arithmetic.bit_count == b.data.overflow_arithmetic.bit_count) &&
(a.data.overflow_arithmetic.add_sub_mul == b.data.overflow_arithmetic.add_sub_mul) &&
(a.data.overflow_arithmetic.is_signed == b.data.overflow_arithmetic.is_signed);
+ case ZigLLVMFnIdMemcpy:
+ return (a.data.memcpy.dest_align == b.data.memcpy.dest_align) &&
+ (a.data.memcpy.src_align == b.data.memcpy.src_align);
+ case ZigLLVMFnIdMemset:
+ return (a.data.memset.dest_align == b.data.memset.dest_align);
}
zig_unreachable();
}