1 ; RUN: opt -passes=loop-distribute -enable-loop-distribute -verify-loop-info -verify-dom-info -S < %s | FileCheck %s
3 ; Check that the disable_nonforced is honored by loop distribution.
6 define void @disable_nonforced(ptr noalias %a, ptr noalias %b, ptr noalias %c, ptr noalias %d, ptr noalias %e) {
7 ; CHECK-LABEL: @disable_nonforced(
8 ; CHECK-NOT: for.body.ldist1:
13 %ind = phi i64 [ 0, %entry ], [ %add, %for.body ]
15 %arrayidxA = getelementptr inbounds i32, ptr %a, i64 %ind
16 %loadA = load i32, ptr %arrayidxA, align 4
18 %arrayidxB = getelementptr inbounds i32, ptr %b, i64 %ind
19 %loadB = load i32, ptr %arrayidxB, align 4
21 %mulA = mul i32 %loadB, %loadA
23 %add = add nuw nsw i64 %ind, 1
24 %arrayidxA_plus_4 = getelementptr inbounds i32, ptr %a, i64 %add
25 store i32 %mulA, ptr %arrayidxA_plus_4, align 4
27 %arrayidxD = getelementptr inbounds i32, ptr %d, i64 %ind
28 %loadD = load i32, ptr %arrayidxD, align 4
30 %arrayidxE = getelementptr inbounds i32, ptr %e, i64 %ind
31 %loadE = load i32, ptr %arrayidxE, align 4
33 %mulC = mul i32 %loadD, %loadE
35 %arrayidxC = getelementptr inbounds i32, ptr %c, i64 %ind
36 store i32 %mulC, ptr %arrayidxC, align 4
38 %exitcond = icmp eq i64 %add, 20
39 br i1 %exitcond, label %for.end, label %for.body, !llvm.loop !0
45 !0 = distinct !{!0, !{!"llvm.loop.disable_nonforced"}}