llvm.org GIT mirror llvm / 0445dc2
Do pointer cast simplifications on addrspacecast git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199254 91177308-0d34-0410-b5e6-96231b3b80d8 Matt Arsenault 6 years ago
2 changed file(s) with 11 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
19081908 }
19091909
19101910 Instruction *InstCombiner::visitAddrSpaceCast(AddrSpaceCastInst &CI) {
1911 return commonCastTransforms(CI);
1912 }
1911 return commonPointerCastTransforms(CI);
1912 }
788788 ; CHECK-NEXT: ret i16 8
789789 }
790790
791 define i32 addrspace(1)* @ascast_0_gep([128 x i32]* %p) nounwind {
792 ; CHECK-LABEL: @ascast_0_gep(
793 ; CHECK-NOT: getelementptr
794 ; CHECK: ret
795 %gep = getelementptr [128 x i32]* %p, i32 0, i32 0
796 %x = addrspacecast i32* %gep to i32 addrspace(1)*
797 ret i32 addrspace(1)* %x
798 }
799
791800 ; CHECK: attributes [[NUW]] = { nounwind }