|
19 | 19 | ; 10 A[i] = B[i] * C[i]; |
20 | 20 | ; 11 } |
21 | 21 | ; 12 } |
| 22 | +; 13 |
| 23 | +; 14 void success (char *A, char *B, char *C, char *D, char *E, int N) { |
| 24 | +; 15 for(int i = 0; i < N; i++) { |
| 25 | +; 16 A[i + 1] = A[i] + B[i]; |
| 26 | +; 17 C[i] = D[i] * E[i]; |
| 27 | +; 18 } |
| 28 | +; 19 } |
22 | 29 |
|
23 | 30 | target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" |
24 | 31 | target triple = "x86_64-apple-macosx10.11.0" |
@@ -84,6 +91,41 @@ for.cond.cleanup: |
84 | 91 | ret void, !dbg !25 |
85 | 92 | } |
86 | 93 |
|
| 94 | +; REMARKS: remark: /tmp/t.c:15:3: distributed loop |
| 95 | + |
| 96 | +define void @success(i8* %A, i8* %B, i8* %C, i8* %D, i8* %E, i32 %N) !dbg !31 { |
| 97 | +entry: |
| 98 | + %cmp28 = icmp sgt i32 %N, 0, !dbg !32 |
| 99 | + br i1 %cmp28, label %ph, label %for.cond.cleanup, !dbg !33 |
| 100 | + |
| 101 | +ph: |
| 102 | + br label %for.body |
| 103 | + |
| 104 | +for.body: |
| 105 | + %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %ph ] |
| 106 | + %arrayidx = getelementptr inbounds i8, i8* %A, i64 %indvars.iv, !dbg !35 |
| 107 | + %0 = load i8, i8* %arrayidx, align 1, !dbg !35, !tbaa !13 |
| 108 | + %arrayidx2 = getelementptr inbounds i8, i8* %B, i64 %indvars.iv, !dbg !36 |
| 109 | + %1 = load i8, i8* %arrayidx2, align 1, !dbg !36, !tbaa !13 |
| 110 | + %add = add i8 %1, %0, !dbg !37 |
| 111 | + %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1, !dbg !33 |
| 112 | + %arrayidx7 = getelementptr inbounds i8, i8* %A, i64 %indvars.iv.next, !dbg !38 |
| 113 | + store i8 %add, i8* %arrayidx7, align 1, !dbg !39, !tbaa !13 |
| 114 | + %arrayidx9 = getelementptr inbounds i8, i8* %D, i64 %indvars.iv, !dbg !40 |
| 115 | + %2 = load i8, i8* %arrayidx9, align 1, !dbg !40, !tbaa !13 |
| 116 | + %arrayidx12 = getelementptr inbounds i8, i8* %E, i64 %indvars.iv, !dbg !41 |
| 117 | + %3 = load i8, i8* %arrayidx12, align 1, !dbg !41, !tbaa !13 |
| 118 | + %mul = mul i8 %3, %2, !dbg !42 |
| 119 | + %arrayidx16 = getelementptr inbounds i8, i8* %C, i64 %indvars.iv, !dbg !43 |
| 120 | + store i8 %mul, i8* %arrayidx16, align 1, !dbg !44, !tbaa !13 |
| 121 | + %lftr.wideiv = trunc i64 %indvars.iv.next to i32, !dbg !33 |
| 122 | + %exitcond = icmp eq i32 %lftr.wideiv, %N, !dbg !33 |
| 123 | + br i1 %exitcond, label %for.cond.cleanup, label %for.body, !dbg !33 |
| 124 | + |
| 125 | +for.cond.cleanup: |
| 126 | + ret void, !dbg !34 |
| 127 | +} |
| 128 | + |
87 | 129 | !llvm.dbg.cu = !{!0} |
88 | 130 | !llvm.module.flags = !{!3, !4} |
89 | 131 |
|
@@ -116,3 +158,17 @@ for.cond.cleanup: |
116 | 158 | !28 = !DILocation(line: 10, column: 17, scope: !22) |
117 | 159 | !29 = !DILocation(line: 10, column: 5, scope: !22) |
118 | 160 | !30 = !DILocation(line: 10, column: 10, scope: !22) |
| 161 | +!31 = distinct !DISubprogram(name: "success", scope: !1, file: !1, line: 14, type: !8, isLocal: false, isDefinition: true, scopeLine: 14, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !2) |
| 162 | +!32 = !DILocation(line: 15, column: 20, scope: !31) |
| 163 | +!33 = !DILocation(line: 15, column: 3, scope: !31) |
| 164 | +!34 = !DILocation(line: 19, column: 1, scope: !31) |
| 165 | +!35 = !DILocation(line: 16, column: 16, scope: !31) |
| 166 | +!36 = !DILocation(line: 16, column: 23, scope: !31) |
| 167 | +!37 = !DILocation(line: 16, column: 21, scope: !31) |
| 168 | +!38 = !DILocation(line: 16, column: 5, scope: !31) |
| 169 | +!39 = !DILocation(line: 16, column: 14, scope: !31) |
| 170 | +!40 = !DILocation(line: 17, column: 12, scope: !31) |
| 171 | +!41 = !DILocation(line: 17, column: 19, scope: !31) |
| 172 | +!42 = !DILocation(line: 17, column: 17, scope: !31) |
| 173 | +!43 = !DILocation(line: 17, column: 5, scope: !31) |
| 174 | +!44 = !DILocation(line: 17, column: 10, scope: !31) |
0 commit comments