; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py ; RUN: opt -disable-output -passes='print' %s 2>&1 | FileCheck %s --check-prefixes=CHECK,FULLDEPTH ; RUN: opt -disable-output -passes='print' -max-forked-scev-depth=2 %s 2>&1 | FileCheck %s --check-prefixes=CHECK,DEPTH2 define void @laa_common_output(ptr %Base, ptr %Dest, ptr %Preds) { ; CHECK-LABEL: 'laa_common_output' ; CHECK-NEXT: for.body: ; CHECK-NEXT: Report: cannot identify array bounds ; CHECK-NEXT: Dependences: ; CHECK-NEXT: Run-time memory checks: ; CHECK-NEXT: Grouped accesses: ; CHECK-EMPTY: ; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop. ; CHECK-NEXT: SCEV assumptions: ; CHECK-EMPTY: ; CHECK-NEXT: Expressions re-written: ; entry: br label %for.body for.cond.cleanup: ; preds = %for.body ret void for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] %i.014 = phi i32 [ 0, %entry ], [ %add, %for.body ] %arrayidx = getelementptr inbounds i32, ptr %Preds, i64 %indvars.iv %0 = load i32, ptr %arrayidx, align 4 %cmp1.not = icmp eq i32 %0, 0 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %add = add nuw nsw i32 %i.014, 1 %1 = trunc i64 %indvars.iv to i32 %offset.0 = select i1 %cmp1.not, i32 %add, i32 %1 %idxprom213 = zext i32 %offset.0 to i64 %arrayidx3 = getelementptr inbounds float, ptr %Base, i64 %idxprom213 %2 = load float, ptr %arrayidx3, align 4 %arrayidx5 = getelementptr inbounds float, ptr %Dest, i64 %indvars.iv store float %2, ptr %arrayidx5, align 4 %exitcond.not = icmp eq i64 %indvars.iv.next, 100 br i1 %exitcond.not, label %for.cond.cleanup, label %for.body } define void @laa_divergent_output(ptr %Base, ptr %Dest, ptr %Preds, i64 %extra_offset) { ; FULLDEPTH-LABEL: 'laa_divergent_output' ; FULLDEPTH-NEXT: for.body: ; FULLDEPTH-NEXT: Memory dependences are safe with run-time checks ; FULLDEPTH-NEXT: Dependences: ; FULLDEPTH-NEXT: Run-time memory checks: ; FULLDEPTH-NEXT: Check 0: ; FULLDEPTH-NEXT: Comparing group GRP0: ; FULLDEPTH-NEXT: %arrayidx5 = getelementptr inbounds float, ptr %Dest, i64 %indvars.iv ; FULLDEPTH-NEXT: Against group GRP1: ; FULLDEPTH-NEXT: %arrayidx = getelementptr inbounds i32, ptr %Preds, i64 %indvars.iv ; FULLDEPTH-NEXT: Check 1: ; FULLDEPTH-NEXT: Comparing group GRP0: ; FULLDEPTH-NEXT: %arrayidx5 = getelementptr inbounds float, ptr %Dest, i64 %indvars.iv ; FULLDEPTH-NEXT: Against group GRP2: ; FULLDEPTH-NEXT: %arrayidx3 = getelementptr inbounds float, ptr %Base, i64 %offset ; FULLDEPTH-NEXT: %arrayidx3 = getelementptr inbounds float, ptr %Base, i64 %offset ; FULLDEPTH-NEXT: Grouped accesses: ; FULLDEPTH-NEXT: Group GRP0: ; FULLDEPTH-NEXT: (Low: %Dest High: (400 + %Dest)) ; FULLDEPTH-NEXT: Member: {%Dest,+,4}<%for.body> ; FULLDEPTH-NEXT: Group GRP1: ; FULLDEPTH-NEXT: (Low: %Preds High: (400 + %Preds)) ; FULLDEPTH-NEXT: Member: {%Preds,+,4}<%for.body> ; FULLDEPTH-NEXT: Group GRP2: ; FULLDEPTH-NEXT: (Low: ((4 * %extra_offset) + %Base) High: (404 + (4 * %extra_offset) + %Base)) ; FULLDEPTH-NEXT: Member: {(4 + (4 * %extra_offset) + %Base),+,4}<%for.body> ; FULLDEPTH-NEXT: Member: {((4 * %extra_offset) + %Base),+,4}<%for.body> ; FULLDEPTH-EMPTY: ; FULLDEPTH-NEXT: Non vectorizable stores to invariant address were not found in loop. ; FULLDEPTH-NEXT: SCEV assumptions: ; FULLDEPTH-EMPTY: ; FULLDEPTH-NEXT: Expressions re-written: ; ; DEPTH2-LABEL: 'laa_divergent_output' ; DEPTH2-NEXT: for.body: ; DEPTH2-NEXT: Report: cannot identify array bounds ; DEPTH2-NEXT: Dependences: ; DEPTH2-NEXT: Run-time memory checks: ; DEPTH2-NEXT: Grouped accesses: ; DEPTH2-EMPTY: ; DEPTH2-NEXT: Non vectorizable stores to invariant address were not found in loop. ; DEPTH2-NEXT: SCEV assumptions: ; DEPTH2-EMPTY: ; DEPTH2-NEXT: Expressions re-written: ; entry: br label %for.body for.cond.cleanup: ; preds = %for.body ret void for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] %arrayidx = getelementptr inbounds i32, ptr %Preds, i64 %indvars.iv %0 = load i32, ptr %arrayidx, align 4 %cmp.not = icmp eq i32 %0, 0 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %sel = select i1 %cmp.not, i64 %indvars.iv.next, i64 %indvars.iv %offset = add nuw nsw i64 %sel, %extra_offset %arrayidx3 = getelementptr inbounds float, ptr %Base, i64 %offset %1 = load float, ptr %arrayidx3, align 4 %arrayidx5 = getelementptr inbounds float, ptr %Dest, i64 %indvars.iv store float %1, ptr %arrayidx5, align 4 %exitcond.not = icmp eq i64 %indvars.iv.next, 100 br i1 %exitcond.not, label %for.cond.cleanup, label %for.body }