void copy(int *__restrict a, int *b, int size) {
for(int i=0; i<size; i++) {
a[i] = b[i];
}
}
However, without __restrict it does not.
What I want to do is to tell the compiler, that a could intersect with b only if a and b are same pointers (or in other words, a and b point to the start of memory region), so it can generate check and memcpy. It could be useful for languages like java, where arrays could not partially intersect.
Is there any LLVM metadata, that could express that semantics?