1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=powerpc64le-unknown-unknown -mcpu=pwr8 \
3 ; RUN: -ppc-convert-rr-to-ri -verify-machineinstrs | FileCheck %s
4 define void @test(i32 zeroext %parts) {
6 ; CHECK: # %bb.0: # %entry
7 ; CHECK-NEXT: cmplwi 0, 3, 1
9 ; CHECK-NEXT: # %bb.1: # %test2.exit.us.unr-lcssa
10 ; CHECK-NEXT: ld 3, 0(3)
11 ; CHECK-NEXT: std 3, 0(3)
15 cond.end.i: ; preds = %entry
16 %cmp18.i = icmp eq i32 %parts, 1
17 br i1 %cmp18.i, label %while.body.lr.ph.i.us.preheader, label %test3.exit.split
19 while.body.lr.ph.i.us.preheader: ; preds = %cond.end.i
20 %0 = icmp eq i32 %parts, 1
21 br label %for.body.i62.us.preheader
23 for.body.i62.us.preheader: ; preds = %while.body.lr.ph.i.us.preheader
24 br i1 %0, label %test2.exit.us.unr-lcssa, label %for.body.i62.us.preheader.new
26 for.body.i62.us.preheader.new: ; preds = %for.body.i62.us.preheader
27 br label %for.body.i62.us
29 for.body.i62.us: ; preds = %if.end.i.us.1, %for.body.i62.us.preheader.new
30 %niter = phi i64 [ undef, %for.body.i62.us.preheader.new ], [ %niter.nsub.1, %if.end.i.us.1 ]
31 %cmp8.i.us.1 = icmp uge i64 undef, 0
32 br label %if.end.i.us.1
34 test2.exit.us.unr-lcssa: ; preds = %if.end.i.us.1, %for.body.i62.us.preheader
35 %c.addr.036.i.us.unr = phi i64 [ 0, %for.body.i62.us.preheader ], [ %c.addr.1.i.us.1, %if.end.i.us.1 ]
36 %1 = load i64, i64* undef, align 8
37 %tobool.i61.us.epil = icmp eq i64 %c.addr.036.i.us.unr, 0
38 %add.neg.i.us.epil.pn = select i1 %tobool.i61.us.epil, i64 %1, i64 0
39 %storemerge269 = sub i64 %add.neg.i.us.epil.pn, 0
40 store i64 %storemerge269, i64* undef, align 8
43 test3.exit.split: ; preds = %cond.end.i
46 if.end.i.us.1: ; preds = %for.body.i62.us
47 %c.addr.1.i.us.1 = zext i1 %cmp8.i.us.1 to i64
48 %niter.nsub.1 = add i64 %niter, -2
49 %niter.ncmp.1 = icmp eq i64 %niter.nsub.1, 0
50 br i1 %niter.ncmp.1, label %test2.exit.us.unr-lcssa, label %for.body.i62.us