885 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 %s 2>&1 | FileCheck %s3 4define void @all_exits_dominate_latch_countable_exits_at_most_500_iterations_known_deref(ptr dereferenceable(2000) %A, ptr dereferenceable(2000) %B) {5; CHECK-LABEL: 'all_exits_dominate_latch_countable_exits_at_most_500_iterations_known_deref'6; CHECK-NEXT: loop.header:7; CHECK-NEXT: Memory dependences are safe with run-time checks8; CHECK-NEXT: Dependences:9; CHECK-NEXT: Run-time memory checks:10; CHECK-NEXT: Check 0:11; CHECK-NEXT: Comparing group GRP0:12; CHECK-NEXT: %gep.B = getelementptr inbounds i32, ptr %B, i64 %iv13; CHECK-NEXT: Against group GRP1:14; CHECK-NEXT: %gep.A = getelementptr inbounds i32, ptr %A, i64 %iv15; CHECK-NEXT: Grouped accesses:16; CHECK-NEXT: Group GRP0:17; CHECK-NEXT: (Low: %B High: (2000 + %B)<nuw>)18; CHECK-NEXT: Member: {%B,+,4}<nuw><%loop.header>19; CHECK-NEXT: Group GRP1:20; CHECK-NEXT: (Low: %A High: (2000 + %A)<nuw>)21; CHECK-NEXT: Member: {%A,+,4}<nuw><%loop.header>22; CHECK-EMPTY:23; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.24; CHECK-NEXT: SCEV assumptions:25; CHECK-EMPTY:26; CHECK-NEXT: Expressions re-written:27;28entry:29 br label %loop.header30 31loop.header:32 %iv = phi i64 [ 0, %entry ], [ %iv.next, %latch ]33 %gep.A = getelementptr inbounds i32, ptr %A, i64 %iv34 %gep.B = getelementptr inbounds i32, ptr %B, i64 %iv35 %l = load i32, ptr %gep.A, align 436 store i32 0, ptr %gep.B, align 437 %cntable.c.1 = icmp ult i64 %iv, 100038 %iv.next = add nuw nsw i64 %iv, 139 br i1 %cntable.c.1, label %b2, label %e.140 41b2:42 %uncntable.c.0 = icmp eq i32 %l, 043 br i1 %uncntable.c.0, label %e.2, label %b344 45b3:46 %cntable.c.2 = icmp eq i64 %iv.next, 50047 br i1 %cntable.c.2, label %cleanup4, label %latch48 49latch:50 br label %loop.header51 52cleanup4:53 ret void54 55e.1:56 ret void57 58e.2:59 ret void60}61 62define void @all_exits_dominate_latch_countable_exits_at_most_501_iterations_known_deref(ptr dereferenceable(2000) %A, ptr dereferenceable(2000) %B) {63; CHECK-LABEL: 'all_exits_dominate_latch_countable_exits_at_most_501_iterations_known_deref'64; CHECK-NEXT: loop.header:65; CHECK-NEXT: Memory dependences are safe with run-time checks66; CHECK-NEXT: Dependences:67; CHECK-NEXT: Run-time memory checks:68; CHECK-NEXT: Check 0:69; CHECK-NEXT: Comparing group GRP0:70; CHECK-NEXT: %gep.B = getelementptr inbounds i32, ptr %B, i64 %iv71; CHECK-NEXT: Against group GRP1:72; CHECK-NEXT: %gep.A = getelementptr inbounds i32, ptr %A, i64 %iv73; CHECK-NEXT: Grouped accesses:74; CHECK-NEXT: Group GRP0:75; CHECK-NEXT: (Low: %B High: inttoptr (i64 -1 to ptr))76; CHECK-NEXT: Member: {%B,+,4}<nuw><%loop.header>77; CHECK-NEXT: Group GRP1:78; CHECK-NEXT: (Low: %A High: inttoptr (i64 -1 to ptr))79; CHECK-NEXT: Member: {%A,+,4}<nuw><%loop.header>80; CHECK-EMPTY:81; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.82; CHECK-NEXT: SCEV assumptions:83; CHECK-EMPTY:84; CHECK-NEXT: Expressions re-written:85;86entry:87 br label %loop.header88 89loop.header:90 %iv = phi i64 [ 0, %entry ], [ %iv.next, %latch ]91 %gep.A = getelementptr inbounds i32, ptr %A, i64 %iv92 %gep.B = getelementptr inbounds i32, ptr %B, i64 %iv93 %l = load i32, ptr %gep.A, align 494 store i32 0, ptr %gep.B, align 495 %cntable.c.1 = icmp ult i64 %iv, 100096 %iv.next = add nuw nsw i64 %iv, 197 br i1 %cntable.c.1, label %b2, label %e.198 99b2:100 %uncntable.c.0 = icmp eq i32 %l, 0101 br i1 %uncntable.c.0, label %e.2, label %b3102 103b3:104 %cntable.c.2 = icmp eq i64 %iv.next, 501105 br i1 %cntable.c.2, label %cleanup4, label %latch106 107latch:108 br label %loop.header109 110cleanup4:111 ret void112 113e.1:114 ret void115 116e.2:117 ret void118}119 120 121define void @all_exits_dominate_latch_countable_exits_at_most_500_iterations_not_known_deref(ptr %A, ptr %B) {122; CHECK-LABEL: 'all_exits_dominate_latch_countable_exits_at_most_500_iterations_not_known_deref'123; CHECK-NEXT: loop.header:124; CHECK-NEXT: Memory dependences are safe with run-time checks125; CHECK-NEXT: Dependences:126; CHECK-NEXT: Run-time memory checks:127; CHECK-NEXT: Check 0:128; CHECK-NEXT: Comparing group GRP0:129; CHECK-NEXT: %gep.B = getelementptr inbounds i32, ptr %B, i64 %iv130; CHECK-NEXT: Against group GRP1:131; CHECK-NEXT: %gep.A = getelementptr inbounds i32, ptr %A, i64 %iv132; CHECK-NEXT: Grouped accesses:133; CHECK-NEXT: Group GRP0:134; CHECK-NEXT: (Low: %B High: inttoptr (i64 -1 to ptr))135; CHECK-NEXT: Member: {%B,+,4}<nuw><%loop.header>136; CHECK-NEXT: Group GRP1:137; CHECK-NEXT: (Low: %A High: inttoptr (i64 -1 to ptr))138; CHECK-NEXT: Member: {%A,+,4}<nuw><%loop.header>139; CHECK-EMPTY:140; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.141; CHECK-NEXT: SCEV assumptions:142; CHECK-EMPTY:143; CHECK-NEXT: Expressions re-written:144;145entry:146 br label %loop.header147 148loop.header:149 %iv = phi i64 [ 0, %entry ], [ %iv.next, %latch ]150 %gep.A = getelementptr inbounds i32, ptr %A, i64 %iv151 %gep.B = getelementptr inbounds i32, ptr %B, i64 %iv152 %l = load i32, ptr %gep.A, align 4153 store i32 0, ptr %gep.B, align 4154 %cntable.c.1 = icmp ult i64 %iv, 1000155 %iv.next = add nuw nsw i64 %iv, 1156 br i1 %cntable.c.1, label %b2, label %e.1157 158b2:159 %uncntable.c.0 = icmp eq i32 %l, 0160 br i1 %uncntable.c.0, label %e.2, label %b3161 162b3:163 %cntable.c.2 = icmp eq i64 %iv.next, 500164 br i1 %cntable.c.2, label %cleanup4, label %latch165 166latch:167 br label %loop.header168 169cleanup4:170 ret void171 172e.1:173 ret void174 175e.2:176 ret void177}178 179define i32 @all_exits_dominate_latch_countable_exits_at_most_1000_iterations_known_deref(ptr dereferenceable(4000) %A, ptr dereferenceable(4000) %B) {180; CHECK-LABEL: 'all_exits_dominate_latch_countable_exits_at_most_1000_iterations_known_deref'181; CHECK-NEXT: loop.header:182; CHECK-NEXT: Memory dependences are safe with run-time checks183; CHECK-NEXT: Dependences:184; CHECK-NEXT: Run-time memory checks:185; CHECK-NEXT: Check 0:186; CHECK-NEXT: Comparing group GRP0:187; CHECK-NEXT: %gep.B = getelementptr inbounds i32, ptr %B, i64 %iv188; CHECK-NEXT: Against group GRP1:189; CHECK-NEXT: %gep.A = getelementptr inbounds i32, ptr %A, i64 %iv190; CHECK-NEXT: Grouped accesses:191; CHECK-NEXT: Group GRP0:192; CHECK-NEXT: (Low: %B High: (4000 + %B)<nuw>)193; CHECK-NEXT: Member: {%B,+,4}<nuw><%loop.header>194; CHECK-NEXT: Group GRP1:195; CHECK-NEXT: (Low: %A High: (4000 + %A)<nuw>)196; CHECK-NEXT: Member: {%A,+,4}<nuw><%loop.header>197; CHECK-EMPTY:198; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.199; CHECK-NEXT: SCEV assumptions:200; CHECK-EMPTY:201; CHECK-NEXT: Expressions re-written:202;203entry:204 br label %loop.header205 206loop.header:207 %iv = phi i64 [ 0, %entry ], [ %iv.next, %latch ]208 %gep.A = getelementptr inbounds i32, ptr %A, i64 %iv209 %gep.B = getelementptr inbounds i32, ptr %B, i64 %iv210 %l = load i32, ptr %gep.A, align 4211 store i32 0, ptr %gep.B, align 4212 %cntable.c.1 = icmp ult i64 %iv, 999213 br i1 %cntable.c.1, label %b2, label %e.1214 215b2:216 %uncntable.c.0 = icmp eq i32 %l, 0217 br i1 %uncntable.c.0, label %e.2, label %b3218 219b3:220 %iv.next = add nuw nsw i64 %iv, 1221 %cntable.c.2 = icmp eq i64 %iv.next, 2000222 br i1 %cntable.c.2, label %e.0, label %latch223 224latch:225 br label %loop.header226 227e.0:228 ret i32 0229 230e.1:231 ret i32 1232 233e.2:234 ret i32 2235}236 237define i32 @all_exits_dominate_latch_countable_exits_at_most_1001_iterations_known_deref(ptr dereferenceable(4000) %A, ptr dereferenceable(4000) %B) {238; CHECK-LABEL: 'all_exits_dominate_latch_countable_exits_at_most_1001_iterations_known_deref'239; CHECK-NEXT: loop.header:240; CHECK-NEXT: Memory dependences are safe with run-time checks241; CHECK-NEXT: Dependences:242; CHECK-NEXT: Run-time memory checks:243; CHECK-NEXT: Check 0:244; CHECK-NEXT: Comparing group GRP0:245; CHECK-NEXT: %gep.B = getelementptr inbounds i32, ptr %B, i64 %iv246; CHECK-NEXT: Against group GRP1:247; CHECK-NEXT: %gep.A = getelementptr inbounds i32, ptr %A, i64 %iv248; CHECK-NEXT: Grouped accesses:249; CHECK-NEXT: Group GRP0:250; CHECK-NEXT: (Low: %B High: inttoptr (i64 -1 to ptr))251; CHECK-NEXT: Member: {%B,+,4}<nuw><%loop.header>252; CHECK-NEXT: Group GRP1:253; CHECK-NEXT: (Low: %A High: inttoptr (i64 -1 to ptr))254; CHECK-NEXT: Member: {%A,+,4}<nuw><%loop.header>255; CHECK-EMPTY:256; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.257; CHECK-NEXT: SCEV assumptions:258; CHECK-EMPTY:259; CHECK-NEXT: Expressions re-written:260;261entry:262 br label %loop.header263 264loop.header:265 %iv = phi i64 [ 0, %entry ], [ %iv.next, %latch ]266 %gep.A = getelementptr inbounds i32, ptr %A, i64 %iv267 %gep.B = getelementptr inbounds i32, ptr %B, i64 %iv268 %l = load i32, ptr %gep.A, align 4269 store i32 0, ptr %gep.B, align 4270 %cntable.c.1 = icmp ult i64 %iv, 1000271 br i1 %cntable.c.1, label %b2, label %e.1272 273b2:274 %uncntable.c.0 = icmp eq i32 %l, 0275 br i1 %uncntable.c.0, label %e.2, label %b3276 277b3:278 %iv.next = add nuw nsw i64 %iv, 1279 %cntable.c.2 = icmp eq i64 %iv.next, 2000280 br i1 %cntable.c.2, label %e.0, label %latch281 282latch:283 br label %loop.header284 285e.0:286 ret i32 0287 288e.1:289 ret i32 1290 291e.2:292 ret i32 2293}294 295define i32 @all_exits_dominate_latch_countable_exits_at_most_1000_iterations_not_known_deref(ptr %A, ptr %B) {296; CHECK-LABEL: 'all_exits_dominate_latch_countable_exits_at_most_1000_iterations_not_known_deref'297; CHECK-NEXT: loop.header:298; CHECK-NEXT: Memory dependences are safe with run-time checks299; CHECK-NEXT: Dependences:300; CHECK-NEXT: Run-time memory checks:301; CHECK-NEXT: Check 0:302; CHECK-NEXT: Comparing group GRP0:303; CHECK-NEXT: %gep.B = getelementptr inbounds i32, ptr %B, i64 %iv304; CHECK-NEXT: Against group GRP1:305; CHECK-NEXT: %gep.A = getelementptr inbounds i32, ptr %A, i64 %iv306; CHECK-NEXT: Grouped accesses:307; CHECK-NEXT: Group GRP0:308; CHECK-NEXT: (Low: %B High: inttoptr (i64 -1 to ptr))309; CHECK-NEXT: Member: {%B,+,4}<nuw><%loop.header>310; CHECK-NEXT: Group GRP1:311; CHECK-NEXT: (Low: %A High: inttoptr (i64 -1 to ptr))312; CHECK-NEXT: Member: {%A,+,4}<nuw><%loop.header>313; CHECK-EMPTY:314; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.315; CHECK-NEXT: SCEV assumptions:316; CHECK-EMPTY:317; CHECK-NEXT: Expressions re-written:318;319entry:320 br label %loop.header321 322loop.header:323 %iv = phi i64 [ 0, %entry ], [ %iv.next, %latch ]324 %gep.A = getelementptr inbounds i32, ptr %A, i64 %iv325 %gep.B = getelementptr inbounds i32, ptr %B, i64 %iv326 %l = load i32, ptr %gep.A, align 4327 store i32 0, ptr %gep.B, align 4328 %cntable.c.1 = icmp ult i64 %iv, 999329 br i1 %cntable.c.1, label %b2, label %e.1330 331b2:332 %uncntable.c.0 = icmp eq i32 %l, 0333 br i1 %uncntable.c.0, label %e.2, label %b3334 335b3:336 %iv.next = add nuw nsw i64 %iv, 1337 %cntable.c.2 = icmp eq i64 %iv.next, 2000338 br i1 %cntable.c.2, label %e.0, label %latch339 340latch:341 br label %loop.header342 343e.0:344 ret i32 0345 346e.1:347 ret i32 1348 349e.2:350 ret i32 2351}352 353 354define i32 @not_all_exits_dominate_latch(ptr %A, ptr %B) {355; CHECK-LABEL: 'not_all_exits_dominate_latch'356; CHECK-NEXT: loop.header:357; CHECK-NEXT: Report: could not determine number of loop iterations358; CHECK-NEXT: Dependences:359; CHECK-NEXT: Run-time memory checks:360; CHECK-NEXT: Grouped accesses:361; CHECK-EMPTY:362; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.363; CHECK-NEXT: SCEV assumptions:364; CHECK-EMPTY:365; CHECK-NEXT: Expressions re-written:366;367entry:368 br label %loop.header369 370loop.header:371 %iv = phi i64 [ 0, %entry ], [ %iv.next, %latch ]372 %gep.A = getelementptr inbounds i32, ptr %A, i64 %iv373 %gep.B = getelementptr inbounds i32, ptr %B, i64 %iv374 %l = load i32, ptr %gep.A, align 4375 store i32 0, ptr %gep.B, align 4376 %cntable.c.1 = icmp ult i64 %iv, 1000377 %iv.next = add nuw nsw i64 %iv, 1378 br i1 %cntable.c.1, label %b2, label %latch379 380b2:381 %uncntable.c.0 = icmp eq i32 %l, 0382 br i1 %uncntable.c.0, label %e.2, label %b3383 384b3:385 %cntable.c.2 = icmp eq i64 %iv.next, 2000386 br i1 %cntable.c.2, label %e.0, label %latch387 388latch:389 br label %loop.header390 391e.0:392 ret i32 0393 394e.2:395 ret i32 1396}397 398define i32 @b3_does_not_dominate_latch_known_deref(ptr dereferenceable(4000) %A, ptr dereferenceable(4000) %B) {399; CHECK-LABEL: 'b3_does_not_dominate_latch_known_deref'400; CHECK-NEXT: loop.header:401; CHECK-NEXT: Memory dependences are safe with run-time checks402; CHECK-NEXT: Dependences:403; CHECK-NEXT: Run-time memory checks:404; CHECK-NEXT: Check 0:405; CHECK-NEXT: Comparing group GRP0:406; CHECK-NEXT: %gep.B = getelementptr inbounds i32, ptr %B, i64 %iv407; CHECK-NEXT: Against group GRP1:408; CHECK-NEXT: %gep.A = getelementptr inbounds i32, ptr %A, i64 %iv409; CHECK-NEXT: Grouped accesses:410; CHECK-NEXT: Group GRP0:411; CHECK-NEXT: (Low: %B High: inttoptr (i64 -1 to ptr))412; CHECK-NEXT: Member: {%B,+,4}<nuw><%loop.header>413; CHECK-NEXT: Group GRP1:414; CHECK-NEXT: (Low: %A High: inttoptr (i64 -1 to ptr))415; CHECK-NEXT: Member: {%A,+,4}<nuw><%loop.header>416; CHECK-EMPTY:417; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.418; CHECK-NEXT: SCEV assumptions:419; CHECK-EMPTY:420; CHECK-NEXT: Expressions re-written:421;422entry:423 br label %loop.header424 425loop.header:426 %iv = phi i64 [ 0, %entry ], [ %iv.next, %latch ]427 %gep.A = getelementptr inbounds i32, ptr %A, i64 %iv428 %gep.B = getelementptr inbounds i32, ptr %B, i64 %iv429 %l = load i32, ptr %gep.A, align 4430 store i32 0, ptr %gep.B, align 4431 %cntable.c.1 = icmp ult i64 %iv, 1000432 %iv.next = add nuw nsw i64 %iv, 1433 br i1 %cntable.c.1, label %b2, label %e.1434 435b2:436 %uncntable.c.0 = icmp eq i32 %l, 0437 br i1 %uncntable.c.0, label %latch, label %b3438 439b3:440 %cntable.c.2 = icmp eq i64 %iv.next, 500441 br i1 %cntable.c.2, label %e.0, label %latch442 443latch:444 br label %loop.header445 446e.0:447 ret i32 0448 449e.1:450 ret i32 1451}452 453define i32 @b3_does_not_dominate_latch_not_known_deref(ptr %A, ptr %B) {454; CHECK-LABEL: 'b3_does_not_dominate_latch_not_known_deref'455; CHECK-NEXT: loop.header:456; CHECK-NEXT: Memory dependences are safe with run-time checks457; CHECK-NEXT: Dependences:458; CHECK-NEXT: Run-time memory checks:459; CHECK-NEXT: Check 0:460; CHECK-NEXT: Comparing group GRP0:461; CHECK-NEXT: %gep.B = getelementptr inbounds i32, ptr %B, i64 %iv462; CHECK-NEXT: Against group GRP1:463; CHECK-NEXT: %gep.A = getelementptr inbounds i32, ptr %A, i64 %iv464; CHECK-NEXT: Grouped accesses:465; CHECK-NEXT: Group GRP0:466; CHECK-NEXT: (Low: %B High: inttoptr (i64 -1 to ptr))467; CHECK-NEXT: Member: {%B,+,4}<nuw><%loop.header>468; CHECK-NEXT: Group GRP1:469; CHECK-NEXT: (Low: %A High: inttoptr (i64 -1 to ptr))470; CHECK-NEXT: Member: {%A,+,4}<nuw><%loop.header>471; CHECK-EMPTY:472; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.473; CHECK-NEXT: SCEV assumptions:474; CHECK-EMPTY:475; CHECK-NEXT: Expressions re-written:476;477entry:478 br label %loop.header479 480loop.header:481 %iv = phi i64 [ 0, %entry ], [ %iv.next, %latch ]482 %gep.A = getelementptr inbounds i32, ptr %A, i64 %iv483 %gep.B = getelementptr inbounds i32, ptr %B, i64 %iv484 %l = load i32, ptr %gep.A, align 4485 store i32 0, ptr %gep.B, align 4486 %cntable.c.1 = icmp ult i64 %iv, 1000487 %iv.next = add nuw nsw i64 %iv, 1488 br i1 %cntable.c.1, label %b2, label %e.1489 490b2:491 %uncntable.c.0 = icmp eq i32 %l, 0492 br i1 %uncntable.c.0, label %latch, label %b3493 494b3:495 %cntable.c.2 = icmp eq i64 %iv.next, 500496 br i1 %cntable.c.2, label %e.0, label %latch497 498latch:499 br label %loop.header500 501e.0:502 ret i32 0503 504e.1:505 ret i32 1506}507 508define void @all_exits_dominate_latch_countable_exits_at_most_500_iterations_known_deref_via_assumption(ptr %A, ptr %B) nosync nofree {509; CHECK-LABEL: 'all_exits_dominate_latch_countable_exits_at_most_500_iterations_known_deref_via_assumption'510; CHECK-NEXT: loop.header:511; CHECK-NEXT: Memory dependences are safe with run-time checks512; CHECK-NEXT: Dependences:513; CHECK-NEXT: Run-time memory checks:514; CHECK-NEXT: Check 0:515; CHECK-NEXT: Comparing group GRP0:516; CHECK-NEXT: %gep.B = getelementptr inbounds i32, ptr %B, i64 %iv517; CHECK-NEXT: Against group GRP1:518; CHECK-NEXT: %gep.A = getelementptr inbounds i32, ptr %A, i64 %iv519; CHECK-NEXT: Grouped accesses:520; CHECK-NEXT: Group GRP0:521; CHECK-NEXT: (Low: %B High: (2000 + %B))522; CHECK-NEXT: Member: {%B,+,4}<nuw><%loop.header>523; CHECK-NEXT: Group GRP1:524; CHECK-NEXT: (Low: %A High: (2000 + %A))525; CHECK-NEXT: Member: {%A,+,4}<nuw><%loop.header>526; CHECK-EMPTY:527; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.528; CHECK-NEXT: SCEV assumptions:529; CHECK-EMPTY:530; CHECK-NEXT: Expressions re-written:531;532entry:533 call void @llvm.assume(i1 true) [ "dereferenceable"(ptr %A, i64 2000) ]534 call void @llvm.assume(i1 true) [ "dereferenceable"(ptr %B, i64 2000) ]535 br label %loop.header536 537loop.header:538 %iv = phi i64 [ 0, %entry ], [ %iv.next, %latch ]539 %gep.A = getelementptr inbounds i32, ptr %A, i64 %iv540 %gep.B = getelementptr inbounds i32, ptr %B, i64 %iv541 %l = load i32, ptr %gep.A, align 4542 store i32 0, ptr %gep.B, align 4543 %cntable.c.1 = icmp ult i64 %iv, 1000544 %iv.next = add nuw nsw i64 %iv, 1545 br i1 %cntable.c.1, label %b2, label %e.1546 547b2:548 %uncntable.c.0 = icmp eq i32 %l, 0549 br i1 %uncntable.c.0, label %e.2, label %b3550 551b3:552 %cntable.c.2 = icmp eq i64 %iv.next, 500553 br i1 %cntable.c.2, label %cleanup4, label %latch554 555latch:556 br label %loop.header557 558cleanup4:559 ret void560 561e.1:562 ret void563 564e.2:565 ret void566}567 568define void @all_exits_dominate_latch_countable_exits_at_most_500_iterations_known_deref_via_assumption_multiple_predecessors(ptr %A, ptr %B, i1 %c) nosync nofree {569; CHECK-LABEL: 'all_exits_dominate_latch_countable_exits_at_most_500_iterations_known_deref_via_assumption_multiple_predecessors'570; CHECK-NEXT: loop.header:571; CHECK-NEXT: Memory dependences are safe with run-time checks572; CHECK-NEXT: Dependences:573; CHECK-NEXT: Run-time memory checks:574; CHECK-NEXT: Check 0:575; CHECK-NEXT: Comparing group GRP0:576; CHECK-NEXT: %gep.B = getelementptr inbounds i32, ptr %B, i64 %iv577; CHECK-NEXT: Against group GRP1:578; CHECK-NEXT: %gep.A = getelementptr inbounds i32, ptr %A, i64 %iv579; CHECK-NEXT: Grouped accesses:580; CHECK-NEXT: Group GRP0:581; CHECK-NEXT: (Low: %B High: (2000 + %B))582; CHECK-NEXT: Member: {%B,+,4}<nuw><%loop.header>583; CHECK-NEXT: Group GRP1:584; CHECK-NEXT: (Low: %A High: (2000 + %A))585; CHECK-NEXT: Member: {%A,+,4}<nuw><%loop.header>586; CHECK-EMPTY:587; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.588; CHECK-NEXT: SCEV assumptions:589; CHECK-EMPTY:590; CHECK-NEXT: Expressions re-written:591;592entry:593 call void @llvm.assume(i1 true) [ "dereferenceable"(ptr %A, i64 2000) ]594 call void @llvm.assume(i1 true) [ "dereferenceable"(ptr %B, i64 2000) ]595 br i1 %c, label %then, label %else596 597then:598 br label %loop.header599 600else:601 br label %loop.header602 603loop.header:604 %iv = phi i64 [ 0, %then ], [ 0, %else ], [ %iv.next, %latch ]605 %gep.A = getelementptr inbounds i32, ptr %A, i64 %iv606 %gep.B = getelementptr inbounds i32, ptr %B, i64 %iv607 %l = load i32, ptr %gep.A, align 4608 store i32 0, ptr %gep.B, align 4609 %cntable.c.1 = icmp ult i64 %iv, 1000610 %iv.next = add nuw nsw i64 %iv, 1611 br i1 %cntable.c.1, label %b2, label %e.1612 613b2:614 %uncntable.c.0 = icmp eq i32 %l, 0615 br i1 %uncntable.c.0, label %e.2, label %b3616 617b3:618 %cntable.c.2 = icmp eq i64 %iv.next, 500619 br i1 %cntable.c.2, label %cleanup4, label %latch620 621latch:622 br label %loop.header623 624cleanup4:625 ret void626 627e.1:628 ret void629 630e.2:631 ret void632}633 634define void @all_exits_dominate_latch_countable_exits_at_most_500_iterations_known_deref_via_assumption_multiple_predecessors_no_valid(ptr %A, ptr %B, i1 %c) nosync nofree {635; CHECK-LABEL: 'all_exits_dominate_latch_countable_exits_at_most_500_iterations_known_deref_via_assumption_multiple_predecessors_no_valid'636; CHECK-NEXT: loop.header:637; CHECK-NEXT: Memory dependences are safe with run-time checks638; CHECK-NEXT: Dependences:639; CHECK-NEXT: Run-time memory checks:640; CHECK-NEXT: Check 0:641; CHECK-NEXT: Comparing group GRP0:642; CHECK-NEXT: %gep.B = getelementptr inbounds i32, ptr %B, i64 %iv643; CHECK-NEXT: Against group GRP1:644; CHECK-NEXT: %gep.A = getelementptr inbounds i32, ptr %A, i64 %iv645; CHECK-NEXT: Grouped accesses:646; CHECK-NEXT: Group GRP0:647; CHECK-NEXT: (Low: %B High: inttoptr (i64 -1 to ptr))648; CHECK-NEXT: Member: {%B,+,4}<nuw><%loop.header>649; CHECK-NEXT: Group GRP1:650; CHECK-NEXT: (Low: %A High: (2000 + %A))651; CHECK-NEXT: Member: {%A,+,4}<nuw><%loop.header>652; CHECK-EMPTY:653; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.654; CHECK-NEXT: SCEV assumptions:655; CHECK-EMPTY:656; CHECK-NEXT: Expressions re-written:657;658entry:659 call void @llvm.assume(i1 true) [ "dereferenceable"(ptr %A, i64 2000) ]660 br i1 %c, label %then, label %else661 662then:663 call void @llvm.assume(i1 true) [ "dereferenceable"(ptr %B, i64 2000) ]664 br label %loop.header665 666else:667 br label %loop.header668 669loop.header:670 %iv = phi i64 [ 0, %then ], [ 0, %else ], [ %iv.next, %latch ]671 %gep.A = getelementptr inbounds i32, ptr %A, i64 %iv672 %gep.B = getelementptr inbounds i32, ptr %B, i64 %iv673 %l = load i32, ptr %gep.A, align 4674 store i32 0, ptr %gep.B, align 4675 %cntable.c.1 = icmp ult i64 %iv, 1000676 %iv.next = add nuw nsw i64 %iv, 1677 br i1 %cntable.c.1, label %b2, label %e.1678 679b2:680 %uncntable.c.0 = icmp eq i32 %l, 0681 br i1 %uncntable.c.0, label %e.2, label %b3682 683b3:684 %cntable.c.2 = icmp eq i64 %iv.next, 500685 br i1 %cntable.c.2, label %cleanup4, label %latch686 687latch:688 br label %loop.header689 690cleanup4:691 ret void692 693e.1:694 ret void695 696e.2:697 ret void698}699 700define void @all_exits_dominate_latch_countable_exits_at_most_500_iterations_deref_via_assumption_too_small(ptr %A, ptr %B) nosync nofree {701; CHECK-LABEL: 'all_exits_dominate_latch_countable_exits_at_most_500_iterations_deref_via_assumption_too_small'702; CHECK-NEXT: loop.header:703; CHECK-NEXT: Memory dependences are safe with run-time checks704; CHECK-NEXT: Dependences:705; CHECK-NEXT: Run-time memory checks:706; CHECK-NEXT: Check 0:707; CHECK-NEXT: Comparing group GRP0:708; CHECK-NEXT: %gep.B = getelementptr inbounds i32, ptr %B, i64 %iv709; CHECK-NEXT: Against group GRP1:710; CHECK-NEXT: %gep.A = getelementptr inbounds i32, ptr %A, i64 %iv711; CHECK-NEXT: Grouped accesses:712; CHECK-NEXT: Group GRP0:713; CHECK-NEXT: (Low: %B High: inttoptr (i64 -1 to ptr))714; CHECK-NEXT: Member: {%B,+,4}<nuw><%loop.header>715; CHECK-NEXT: Group GRP1:716; CHECK-NEXT: (Low: %A High: inttoptr (i64 -1 to ptr))717; CHECK-NEXT: Member: {%A,+,4}<nuw><%loop.header>718; CHECK-EMPTY:719; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.720; CHECK-NEXT: SCEV assumptions:721; CHECK-EMPTY:722; CHECK-NEXT: Expressions re-written:723;724entry:725 call void @llvm.assume(i1 true) [ "dereferenceable"(ptr %A, i64 1999) ]726 call void @llvm.assume(i1 true) [ "dereferenceable"(ptr %B, i64 1999) ]727 br label %loop.header728 729loop.header:730 %iv = phi i64 [ 0, %entry ], [ %iv.next, %latch ]731 %gep.A = getelementptr inbounds i32, ptr %A, i64 %iv732 %gep.B = getelementptr inbounds i32, ptr %B, i64 %iv733 %l = load i32, ptr %gep.A, align 4734 store i32 0, ptr %gep.B, align 4735 %cntable.c.1 = icmp ult i64 %iv, 1000736 %iv.next = add nuw nsw i64 %iv, 1737 br i1 %cntable.c.1, label %b2, label %e.1738 739b2:740 %uncntable.c.0 = icmp eq i32 %l, 0741 br i1 %uncntable.c.0, label %e.2, label %b3742 743b3:744 %cntable.c.2 = icmp eq i64 %iv.next, 500745 br i1 %cntable.c.2, label %cleanup4, label %latch746 747latch:748 br label %loop.header749 750cleanup4:751 ret void752 753e.1:754 ret void755 756e.2:757 ret void758}759 760define void @all_exits_dominate_latch_countable_exits_at_most_500_iterations_known_deref_via_assumption_nofree_via_context(ptr %A, ptr %B) nosync {761; CHECK-LABEL: 'all_exits_dominate_latch_countable_exits_at_most_500_iterations_known_deref_via_assumption_nofree_via_context'762; CHECK-NEXT: loop.header:763; CHECK-NEXT: Memory dependences are safe with run-time checks764; CHECK-NEXT: Dependences:765; CHECK-NEXT: Run-time memory checks:766; CHECK-NEXT: Check 0:767; CHECK-NEXT: Comparing group GRP0:768; CHECK-NEXT: %gep.B = getelementptr inbounds i32, ptr %B, i64 %iv769; CHECK-NEXT: Against group GRP1:770; CHECK-NEXT: %gep.A = getelementptr inbounds i32, ptr %A, i64 %iv771; CHECK-NEXT: Grouped accesses:772; CHECK-NEXT: Group GRP0:773; CHECK-NEXT: (Low: %B High: (2000 + %B))774; CHECK-NEXT: Member: {%B,+,4}<nuw><%loop.header>775; CHECK-NEXT: Group GRP1:776; CHECK-NEXT: (Low: %A High: (2000 + %A))777; CHECK-NEXT: Member: {%A,+,4}<nuw><%loop.header>778; CHECK-EMPTY:779; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.780; CHECK-NEXT: SCEV assumptions:781; CHECK-EMPTY:782; CHECK-NEXT: Expressions re-written:783;784entry:785 call void @llvm.assume(i1 true) [ "dereferenceable"(ptr %A, i64 2000) ]786 call void @llvm.assume(i1 true) [ "dereferenceable"(ptr %B, i64 2000) ]787 br label %loop.header788 789loop.header:790 %iv = phi i64 [ 0, %entry ], [ %iv.next, %latch ]791 %gep.A = getelementptr inbounds i32, ptr %A, i64 %iv792 %gep.B = getelementptr inbounds i32, ptr %B, i64 %iv793 %l = load i32, ptr %gep.A, align 4794 store i32 0, ptr %gep.B, align 4795 %cntable.c.1 = icmp ult i64 %iv, 1000796 %iv.next = add nuw nsw i64 %iv, 1797 br i1 %cntable.c.1, label %b2, label %e.1798 799b2:800 %uncntable.c.0 = icmp eq i32 %l, 0801 br i1 %uncntable.c.0, label %e.2, label %b3802 803b3:804 %cntable.c.2 = icmp eq i64 %iv.next, 500805 br i1 %cntable.c.2, label %cleanup4, label %latch806 807latch:808 br label %loop.header809 810cleanup4:811 ret void812 813e.1:814 ret void815 816e.2:817 ret void818}819 820define void @all_exits_dominate_latch_countable_exits_at_most_500_iterations_known_deref_via_assumption_missing_nofree_multiple_predecessors(ptr %A, ptr %B, i1 %c) nosync {821; CHECK-LABEL: 'all_exits_dominate_latch_countable_exits_at_most_500_iterations_known_deref_via_assumption_missing_nofree_multiple_predecessors'822; CHECK-NEXT: loop.header:823; CHECK-NEXT: Memory dependences are safe with run-time checks824; CHECK-NEXT: Dependences:825; CHECK-NEXT: Run-time memory checks:826; CHECK-NEXT: Check 0:827; CHECK-NEXT: Comparing group GRP0:828; CHECK-NEXT: %gep.B = getelementptr inbounds i32, ptr %B, i64 %iv829; CHECK-NEXT: Against group GRP1:830; CHECK-NEXT: %gep.A = getelementptr inbounds i32, ptr %A, i64 %iv831; CHECK-NEXT: Grouped accesses:832; CHECK-NEXT: Group GRP0:833; CHECK-NEXT: (Low: %B High: inttoptr (i64 -1 to ptr))834; CHECK-NEXT: Member: {%B,+,4}<nuw><%loop.header>835; CHECK-NEXT: Group GRP1:836; CHECK-NEXT: (Low: %A High: inttoptr (i64 -1 to ptr))837; CHECK-NEXT: Member: {%A,+,4}<nuw><%loop.header>838; CHECK-EMPTY:839; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.840; CHECK-NEXT: SCEV assumptions:841; CHECK-EMPTY:842; CHECK-NEXT: Expressions re-written:843;844entry:845 call void @llvm.assume(i1 true) [ "dereferenceable"(ptr %A, i64 2000) ]846 call void @llvm.assume(i1 true) [ "dereferenceable"(ptr %B, i64 2000) ]847 br i1 %c, label %then, label %else848 849then:850 br label %loop.header851 852else:853 br label %loop.header854 855loop.header:856 %iv = phi i64 [ 0, %then ], [ 0, %else ], [ %iv.next, %latch ]857 %gep.A = getelementptr inbounds i32, ptr %A, i64 %iv858 %gep.B = getelementptr inbounds i32, ptr %B, i64 %iv859 %l = load i32, ptr %gep.A, align 4860 store i32 0, ptr %gep.B, align 4861 %cntable.c.1 = icmp ult i64 %iv, 1000862 %iv.next = add nuw nsw i64 %iv, 1863 br i1 %cntable.c.1, label %b2, label %e.1864 865b2:866 %uncntable.c.0 = icmp eq i32 %l, 0867 br i1 %uncntable.c.0, label %e.2, label %b3868 869b3:870 %cntable.c.2 = icmp eq i64 %iv.next, 500871 br i1 %cntable.c.2, label %cleanup4, label %latch872 873latch:874 br label %loop.header875 876cleanup4:877 ret void878 879e.1:880 ret void881 882e.2:883 ret void884}885