178 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 42; RUN: opt -passes='print<access-info>' -disable-output %s 2>&1 | FileCheck %s3 4target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"5 6define void @forward_dep_known_safe_due_to_backedge_taken_count(ptr %A) {7; CHECK-LABEL: 'forward_dep_known_safe_due_to_backedge_taken_count'8; CHECK-NEXT: loop:9; CHECK-NEXT: Memory dependences are safe10; CHECK-NEXT: Dependences:11; CHECK-NEXT: Run-time memory checks:12; CHECK-NEXT: Grouped accesses:13; CHECK-EMPTY:14; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.15; CHECK-NEXT: SCEV assumptions:16; CHECK-EMPTY:17; CHECK-NEXT: Expressions re-written:18;19entry:20 %A.511= getelementptr inbounds i32, ptr %A, i64 51121 br label %loop22 23loop:24 %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ]25 %iv.mul.2 = shl nuw nsw i64 %iv, 126 %gep.mul.2 = getelementptr inbounds i32, ptr %A.511, i64 %iv.mul.227 %l = load i32, ptr %gep.mul.2, align 428 %add = add nsw i32 %l, 529 %gep = getelementptr inbounds i32, ptr %A, i64 %iv30 store i32 %add, ptr %gep, align 431 %iv.next = add nuw nsw i64 %iv, 132 %exitcond.not = icmp eq i64 %iv.next, 25633 br i1 %exitcond.not, label %exit, label %loop34 35exit:36 ret void37}38 39define void @forward_dep_not_known_safe_due_to_backedge_taken_count(ptr %A) {40; CHECK-LABEL: 'forward_dep_not_known_safe_due_to_backedge_taken_count'41; CHECK-NEXT: loop:42; CHECK-NEXT: Memory dependences are safe43; CHECK-NEXT: Dependences:44; CHECK-NEXT: Forward:45; CHECK-NEXT: %l = load i32, ptr %gep.mul.2, align 4 ->46; CHECK-NEXT: store i32 %add, ptr %gep, align 447; CHECK-EMPTY:48; CHECK-NEXT: Run-time memory checks:49; CHECK-NEXT: Grouped accesses:50; CHECK-EMPTY:51; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.52; CHECK-NEXT: SCEV assumptions:53; CHECK-EMPTY:54; CHECK-NEXT: Expressions re-written:55;56entry:57 %A.510 = getelementptr inbounds i32, ptr %A, i64 51058 br label %loop59 60loop:61 %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ]62 %iv.mul.2 = shl nuw nsw i64 %iv, 163 %gep.mul.2 = getelementptr inbounds i32, ptr %A.510, i64 %iv.mul.264 %l = load i32, ptr %gep.mul.2, align 465 %add = add nsw i32 %l, 566 %gep = getelementptr inbounds i32, ptr %A, i64 %iv67 store i32 %add, ptr %gep, align 468 %iv.next = add nuw nsw i64 %iv, 169 %exitcond.not = icmp eq i64 %iv.next, 25670 br i1 %exitcond.not, label %exit, label %loop71 72exit:73 ret void74}75 76define void @unknown_dep_known_safe_due_to_backedge_taken_count(ptr %A) {77; CHECK-LABEL: 'unknown_dep_known_safe_due_to_backedge_taken_count'78; CHECK-NEXT: loop:79; CHECK-NEXT: Memory dependences are safe80; CHECK-NEXT: Dependences:81; CHECK-NEXT: Run-time memory checks:82; CHECK-NEXT: Grouped accesses:83; CHECK-EMPTY:84; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.85; CHECK-NEXT: SCEV assumptions:86; CHECK-EMPTY:87; CHECK-NEXT: Expressions re-written:88;89entry:90 %A.511 = getelementptr inbounds i32, ptr %A, i64 51191 br label %loop92 93loop:94 %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ]95 %iv.mul.2 = shl nuw nsw i64 %iv, 196 %gep = getelementptr inbounds i32, ptr %A, i64 %iv97 %l = load i32, ptr %gep, align 498 %add = add nsw i32 %l, 599 %gep.mul.2 = getelementptr inbounds i32, ptr %A.511, i64 %iv.mul.2100 store i32 %add, ptr %gep.mul.2, align 4101 %iv.next = add nuw nsw i64 %iv, 1102 %exitcond.not = icmp eq i64 %iv.next, 256103 br i1 %exitcond.not, label %exit, label %loop104 105exit:106 ret void107}108 109define void @backward_dep_known_safe_due_to_backedge_taken_count(ptr %A) {110; CHECK-LABEL: 'backward_dep_known_safe_due_to_backedge_taken_count'111; CHECK-NEXT: loop:112; CHECK-NEXT: Memory dependences are safe113; CHECK-NEXT: Dependences:114; CHECK-NEXT: Run-time memory checks:115; CHECK-NEXT: Grouped accesses:116; CHECK-EMPTY:117; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.118; CHECK-NEXT: SCEV assumptions:119; CHECK-EMPTY:120; CHECK-NEXT: Expressions re-written:121;122entry:123 %A.510 = getelementptr inbounds i32, ptr %A, i64 510124 br label %loop125 126loop:127 %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ]128 %iv.mul.2 = shl nuw nsw i64 %iv, 1129 %gep = getelementptr inbounds i32, ptr %A, i64 %iv130 %l = load i32, ptr %gep, align 4131 %add = add nsw i32 %l, 5132 %gep.mul.2 = getelementptr inbounds i32, ptr %A.510, i64 %iv.mul.2133 store i32 %add, ptr %gep.mul.2, align 4134 %iv.next = add nuw nsw i64 %iv, 1135 %exitcond.not = icmp eq i64 %iv.next, 256136 br i1 %exitcond.not, label %exit, label %loop137 138exit:139 ret void140}141 142define void @backward_dep_known_distance_less_than_btc(ptr %A) {143; CHECK-LABEL: 'backward_dep_known_distance_less_than_btc'144; CHECK-NEXT: loop:145; CHECK-NEXT: Memory dependences are safe with a maximum safe vector width of 4064 bits146; CHECK-NEXT: Dependences:147; CHECK-NEXT: BackwardVectorizable:148; CHECK-NEXT: %l = load i32, ptr %gep, align 4 ->149; CHECK-NEXT: store i32 %add, ptr %gep.mul.2, align 4150; CHECK-EMPTY:151; CHECK-NEXT: Run-time memory checks:152; CHECK-NEXT: Grouped accesses:153; CHECK-EMPTY:154; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.155; CHECK-NEXT: SCEV assumptions:156; CHECK-EMPTY:157; CHECK-NEXT: Expressions re-written:158;159entry:160 %A.510 = getelementptr inbounds i32, ptr %A, i64 510161 br label %loop162 163loop:164 %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ]165 %iv.mul.2 = shl nuw nsw i64 %iv, 1166 %gep = getelementptr inbounds i32, ptr %A, i64 %iv.mul.2167 %l = load i32, ptr %gep, align 4168 %add = add nsw i32 %l, 5169 %gep.mul.2 = getelementptr inbounds i32, ptr %A.510, i64 %iv170 store i32 %add, ptr %gep.mul.2, align 4171 %iv.next = add nuw nsw i64 %iv, 1172 %exitcond.not = icmp eq i64 %iv.next, 256173 br i1 %exitcond.not, label %exit, label %loop174 175exit:176 ret void177}178