1 ; RUN: opt < %s -passes=loop-interchange -cache-line-size=64 -pass-remarks-missed='loop-interchange' -pass-remarks-output=%t -S \
2 ; RUN: -verify-dom-info -verify-loop-info -verify-loop-lcssa 2>&1
3 ; RUN: FileCheck --input-file=%t --check-prefix=REMARKS %s
6 ; REMARKS-NEXT: Pass: loop-interchange
7 ; REMARKS-NEXT: Name: Interchanged
8 ; REMARKS-NEXT: Function: pr48212
10 define void @pr48212(ptr %filter) {
17 for.body: ; preds = %L1, %for.inc6
18 %temp.04 = phi i32 [ undef, %L1 ], [ %temp.1.lcssa, %for.inc6 ]
19 %k1.03 = phi i32 [ 0, %L1 ], [ %inc7, %for.inc6 ]
22 L2: ; preds = %for.body
25 for.body3: ; preds = %L2, %for.inc
26 %temp.12 = phi i32 [ %temp.04, %L2 ], [ %add, %for.inc ]
27 %k2.01 = phi i32 [ 0, %L2 ], [ %inc, %for.inc ]
28 %idxprom = sext i32 %k2.01 to i64
29 %arrayidx = getelementptr inbounds [5 x i32], ptr %filter, i64 %idxprom
30 %idxprom4 = sext i32 %k1.03 to i64
31 %arrayidx5 = getelementptr inbounds [5 x i32], ptr %arrayidx, i64 0, i64 %idxprom4
32 %0 = load i32, ptr %arrayidx5
33 %add = add nsw i32 %temp.12, %0
36 for.inc: ; preds = %for.body3
37 %inc = add nsw i32 %k2.01, 1
38 %cmp2 = icmp slt i32 %inc, 3
39 br i1 %cmp2, label %for.body3, label %for.end
41 for.end: ; preds = %for.inc
42 %temp.1.lcssa = phi i32 [ %add, %for.inc ]
45 for.inc6: ; preds = %for.end
46 %inc7 = add nsw i32 %k1.03, 1
47 %cmp = icmp slt i32 %inc7, 5
48 br i1 %cmp, label %for.body, label %for.end8
50 for.end8: ; preds = %for.inc6