brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.2 KiB · d4e00c6 Raw
67 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 22; RUN: opt -passes='print<scalar-evolution>' -disable-output %s 2>&1 | FileCheck %s3 4define i64 @alloca_non_null() {5; CHECK-LABEL: 'alloca_non_null'6; CHECK-NEXT:  Classifying expressions for: @alloca_non_null7; CHECK-NEXT:    %alloca = alloca i32, align 48; CHECK-NEXT:    --> %alloca U: [4,-7) S: [-9223372036854775808,9223372036854775805)9; CHECK-NEXT:    %int = ptrtoint ptr %alloca to i6410; CHECK-NEXT:    --> (ptrtoint ptr %alloca to i64) U: [4,-7) S: [-9223372036854775808,9223372036854775805)11; CHECK-NEXT:  Determining loop execution counts for: @alloca_non_null12;13  %alloca = alloca i32, align 414  %int = ptrtoint ptr %alloca to i6415  ret i64 %int16}17 18define i64 @alloca_maybe_null() {19; CHECK-LABEL: 'alloca_maybe_null'20; CHECK-NEXT:  Classifying expressions for: @alloca_maybe_null21; CHECK-NEXT:    %alloca = alloca i32, align 4, addrspace(1)22; CHECK-NEXT:    --> %alloca U: [0,-7) S: [-9223372036854775808,9223372036854775805)23; CHECK-NEXT:    %int = ptrtoint ptr addrspace(1) %alloca to i6424; CHECK-NEXT:    --> (ptrtoint ptr addrspace(1) %alloca to i64) U: [0,-7) S: [-9223372036854775808,9223372036854775805)25; CHECK-NEXT:  Determining loop execution counts for: @alloca_maybe_null26;27  %alloca = alloca i32, align 4, addrspace(1)28  %int = ptrtoint ptr addrspace(1) %alloca to i6429  ret i64 %int30}31 32define void @alloca_icmp_null_exit_count() {33; CHECK-LABEL: 'alloca_icmp_null_exit_count'34; CHECK-NEXT:  Classifying expressions for: @alloca_icmp_null_exit_count35; CHECK-NEXT:    %alloca = alloca [3 x i32], align 436; CHECK-NEXT:    --> %alloca U: [4,-15) S: [-9223372036854775808,9223372036854775805)37; CHECK-NEXT:    %alloca.end = getelementptr inbounds i32, ptr %alloca, i64 338; CHECK-NEXT:    --> (12 + %alloca)<nuw> U: [16,-3) S: [-9223372036854775808,9223372036854775805)39; CHECK-NEXT:    %ptr = phi ptr [ %ptr.next, %loop ], [ %alloca, %entry ]40; CHECK-NEXT:    --> {%alloca,+,4}<nuw><%loop> U: [4,-7) S: [-9223372036854775808,9223372036854775805) Exits: (8 + %alloca)<nuw> LoopDispositions: { %loop: Computable }41; CHECK-NEXT:    %ptr.next = getelementptr i32, ptr %ptr, i64 142; CHECK-NEXT:    --> {(4 + %alloca)<nuw>,+,4}<nuw><%loop> U: [8,-3) S: [-9223372036854775808,9223372036854775805) Exits: (12 + %alloca)<nuw> LoopDispositions: { %loop: Computable }43; CHECK-NEXT:    %and = and i1 %cmp1, %cmp244; CHECK-NEXT:    --> (%cmp2 umin %cmp1) U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %loop: Variant }45; CHECK-NEXT:  Determining loop execution counts for: @alloca_icmp_null_exit_count46; CHECK-NEXT:  Loop %loop: backedge-taken count is i64 247; CHECK-NEXT:  Loop %loop: constant max backedge-taken count is i64 248; CHECK-NEXT:  Loop %loop: symbolic max backedge-taken count is i64 249; CHECK-NEXT:  Loop %loop: Trip multiple is 350;51entry:52  %alloca = alloca [3 x i32], align 453  %alloca.end = getelementptr inbounds i32, ptr %alloca, i64 354  br label %loop55 56loop:57  %ptr = phi ptr [ %ptr.next, %loop ], [ %alloca, %entry ]58  %ptr.next = getelementptr i32, ptr %ptr, i64 159  %cmp1 = icmp ne ptr %ptr.next, %alloca.end60  %cmp2 = icmp ne ptr %ptr.next, null61  %and = and i1 %cmp1, %cmp262  br i1 %and, label %loop, label %exit63 64exit:65  ret void66}67