88 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 52; RUN: opt -passes='print<access-info>' -disable-output 2>&1 < %s | FileCheck %s3 4define void @test(ptr noalias %x, ptr noalias %y, ptr noalias %z) {5; CHECK-LABEL: 'test'6; CHECK-NEXT: loop:7; CHECK-NEXT: Report: unsafe dependent memory operations in loop. Use #pragma clang loop distribute(enable) to allow loop distribution to attempt to isolate the offending operations into a separate loop8; CHECK-NEXT: Unsafe indirect dependence.9; CHECK-NEXT: Dependences:10; CHECK-NEXT: IndirectUnsafe:11; CHECK-NEXT: %load = load double, ptr %gep.sel, align 8 ->12; CHECK-NEXT: store double %load, ptr %gep.sel2, align 813; CHECK-EMPTY:14; CHECK-NEXT: Run-time memory checks:15; CHECK-NEXT: Grouped accesses:16; CHECK-EMPTY:17; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.18; CHECK-NEXT: SCEV assumptions:19; CHECK-EMPTY:20; CHECK-NEXT: Expressions re-written:21;22entry:23 %gep.y = getelementptr double, ptr %y, i64 -3224 br label %loop25 26loop:27 %iv = phi i64 [ %iv.next, %loop ], [ 0, %entry ]28 %icmp = icmp ule i64 %iv, 3229 %sel = select i1 %icmp, ptr %x, ptr %gep.y30 %gep.sel = getelementptr inbounds double, ptr %sel, i64 %iv31 %load = load double, ptr %gep.sel, align 832 %sel2 = select i1 %icmp, ptr %y, ptr %z33 %gep.sel2 = getelementptr inbounds double, ptr %sel2, i64 %iv34 store double %load, ptr %gep.sel2, align 835 %iv.next = add nuw nsw i64 %iv, 136 %exit.cond = icmp eq i64 %iv, 9437 br i1 %exit.cond, label %exit, label %loop38 39exit:40 ret void41}42 43; Same as previous test, but with selects replaced by phis in the same block.44define void @test_phi(ptr noalias %x, ptr noalias %y, ptr noalias %z) {45; CHECK-LABEL: 'test_phi'46; CHECK-NEXT: loop:47; CHECK-NEXT: Report: unsafe dependent memory operations in loop. Use #pragma clang loop distribute(enable) to allow loop distribution to attempt to isolate the offending operations into a separate loop48; CHECK-NEXT: Unsafe indirect dependence.49; CHECK-NEXT: Dependences:50; CHECK-NEXT: IndirectUnsafe:51; CHECK-NEXT: %load = load double, ptr %gep.sel, align 8 ->52; CHECK-NEXT: store double %load, ptr %gep.sel2, align 853; CHECK-EMPTY:54; CHECK-NEXT: Run-time memory checks:55; CHECK-NEXT: Grouped accesses:56; CHECK-EMPTY:57; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.58; CHECK-NEXT: SCEV assumptions:59; CHECK-EMPTY:60; CHECK-NEXT: Expressions re-written:61;62entry:63 %gep.y = getelementptr double, ptr %y, i64 -3264 br label %loop65 66loop:67 %iv = phi i64 [ %iv.next, %latch ], [ 0, %entry ]68 %icmp = icmp ule i64 %iv, 3269 br i1 %icmp, label %if, label %latch70 71if:72 br label %latch73 74latch:75 %sel = phi ptr [ %x, %if ], [ %gep.y, %loop ]76 %sel2 = phi ptr [ %y, %if ], [ %z, %loop ]77 %gep.sel = getelementptr inbounds double, ptr %sel, i64 %iv78 %load = load double, ptr %gep.sel, align 879 %gep.sel2 = getelementptr inbounds double, ptr %sel2, i64 %iv80 store double %load, ptr %gep.sel2, align 881 %iv.next = add nuw nsw i64 %iv, 182 %exit.cond = icmp eq i64 %iv, 9483 br i1 %exit.cond, label %exit, label %loop84 85exit:86 ret void87}88