1 ; RUN: opt -passes=loop-distribute -verify-loop-info -verify-dom-info -S < %s | FileCheck %s
3 ; Check that llvm.loop.distribute.enable overrides
4 ; llvm.loop.disable_nonforced.
7 define void @disable_nonforced(ptr noalias %a, ptr noalias %b, ptr noalias %c, ptr noalias %d, ptr noalias %e) {
8 ; CHECK-LABEL: @disable_nonforced(
9 ; CHECK: for.body.ldist1:
14 %ind = phi i64 [ 0, %entry ], [ %add, %for.body ]
16 %arrayidxA = getelementptr inbounds i32, ptr %a, i64 %ind
17 %loadA = load i32, ptr %arrayidxA, align 4
19 %arrayidxB = getelementptr inbounds i32, ptr %b, i64 %ind
20 %loadB = load i32, ptr %arrayidxB, align 4
22 %mulA = mul i32 %loadB, %loadA
24 %add = add nuw nsw i64 %ind, 1
25 %arrayidxA_plus_4 = getelementptr inbounds i32, ptr %a, i64 %add
26 store i32 %mulA, ptr %arrayidxA_plus_4, align 4
28 %arrayidxD = getelementptr inbounds i32, ptr %d, i64 %ind
29 %loadD = load i32, ptr %arrayidxD, align 4
31 %arrayidxE = getelementptr inbounds i32, ptr %e, i64 %ind
32 %loadE = load i32, ptr %arrayidxE, align 4
34 %mulC = mul i32 %loadD, %loadE
36 %arrayidxC = getelementptr inbounds i32, ptr %c, i64 %ind
37 store i32 %mulC, ptr %arrayidxC, align 4
39 %exitcond = icmp eq i64 %add, 20
40 br i1 %exitcond, label %for.end, label %for.body, !llvm.loop !0
46 !0 = distinct !{!0, !{!"llvm.loop.disable_nonforced"}, !{!"llvm.loop.distribute.enable", i32 1}}