44 lines · plain
1; REQUIRES: asserts2; RUN: opt -passes=loop-distribute -enable-loop-distribute \3; RUN: -debug-only=loop-distribute -disable-output 2>&1 %s | FileCheck %s4 5define void @f(ptr noalias %a, ptr noalias %b, ptr noalias %c, ptr noalias %d, i64 %stride) {6; CHECK-LABEL: LDist: Checking a loop in 'f' from f.c:5:27entry:8 br label %for.body9 10for.body: ; preds = %for.body, %entry11 %ind = phi i64 [ 0, %entry ], [ %add, %for.body ]12 %gep.a = getelementptr inbounds i32, ptr %a, i64 %ind13 %load.a = load i32, ptr %gep.a, align 414 %gep.b = getelementptr inbounds i32, ptr %b, i64 %ind15 %load.b = load i32, ptr %gep.b, align 416 %mul.a = mul i32 %load.b, %load.a17 %add = add nuw nsw i64 %ind, 118 %gep.a.plus4 = getelementptr inbounds i32, ptr %a, i64 %add19 store i32 %mul.a, ptr %gep.a.plus4, align 420 %gep.d = getelementptr inbounds i32, ptr %d, i64 %ind21 %loadD = load i32, ptr %gep.d, align 422 %mul = mul i64 %ind, %stride23 %gep.strided.a = getelementptr inbounds i32, ptr %a, i64 %mul24 %load.strided.a = load i32, ptr %gep.strided.a, align 425 %mul.c = mul i32 %loadD, %load.strided.a26 %gep.c = getelementptr inbounds i32, ptr %c, i64 %ind27 store i32 %mul.c, ptr %gep.c, align 428 %exitcond = icmp eq i64 %add, 2029 br i1 %exitcond, label %exit, label %for.body, !dbg !230 31exit: ; preds = %for.body32 ret void33}34 35!llvm.module.flags = !{!5, !6, !7}36 37!0 = !DIFile(filename: "f.c", directory: "/")38!1 = distinct !DISubprogram(name: "f", scope: !0, file: !0, unit: !4)39!2 = !DILocation(line: 5, column: 2, scope: !1)40!4 = distinct !DICompileUnit(language: DW_LANG_C99, file: !0, producer: "clang")41!5 = !{i32 1, !"Debug Info Version", i32 3}42!6 = !{i32 2, !"Dwarf Version", i32 2}43!7 = !{i32 1, !"PIC Level", i32 2}44