1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mcpu=pwr8 -mtriple=powerpc64le-unknown-unknown \
3 ; RUN: -verify-machineinstrs < %s | FileCheck %s
4 define signext i32 @test(i32* noalias %PtrA, i32* noalias %PtrB, i32 signext %LenA, i32 signext %LenB) #0 {
13 block2: ; preds = %entry
16 block3: ; preds = %block8, %block2
17 %OuterInd.0 = phi i32 [ 0, %block2 ], [ %inc, %block8 ]
18 %InnerInd.0 = phi i32 [ 0, %block2 ], [ %inc1, %block8 ]
19 %inc = add nsw i32 %OuterInd.0, 1
22 block4: ; preds = %if.then4, %block3
23 %InnerInd.1 = phi i32 [ %InnerInd.0, %block3 ], [ %inc1, %if.then4 ]
24 %cmp = icmp sge i32 %inc, %LenA
25 br i1 %cmp, label %if.then, label %if.end
27 if.then: ; preds = %block4
28 %sub = sub nsw i32 %inc, 1
29 %idxprom = sext i32 %sub to i64
30 %arrayidx = getelementptr inbounds i32, i32* %PtrA, i64 %idxprom
31 %0 = load i32, i32* %arrayidx, align 4
34 if.end: ; preds = %block4
37 block5: ; preds = %if.end
38 %inc1 = add nsw i32 %InnerInd.1, 1
39 %idxprom2 = sext i32 %InnerInd.1 to i64
40 %arrayidx3 = getelementptr inbounds i32, i32* %PtrB, i64 %idxprom2
41 %1 = load i32, i32* %arrayidx3, align 4
42 %tobool = icmp ne i32 %1, 0
43 br i1 %tobool, label %if.then4, label %if.end9
45 if.then4: ; preds = %block5
46 %idxprom5 = sext i32 %inc to i64
47 %arrayidx6 = getelementptr inbounds i32, i32* %PtrA, i64 %idxprom5
48 %2 = load i32, i32* %arrayidx6, align 4
49 %idxprom7 = sext i32 %inc1 to i64
50 %arrayidx8 = getelementptr inbounds i32, i32* %PtrB, i64 %idxprom7
51 store i32 %2, i32* %arrayidx8, align 4
54 if.end9: ; preds = %block5
57 block6: ; preds = %if.end9
58 %idxprom10 = sext i32 %inc to i64
59 %arrayidx11 = getelementptr inbounds i32, i32* %PtrA, i64 %idxprom10
60 %3 = load i32, i32* %arrayidx11, align 4
61 %inc12 = add nsw i32 %3, 1
62 store i32 %inc12, i32* %arrayidx11, align 4
65 block8: ; preds = %block6