Clang automatically inserts llvm.memcpy when we assign (copy) a structure.
input .c file
unsigned char buf1;
unsigned char buf2;
buf2 = buf1;
output .ll file
call void @llvm.memcpy.p0i8.p0i8.i16(…
We are targeting embedded systems, so we cannot accept this behavior.
- Is there a way to prevent this automatic insertion ?
- If there is no way to prevent it, which library function other than memcpy will be automatically inserted?
BTW, I tried specifying the “-fno-builtin-memcpy” option, but llvm.memcpy was still auto-inserted.