[LLVMdev] Question on equivalence of pointer types
Sanjoy Das
sanjoy at playingwithpointers.com
Thu Dec 4 22:09:39 PST 2014
Is copy.0 semantically equivalent to copy.1 in the following example?
define void @copy.0(i8 addrspace(1)* addrspace(1)* %src, i8
addrspace(1)* addrspace(1)* %dst) {
entry:
%val = load i8 addrspace(1)* addrspace(1)* %src
store i8 addrspace(1)* %val, i8 addrspace(1)* addrspace(1)* %dst
ret void
}
define void @copy.1(i8 addrspace(1)* addrspace(1)* %src, i8
addrspace(1)* addrspace(1)* %dst) {
entry:
%src.cast = bitcast i8 addrspace(1)* addrspace(1)* %src to i8* addrspace(1)*
%dst.cast = bitcast i8 addrspace(1)* addrspace(1)* %dst to i8* addrspace(1)*
%val = load i8* addrspace(1)* %src.cast
store i8* %val, i8* addrspace(1)* %dst.cast
ret void
}
-- Sanjoy
More information about the llvm-dev
mailing list