380 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><allow-partial>' -disable-output %s 2>&1 | FileCheck %s3 4target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"5 6declare void @llvm.assume(i1)7 8define void @different_non_constant_strides_known_backward(ptr %A) {9; CHECK-LABEL: 'different_non_constant_strides_known_backward'10; CHECK-NEXT: loop:11; 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 loop12; CHECK-NEXT: Unknown data dependence.13; CHECK-NEXT: Dependences:14; CHECK-NEXT: Unknown:15; CHECK-NEXT: %l = load i32, ptr %gep, align 4 ->16; CHECK-NEXT: store i32 %add, ptr %gep.mul.2, align 417; CHECK-EMPTY:18; CHECK-NEXT: Run-time memory checks:19; CHECK-NEXT: Grouped accesses:20; CHECK-EMPTY:21; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.22; CHECK-NEXT: SCEV assumptions:23; CHECK-EMPTY:24; CHECK-NEXT: Expressions re-written:25;26entry:27 br label %loop28 29loop:30 %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ]31 %gep = getelementptr inbounds i32, ptr %A, i64 %iv32 %l = load i32, ptr %gep, align 433 %add = add nsw i32 %l, 534 %iv.mul.2 = shl nuw nsw i64 %iv, 135 %gep.mul.2 = getelementptr inbounds i32, ptr %A, i64 %iv.mul.236 store i32 %add, ptr %gep.mul.2, align 437 %iv.next = add nuw nsw i64 %iv, 138 %exitcond.not = icmp eq i64 %iv.next, 25639 br i1 %exitcond.not, label %exit, label %loop40 41exit:42 ret void43}44 45define void @different_non_constant_strides_known_backward_distance_larger_than_trip_count(ptr %A) {46; CHECK-LABEL: 'different_non_constant_strides_known_backward_distance_larger_than_trip_count'47; CHECK-NEXT: loop:48; CHECK-NEXT: Memory dependences are safe49; CHECK-NEXT: Dependences:50; CHECK-NEXT: Run-time memory checks:51; CHECK-NEXT: Grouped accesses:52; CHECK-EMPTY:53; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.54; CHECK-NEXT: SCEV assumptions:55; CHECK-EMPTY:56; CHECK-NEXT: Expressions re-written:57;58entry:59 %A.1024 = getelementptr inbounds i8, ptr %A, i64 102460 br label %loop61 62loop:63 %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ]64 %gep = getelementptr inbounds i32, ptr %A, i64 %iv65 %l = load i32, ptr %gep, align 466 %add = add nsw i32 %l, 567 %iv.mul.2 = shl nuw nsw i64 %iv, 168 %gep.mul.2 = getelementptr inbounds i32, ptr %A.1024, i64 %iv.mul.269 store i32 %add, ptr %gep.mul.2, align 470 %iv.next = add nuw nsw i64 %iv, 171 %exitcond.not = icmp eq i64 %iv.next, 25672 br i1 %exitcond.not, label %exit, label %loop73 74exit:75 ret void76}77 78define void @different_non_constant_strides_known_backward_min_distance_16(ptr %A) {79; CHECK-LABEL: 'different_non_constant_strides_known_backward_min_distance_16'80; CHECK-NEXT: loop:81; CHECK-NEXT: Memory dependences are safe with a maximum safe vector width of 64 bits82; CHECK-NEXT: Dependences:83; CHECK-NEXT: BackwardVectorizable:84; CHECK-NEXT: %l = load i32, ptr %gep, align 4 ->85; CHECK-NEXT: store i32 %add, ptr %gep.mul.2, align 486; CHECK-EMPTY:87; CHECK-NEXT: Run-time memory checks:88; CHECK-NEXT: Grouped accesses:89; CHECK-EMPTY:90; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.91; CHECK-NEXT: SCEV assumptions:92; CHECK-EMPTY:93; CHECK-NEXT: Expressions re-written:94;95entry:96 %A.16 = getelementptr inbounds i8, ptr %A, i64 1697 br label %loop98 99loop:100 %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ]101 %gep = getelementptr inbounds i32, ptr %A, i64 %iv102 %l = load i32, ptr %gep, align 4103 %add = add nsw i32 %l, 5104 %iv.mul.2 = shl nuw nsw i64 %iv, 1105 %gep.mul.2 = getelementptr inbounds i32, ptr %A.16, i64 %iv.mul.2106 store i32 %add, ptr %gep.mul.2, align 4107 %iv.next = add nuw nsw i64 %iv, 1108 %exitcond.not = icmp eq i64 %iv.next, 256109 br i1 %exitcond.not, label %exit, label %loop110 111exit:112 ret void113}114 115define void @different_non_constant_strides_known_backward_min_distance_15(ptr %A) {116; CHECK-LABEL: 'different_non_constant_strides_known_backward_min_distance_15'117; CHECK-NEXT: loop:118; 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 loop119; CHECK-NEXT: Unknown data dependence.120; CHECK-NEXT: Dependences:121; CHECK-NEXT: Unknown:122; CHECK-NEXT: %l = load i32, ptr %gep, align 4 ->123; CHECK-NEXT: store i32 %add, ptr %gep.mul.2, align 4124; CHECK-EMPTY:125; CHECK-NEXT: Run-time memory checks:126; CHECK-NEXT: Grouped accesses:127; CHECK-EMPTY:128; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.129; CHECK-NEXT: SCEV assumptions:130; CHECK-EMPTY:131; CHECK-NEXT: Expressions re-written:132;133entry:134 %A.15 = getelementptr inbounds i8, ptr %A, i64 15135 br label %loop136 137loop:138 %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ]139 %gep = getelementptr inbounds i32, ptr %A, i64 %iv140 %l = load i32, ptr %gep, align 4141 %add = add nsw i32 %l, 5142 %iv.mul.2 = shl nuw nsw i64 %iv, 1143 %gep.mul.2 = getelementptr inbounds i32, ptr %A.15, i64 %iv.mul.2144 store i32 %add, ptr %gep.mul.2, align 4145 %iv.next = add nuw nsw i64 %iv, 1146 %exitcond.not = icmp eq i64 %iv.next, 256147 br i1 %exitcond.not, label %exit, label %loop148 149exit:150 ret void151}152 153define void @different_non_constant_strides_known_backward_min_distance_8(ptr %A) {154; CHECK-LABEL: 'different_non_constant_strides_known_backward_min_distance_8'155; CHECK-NEXT: loop:156; 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 loop157; CHECK-NEXT: Unknown data dependence.158; CHECK-NEXT: Dependences:159; CHECK-NEXT: Unknown:160; CHECK-NEXT: %l = load i32, ptr %gep, align 4 ->161; CHECK-NEXT: store i32 %add, ptr %gep.mul.2, align 4162; CHECK-EMPTY:163; CHECK-NEXT: Run-time memory checks:164; CHECK-NEXT: Grouped accesses:165; CHECK-EMPTY:166; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.167; CHECK-NEXT: SCEV assumptions:168; CHECK-EMPTY:169; CHECK-NEXT: Expressions re-written:170;171entry:172 %A.8 = getelementptr inbounds i8, ptr %A, i64 8173 br label %loop174 175loop:176 %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ]177 %gep = getelementptr inbounds i32, ptr %A, i64 %iv178 %l = load i32, ptr %gep, align 4179 %add = add nsw i32 %l, 5180 %iv.mul.2 = shl nuw nsw i64 %iv, 1181 %gep.mul.2 = getelementptr inbounds i32, ptr %A.8, i64 %iv.mul.2182 store i32 %add, ptr %gep.mul.2, align 4183 %iv.next = add nuw nsw i64 %iv, 1184 %exitcond.not = icmp eq i64 %iv.next, 256185 br i1 %exitcond.not, label %exit, label %loop186 187exit:188 ret void189}190 191define void @different_non_constant_strides_known_backward_min_distance_3(ptr %A) {192; CHECK-LABEL: 'different_non_constant_strides_known_backward_min_distance_3'193; CHECK-NEXT: loop:194; 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 loop195; CHECK-NEXT: Unknown data dependence.196; CHECK-NEXT: Dependences:197; CHECK-NEXT: Unknown:198; CHECK-NEXT: %l = load i32, ptr %gep, align 4 ->199; CHECK-NEXT: store i32 %add, ptr %gep.mul.2, align 4200; CHECK-EMPTY:201; CHECK-NEXT: Run-time memory checks:202; CHECK-NEXT: Grouped accesses:203; CHECK-EMPTY:204; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.205; CHECK-NEXT: SCEV assumptions:206; CHECK-EMPTY:207; CHECK-NEXT: Expressions re-written:208;209entry:210 %A.3 = getelementptr inbounds i8, ptr %A, i64 3211 br label %loop212 213loop:214 %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ]215 %gep = getelementptr inbounds i32, ptr %A, i64 %iv216 %l = load i32, ptr %gep, align 4217 %add = add nsw i32 %l, 5218 %iv.mul.2 = shl nuw nsw i64 %iv, 1219 %gep.mul.2 = getelementptr inbounds i32, ptr %A.3, i64 %iv.mul.2220 store i32 %add, ptr %gep.mul.2, align 4221 %iv.next = add nuw nsw i64 %iv, 1222 %exitcond.not = icmp eq i64 %iv.next, 256223 br i1 %exitcond.not, label %exit, label %loop224 225exit:226 ret void227}228 229define void @different_non_constant_strides_known_backward_via_assume(ptr %A, i64 %scale) {230; CHECK-LABEL: 'different_non_constant_strides_known_backward_via_assume'231; CHECK-NEXT: loop:232; CHECK-NEXT: Report: cannot identify array bounds233; CHECK-NEXT: Dependences:234; CHECK-NEXT: Run-time memory checks:235; CHECK-NEXT: Grouped accesses:236; CHECK-NEXT: Group GRP0:237; CHECK-NEXT: (Low: %A High: (1024 + %A))238; CHECK-NEXT: Member: {%A,+,4}<nuw><%loop>239; CHECK-NEXT: Generated run-time checks are incomplete240; CHECK-EMPTY:241; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.242; CHECK-NEXT: SCEV assumptions:243; CHECK-EMPTY:244; CHECK-NEXT: Expressions re-written:245;246entry:247 %c = icmp sgt i64 %scale, 0248 call void @llvm.assume(i1 %c)249 br label %loop250 251loop:252 %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ]253 %gep = getelementptr inbounds i32, ptr %A, i64 %iv254 %l = load i32, ptr %gep, align 4255 %add = add nsw i32 %l, 5256 %iv.mul.2 = shl nuw nsw i64 %iv, %scale257 %gep.mul.2 = getelementptr inbounds i32, ptr %A, i64 %iv.mul.2258 store i32 %add, ptr %gep.mul.2, align 4259 %iv.next = add nuw nsw i64 %iv, 1260 %exitcond.not = icmp eq i64 %iv.next, 256261 br i1 %exitcond.not, label %exit, label %loop262 263exit:264 ret void265}266 267define void @different_non_constant_strides_known_backward_via_assume_distance_larger_than_trip_count(ptr %A, i64 %scale) {268; CHECK-LABEL: 'different_non_constant_strides_known_backward_via_assume_distance_larger_than_trip_count'269; CHECK-NEXT: loop:270; CHECK-NEXT: Report: cannot identify array bounds271; CHECK-NEXT: Dependences:272; CHECK-NEXT: Run-time memory checks:273; CHECK-NEXT: Grouped accesses:274; CHECK-NEXT: Group GRP0:275; CHECK-NEXT: (Low: %A High: (1024 + %A)<nuw>)276; CHECK-NEXT: Member: {%A,+,4}<nuw><%loop>277; CHECK-NEXT: Generated run-time checks are incomplete278; CHECK-EMPTY:279; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.280; CHECK-NEXT: SCEV assumptions:281; CHECK-EMPTY:282; CHECK-NEXT: Expressions re-written:283;284entry:285 %A.1024 = getelementptr inbounds i8, ptr %A, i64 1024286 %c = icmp sgt i64 %scale, 0287 call void @llvm.assume(i1 %c)288 br label %loop289 290loop:291 %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ]292 %gep = getelementptr inbounds i32, ptr %A, i64 %iv293 %l = load i32, ptr %gep, align 4294 %add = add nsw i32 %l, 5295 %iv.mul.2 = shl nuw nsw i64 %iv, %scale296 %gep.mul.2 = getelementptr inbounds i32, ptr %A.1024, i64 %iv.mul.2297 store i32 %add, ptr %gep.mul.2, align 4298 %iv.next = add nuw nsw i64 %iv, 1299 %exitcond.not = icmp eq i64 %iv.next, 256300 br i1 %exitcond.not, label %exit, label %loop301 302exit:303 ret void304}305 306define void @different_non_constant_strides_known_backward_via_assume_min_distance_3(ptr %A, i64 %scale) {307; CHECK-LABEL: 'different_non_constant_strides_known_backward_via_assume_min_distance_3'308; CHECK-NEXT: loop:309; CHECK-NEXT: Report: cannot identify array bounds310; CHECK-NEXT: Dependences:311; CHECK-NEXT: Run-time memory checks:312; CHECK-NEXT: Grouped accesses:313; CHECK-NEXT: Group GRP0:314; CHECK-NEXT: (Low: %A High: (1024 + %A))315; CHECK-NEXT: Member: {%A,+,4}<nuw><%loop>316; CHECK-NEXT: Generated run-time checks are incomplete317; CHECK-EMPTY:318; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.319; CHECK-NEXT: SCEV assumptions:320; CHECK-EMPTY:321; CHECK-NEXT: Expressions re-written:322;323entry:324 %A.3 = getelementptr inbounds i8, ptr %A, i64 3325 %c = icmp sgt i64 %scale, 0326 call void @llvm.assume(i1 %c)327 br label %loop328 329loop:330 %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ]331 %gep = getelementptr inbounds i32, ptr %A, i64 %iv332 %l = load i32, ptr %gep, align 4333 %add = add nsw i32 %l, 5334 %iv.mul.2 = shl nuw nsw i64 %iv, %scale335 %gep.mul.2 = getelementptr inbounds i32, ptr %A.3, i64 %iv.mul.2336 store i32 %add, ptr %gep.mul.2, align 4337 %iv.next = add nuw nsw i64 %iv, 1338 %exitcond.not = icmp eq i64 %iv.next, 256339 br i1 %exitcond.not, label %exit, label %loop340 341exit:342 ret void343}344 345define void @different_non_constant_strides_not_known_backward(ptr %A, i64 %scale) {346; CHECK-LABEL: 'different_non_constant_strides_not_known_backward'347; CHECK-NEXT: loop:348; CHECK-NEXT: Report: cannot identify array bounds349; CHECK-NEXT: Dependences:350; CHECK-NEXT: Run-time memory checks:351; CHECK-NEXT: Grouped accesses:352; CHECK-NEXT: Group GRP0:353; CHECK-NEXT: (Low: %A High: (1024 + %A))354; CHECK-NEXT: Member: {%A,+,4}<nuw><%loop>355; CHECK-NEXT: Generated run-time checks are incomplete356; CHECK-EMPTY:357; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.358; CHECK-NEXT: SCEV assumptions:359; CHECK-EMPTY:360; CHECK-NEXT: Expressions re-written:361;362entry:363 br label %loop364 365loop:366 %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ]367 %gep = getelementptr inbounds i32, ptr %A, i64 %iv368 %l = load i32, ptr %gep, align 4369 %add = add nsw i32 %l, 5370 %iv.mul.2 = shl nuw nsw i64 %iv, %scale371 %gep.mul.2 = getelementptr inbounds i32, ptr %A, i64 %iv.mul.2372 store i32 %add, ptr %gep.mul.2, align 4373 %iv.next = add nuw nsw i64 %iv, 1374 %exitcond.not = icmp eq i64 %iv.next, 256375 br i1 %exitcond.not, label %exit, label %loop376 377exit:378 ret void379}380