1 ; RUN: opt < %s -instcombine -S | FileCheck %s
3 define void @test(float* %a, float* readnone %a_end, i64 %b, float* %bf) unnamed_addr {
5 %cmp1 = icmp ult float* %a, %a_end
6 %b.float = inttoptr i64 %b to float*
7 br i1 %cmp1, label %bb1, label %bb2
10 br label %for.body.preheader
12 %bfi = ptrtoint float* %bf to i64
13 br label %for.body.preheader
15 for.body.preheader: ; preds = %entry
16 %b.phi = phi i64 [%b, %bb1], [%bfi, %bb2]
18 ; CHECK: for.body.preheader
21 ; CHECK: br label %for.body
23 for.body: ; preds = %for.body.preheader, %for.body
25 %a.addr.03 = phi float* [ %incdec.ptr, %for.body ], [ %a, %for.body.preheader ]
26 %b.addr.float = phi float* [ %b.addr.float.inc, %for.body ], [ %b.float, %for.body.preheader ]
27 %b.addr.i64 = phi i64 [ %b.addr.i64.inc, %for.body ], [ %b.phi, %for.body.preheader ]
28 ; CHECK: %a.addr.03 = phi float* [ %incdec.ptr, %for.body ], [ %a, %for.body.preheader ]
29 ; CHECK-NEXT: %b.addr.float = phi float* [ %b.addr.float.inc, %for.body ], [ %b.float, %for.body.preheader ]
30 ; CHECK-NEXT: %b.addr.i64.ptr = phi
31 ; CHECK-NOT: = phi i64
33 %l = load float, float* %b.addr.float, align 4
34 %mul.i = fmul float %l, 4.200000e+01
35 store float %mul.i, float* %a.addr.03, align 4
36 %b.addr.float.2 = inttoptr i64 %b.addr.i64 to float*
37 %b.addr.float.inc = getelementptr inbounds float, float* %b.addr.float.2, i64 1
38 ; CHECK: store float %mul.i
40 ; CHECK: %b.addr.float.inc =
41 %b.addr.i64.inc = ptrtoint float* %b.addr.float.inc to i64
43 %incdec.ptr = getelementptr inbounds float, float* %a.addr.03, i64 1
44 ; CHECK: %incdec.ptr =
45 %cmp = icmp ult float* %incdec.ptr, %a_end
46 br i1 %cmp, label %for.body, label %for.end
48 for.end: ; preds = %for.body, %entry