1 ; RUN: opt -instcombine -S < %s | FileCheck %s
3 target datalayout = "e-p:64:64:64-p1:32:32:32-p2:16:16:16-n8:16:32:64"
5 define i32* @combine_redundant_addrspacecast(i32 addrspace(1)* %x) nounwind {
6 ; CHECK-LABEL: @combine_redundant_addrspacecast(
7 ; CHECK: addrspacecast i32 addrspace(1)* %x to i32*
9 %y = addrspacecast i32 addrspace(1)* %x to i32 addrspace(3)*
10 %z = addrspacecast i32 addrspace(3)* %y to i32*
14 define <4 x i32*> @combine_redundant_addrspacecast_vector(<4 x i32 addrspace(1)*> %x) nounwind {
15 ; CHECK-LABEL: @combine_redundant_addrspacecast_vector(
16 ; CHECK: addrspacecast <4 x i32 addrspace(1)*> %x to <4 x i32*>
18 %y = addrspacecast <4 x i32 addrspace(1)*> %x to <4 x i32 addrspace(3)*>
19 %z = addrspacecast <4 x i32 addrspace(3)*> %y to <4 x i32*>
23 define float* @combine_redundant_addrspacecast_types(i32 addrspace(1)* %x) nounwind {
24 ; CHECK-LABEL: @combine_redundant_addrspacecast_types(
25 ; CHECK: addrspacecast i32 addrspace(1)* %x to float*
27 %y = addrspacecast i32 addrspace(1)* %x to i32 addrspace(3)*
28 %z = addrspacecast i32 addrspace(3)* %y to float*