memory: rollback changes to memcpy. we need to track poison bytewise at least
ADD
tests/alive-tv/memory/memcpy-2-loadstore.src.ll
+; ERROR: Mismatch in memory
+
+define void @fn(i8* %p, i8* %q) {
+ tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %q, i8* align 4 %p, i64 4, i1 false)
+ ret void
+}
+
+declare void @llvm.memcpy.p0i8.p0i8.i64(i8*, i8*, i64, i1)

ADD
tests/alive-tv/memory/memcpy-2-loadstore.tgt.ll
+define void @fn(i8* %p, i8* %q) {
+ %p2 = bitcast i8* %p to i32*
+ %q2 = bitcast i8* %q to i32*
+ %v = load i32, i32* %p2
+ store i32 %v, i32* %q2
+ ret void
+}
+
+declare void @llvm.memcpy.p0i8.p0i8.i64(i8*, i8*, i64, i1)
+

MODIFY
tools/transform.cpp
tools/transform.cpp
@@ -572,8 +572,18 @@ static uint64_t get_access_size(const Instr &inst) {
}
if (auto i = dynamic_cast<const Memcpy*>(&inst)) {
+#if 0
if (auto bytes = get_int(i->getBytes()))
return gcd(gcd(i->getSrcAlign(), i->getDstAlign()), *bytes);
+#endif
+ // FIXME: memcpy doesn't have multi-byte support
+ (void)i;
+ return 1;
+ }
+
+ if (auto i = dynamic_cast<const Malloc*>(&inst)) {
+ // FIXME: memcpy doesn't have multi-byte support
+ if (i->isRealloc())
return 1;
}

memory: rollback changes to memcpy. we need to track poison bytewise at least