brintos

brintos / llvm-project-archived public Read only

0
0
Text · 9.5 KiB · 670523c Raw
227 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py2; RUN: opt -disable-output "-passes=print<scalar-evolution>" -S < %s 2>&1 | FileCheck %s3 4define i16 @test1(i8 %x) {5; CHECK-LABEL: 'test1'6; CHECK-NEXT:  Classifying expressions for: @test17; CHECK-NEXT:    %A = zext i8 %x to i128; CHECK-NEXT:    --> (zext i8 %x to i12) U: [0,256) S: [0,256)9; CHECK-NEXT:    %B = sext i12 %A to i1610; CHECK-NEXT:    --> (zext i8 %x to i16) U: [0,256) S: [0,256)11; CHECK-NEXT:  Determining loop execution counts for: @test112;13  %A = zext i8 %x to i1214  %B = sext i12 %A to i1615  ret i16 %B16}17 18define i8 @test2(i8 %x) {19; CHECK-LABEL: 'test2'20; CHECK-NEXT:  Classifying expressions for: @test221; CHECK-NEXT:    %A = zext i8 %x to i1622; CHECK-NEXT:    --> (zext i8 %x to i16) U: [0,256) S: [0,256)23; CHECK-NEXT:    %B = add i16 %A, 102524; CHECK-NEXT:    --> (1025 + (zext i8 %x to i16))<nuw><nsw> U: [1025,1281) S: [1025,1281)25; CHECK-NEXT:    %C = trunc i16 %B to i826; CHECK-NEXT:    --> (1 + %x) U: full-set S: full-set27; CHECK-NEXT:  Determining loop execution counts for: @test228;29  %A = zext i8 %x to i1630  %B = add i16 %A, 102531  %C = trunc i16 %B to i832  ret i8 %C33}34 35define i8 @test3(i8 %x) {36; CHECK-LABEL: 'test3'37; CHECK-NEXT:  Classifying expressions for: @test338; CHECK-NEXT:    %A = zext i8 %x to i1639; CHECK-NEXT:    --> (zext i8 %x to i16) U: [0,256) S: [0,256)40; CHECK-NEXT:    %B = mul i16 %A, 102741; CHECK-NEXT:    --> (1027 * (zext i8 %x to i16)) U: full-set S: full-set42; CHECK-NEXT:    %C = trunc i16 %B to i843; CHECK-NEXT:    --> (3 * %x) U: full-set S: full-set44; CHECK-NEXT:  Determining loop execution counts for: @test345;46  %A = zext i8 %x to i1647  %B = mul i16 %A, 102748  %C = trunc i16 %B to i849  ret i8 %C50}51 52define void @test4(i32 %x, i32 %y) {53; CHECK-LABEL: 'test4'54; CHECK-NEXT:  Classifying expressions for: @test455; CHECK-NEXT:    %Y = and i32 %y, 356; CHECK-NEXT:    --> (zext i2 (trunc i32 %y to i2) to i32) U: [0,4) S: [0,4)57; CHECK-NEXT:    %A = phi i32 [ 0, %entry ], [ %I, %loop ]58; CHECK-NEXT:    --> {0,+,1}<nuw><nsw><%loop> U: [0,21) S: [0,21) Exits: 20 LoopDispositions: { %loop: Computable }59; CHECK-NEXT:    %Z1 = select i1 %rand1, i32 %A, i32 %Y60; CHECK-NEXT:    --> ((zext i2 (trunc i32 %y to i2) to i32) smax {0,+,1}<nuw><nsw><%loop>) U: [0,21) S: [0,21) Exits: 20 LoopDispositions: { %loop: Computable }61; CHECK-NEXT:    %Z2 = select i1 %rand2, i32 %A, i32 %Z162; CHECK-NEXT:    --> ({0,+,1}<nuw><nsw><%loop> umax ((zext i2 (trunc i32 %y to i2) to i32) smax {0,+,1}<nuw><nsw><%loop>)) U: [0,21) S: [0,21) Exits: 20 LoopDispositions: { %loop: Computable }63; CHECK-NEXT:    %B = trunc i32 %Z2 to i1664; CHECK-NEXT:    --> (trunc i32 ({0,+,1}<nuw><nsw><%loop> umax ((zext i2 (trunc i32 %y to i2) to i32) smax {0,+,1}<nuw><nsw><%loop>)) to i16) U: [0,21) S: [0,21) Exits: 20 LoopDispositions: { %loop: Computable }65; CHECK-NEXT:    %C = sext i16 %B to i3066; CHECK-NEXT:    --> (trunc i32 ({0,+,1}<nuw><nsw><%loop> umax ((zext i2 (trunc i32 %y to i2) to i32) smax {0,+,1}<nuw><nsw><%loop>)) to i30) U: [0,21) S: [0,21) Exits: 20 LoopDispositions: { %loop: Computable }67; CHECK-NEXT:    %D = sext i16 %B to i3268; CHECK-NEXT:    --> ({0,+,1}<nuw><nsw><%loop> umax ((zext i2 (trunc i32 %y to i2) to i32) smax {0,+,1}<nuw><nsw><%loop>)) U: [0,21) S: [0,21) Exits: 20 LoopDispositions: { %loop: Computable }69; CHECK-NEXT:    %E = sext i16 %B to i3470; CHECK-NEXT:    --> ((zext i32 ((zext i2 (trunc i32 %y to i2) to i32) smax {0,+,1}<nuw><nsw><%loop>) to i34) umax {0,+,1}<nuw><nsw><%loop>) U: [0,21) S: [0,21) Exits: 20 LoopDispositions: { %loop: Computable }71; CHECK-NEXT:    %F = zext i16 %B to i3072; CHECK-NEXT:    --> (trunc i32 ({0,+,1}<nuw><nsw><%loop> umax ((zext i2 (trunc i32 %y to i2) to i32) smax {0,+,1}<nuw><nsw><%loop>)) to i30) U: [0,21) S: [0,21) Exits: 20 LoopDispositions: { %loop: Computable }73; CHECK-NEXT:    %G = zext i16 %B to i3274; CHECK-NEXT:    --> ({0,+,1}<nuw><nsw><%loop> umax ((zext i2 (trunc i32 %y to i2) to i32) smax {0,+,1}<nuw><nsw><%loop>)) U: [0,21) S: [0,21) Exits: 20 LoopDispositions: { %loop: Computable }75; CHECK-NEXT:    %H = zext i16 %B to i3476; CHECK-NEXT:    --> ((zext i32 ((zext i2 (trunc i32 %y to i2) to i32) smax {0,+,1}<nuw><nsw><%loop>) to i34) umax {0,+,1}<nuw><nsw><%loop>) U: [0,21) S: [0,21) Exits: 20 LoopDispositions: { %loop: Computable }77; CHECK-NEXT:    %I = add i32 %A, 178; CHECK-NEXT:    --> {1,+,1}<nuw><nsw><%loop> U: [1,22) S: [1,22) Exits: 21 LoopDispositions: { %loop: Computable }79; CHECK-NEXT:  Determining loop execution counts for: @test480; CHECK-NEXT:  Loop %loop: backedge-taken count is i32 2081; CHECK-NEXT:  Loop %loop: constant max backedge-taken count is i32 2082; CHECK-NEXT:  Loop %loop: symbolic max backedge-taken count is i32 2083; CHECK-NEXT:  Loop %loop: Trip multiple is 2184;85entry:86  %Y = and i32 %y, 387  br label %loop88loop:89  %A = phi i32 [0, %entry], [%I, %loop]90  %rand1 = icmp sgt i32 %A, %Y91  %Z1 = select i1 %rand1, i32 %A, i32 %Y92  %rand2 = icmp ugt i32 %A, %Z193  %Z2 = select i1 %rand2, i32 %A, i32 %Z194  %B = trunc i32 %Z2 to i1695  %C = sext i16 %B to i3096  %D = sext i16 %B to i3297  %E = sext i16 %B to i3498  %F = zext i16 %B to i3099  %G = zext i16 %B to i32100  %H = zext i16 %B to i34101  %I = add i32 %A, 1102  %0 = icmp ne i32 %A, 20103  br i1 %0, label %loop, label %exit104exit:105  ret void106}107 108define void @test5(i32 %i) {109; CHECK-LABEL: 'test5'110; CHECK-NEXT:  Classifying expressions for: @test5111; CHECK-NEXT:    %A = and i32 %i, 1112; CHECK-NEXT:    --> (zext i1 (trunc i32 %i to i1) to i32) U: [0,2) S: [0,2)113; CHECK-NEXT:    %B = and i32 %i, 2114; CHECK-NEXT:    --> (2 * (zext i1 (trunc i32 (%i /u 2) to i1) to i32))<nuw><nsw> U: [0,3) S: [0,3)115; CHECK-NEXT:    %C = and i32 %i, 63116; CHECK-NEXT:    --> (zext i6 (trunc i32 %i to i6) to i32) U: [0,64) S: [0,64)117; CHECK-NEXT:    %D = and i32 %i, 126118; CHECK-NEXT:    --> (2 * (zext i6 (trunc i32 (%i /u 2) to i6) to i32))<nuw><nsw> U: [0,127) S: [0,127)119; CHECK-NEXT:    %E = and i32 %i, 64120; CHECK-NEXT:    --> (64 * (zext i1 (trunc i32 (%i /u 64) to i1) to i32))<nuw><nsw> U: [0,65) S: [0,65)121; CHECK-NEXT:    %F = and i32 %i, -2147483648122; CHECK-NEXT:    --> (-2147483648 * (%i /u -2147483648))<nuw><nsw> U: [0,-2147483647) S: [-2147483648,1)123; CHECK-NEXT:  Determining loop execution counts for: @test5124;125  %A = and i32 %i, 1126  %B = and i32 %i, 2127  %C = and i32 %i, 63128  %D = and i32 %i, 126129  %E = and i32 %i, 64130  %F = and i32 %i, -2147483648131  ret void132}133 134define void @test6(i8 %x) {135; CHECK-LABEL: 'test6'136; CHECK-NEXT:  Classifying expressions for: @test6137; CHECK-NEXT:    %A = zext i8 %x to i16138; CHECK-NEXT:    --> (zext i8 %x to i16) U: [0,256) S: [0,256)139; CHECK-NEXT:    %B = shl nuw i16 %A, 8140; CHECK-NEXT:    --> (256 * (zext i8 %x to i16))<nuw> U: [0,-255) S: [-32768,32513)141; CHECK-NEXT:    %C = and i16 %B, -2048142; CHECK-NEXT:    --> (2048 * ((zext i8 %x to i16) /u 8))<nuw> U: [0,-2047) S: [-32768,30721)143; CHECK-NEXT:  Determining loop execution counts for: @test6144;145  %A = zext i8 %x to i16146  %B = shl nuw i16 %A, 8147  %C = and i16 %B, -2048148  ret void149}150 151; PR22960152define void @test7(i32 %A) {153; CHECK-LABEL: 'test7'154; CHECK-NEXT:  Classifying expressions for: @test7155; CHECK-NEXT:    %B = sext i32 %A to i64156; CHECK-NEXT:    --> (sext i32 %A to i64) U: [-2147483648,2147483648) S: [-2147483648,2147483648)157; CHECK-NEXT:    %C = zext i32 %A to i64158; CHECK-NEXT:    --> (zext i32 %A to i64) U: [0,4294967296) S: [0,4294967296)159; CHECK-NEXT:    %D = sub i64 %B, %C160; CHECK-NEXT:    --> ((sext i32 %A to i64) + (-1 * (zext i32 %A to i64))<nsw>) U: [-6442450943,2147483648) S: [-6442450943,2147483648)161; CHECK-NEXT:    %E = trunc i64 %D to i16162; CHECK-NEXT:    --> 0 U: [0,1) S: [0,1)163; CHECK-NEXT:  Determining loop execution counts for: @test7164;165  %B = sext i32 %A to i64166  %C = zext i32 %A to i64167  %D = sub i64 %B, %C168  %E = trunc i64 %D to i16169  ret void170}171 172define i64 @test8(i64 %a) {173; CHECK-LABEL: 'test8'174; CHECK-NEXT:  Classifying expressions for: @test8175; CHECK-NEXT:    %t0 = udiv i64 %a, 56176; CHECK-NEXT:    --> (%a /u 56) U: [0,329406144173384851) S: [0,329406144173384851)177; CHECK-NEXT:    %t1 = udiv i64 %t0, 56178; CHECK-NEXT:    --> (%a /u 3136) U: [0,5882252574524730) S: [0,5882252574524730)179; CHECK-NEXT:  Determining loop execution counts for: @test8180;181  %t0 = udiv i64 %a, 56182  %t1 = udiv i64 %t0, 56183  ret i64 %t1184}185 186define i64 @test9(i64 %a) {187; CHECK-LABEL: 'test9'188; CHECK-NEXT:  Classifying expressions for: @test9189; CHECK-NEXT:    %t0 = udiv i64 %a, 100000000000000190; CHECK-NEXT:    --> (%a /u 100000000000000) U: [0,184468) S: [0,184468)191; CHECK-NEXT:    %t1 = udiv i64 %t0, 100000000000000192; CHECK-NEXT:    --> 0 U: [0,1) S: [0,1)193; CHECK-NEXT:  Determining loop execution counts for: @test9194;195  %t0 = udiv i64 %a, 100000000000000196  %t1 = udiv i64 %t0, 100000000000000197  ret i64 %t1198}199 200define i64 @test10(i64 %a, i64 %b) {201; CHECK-LABEL: 'test10'202; CHECK-NEXT:  Classifying expressions for: @test10203; CHECK-NEXT:    %t0 = udiv i64 %a, 100000000000000204; CHECK-NEXT:    --> (%a /u 100000000000000) U: [0,184468) S: [0,184468)205; CHECK-NEXT:    %t1 = udiv i64 %t0, 100000000000000206; CHECK-NEXT:    --> 0 U: [0,1) S: [0,1)207; CHECK-NEXT:    %t2 = mul i64 %b, %t1208; CHECK-NEXT:    --> 0 U: [0,1) S: [0,1)209; CHECK-NEXT:  Determining loop execution counts for: @test10210;211  %t0 = udiv i64 %a, 100000000000000212  %t1 = udiv i64 %t0, 100000000000000213  %t2 = mul i64 %b, %t1214  ret i64 %t2215}216 217define i64 @test11(i64 %a) {218; CHECK-LABEL: 'test11'219; CHECK-NEXT:  Classifying expressions for: @test11220; CHECK-NEXT:    %t0 = udiv i64 0, %a221; CHECK-NEXT:    --> 0 U: [0,1) S: [0,1)222; CHECK-NEXT:  Determining loop execution counts for: @test11223;224  %t0 = udiv i64 0, %a225  ret i64 %t0226}227