183 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 22; RUN: opt < %s -mtriple=riscv64 -mattr=+f,+d -disable-output -passes="print<cost-model>" 2>&1 | FileCheck %s3 4define i8 @phi_i8(i1 %c) {5; CHECK-LABEL: 'phi_i8'6; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b7; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d8; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d9; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi i8 [ 16, %a ], [ 32, %b ]10; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i8 %x11;12 br i1 %c, label %a, label %b13a:14 br label %d15b:16 br label %d17d:18 %x = phi i8 [16, %a], [32, %b]19 ret i8 %x20}21 22define i16 @phi_i16_small(i1 %c) {23; CHECK-LABEL: 'phi_i16_small'24; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b25; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d26; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d27; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi i16 [ 1, %a ], [ 2, %b ]28; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i16 %x29;30 br i1 %c, label %a, label %b31a:32 br label %d33b:34 br label %d35d:36 %x = phi i16 [1, %a], [2, %b]37 ret i16 %x38}39 40define i16 @phi_i16_large(i1 %c) {41; CHECK-LABEL: 'phi_i16_large'42; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b43; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d44; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d45; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi i16 [ 42, %a ], [ -7616, %b ]46; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i16 %x47;48 br i1 %c, label %a, label %b49a:50 br label %d51b:52 br label %d53d:54 %x = phi i16 [42, %a], [123456, %b]55 ret i16 %x56}57 58define i32 @phi_i32_small(i1 %c) {59; CHECK-LABEL: 'phi_i32_small'60; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b61; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d62; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d63; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi i32 [ 1, %a ], [ 2, %b ]64; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 %x65;66 br i1 %c, label %a, label %b67a:68 br label %d69b:70 br label %d71d:72 %x = phi i32 [1, %a], [2, %b]73 ret i32 %x74}75 76define i32 @phi_i32_large(i1 %c) {77; CHECK-LABEL: 'phi_i32_large'78; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b79; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d80; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d81; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi i32 [ 42, %a ], [ 123456, %b ]82; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 %x83;84 br i1 %c, label %a, label %b85a:86 br label %d87b:88 br label %d89d:90 %x = phi i32 [42, %a], [123456, %b]91 ret i32 %x92}93 94define i64 @phi_i64_small(i1 %c) {95; CHECK-LABEL: 'phi_i64_small'96; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b97; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d98; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d99; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi i64 [ 1, %a ], [ 2, %b ]100; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i64 %x101;102 br i1 %c, label %a, label %b103a:104 br label %d105b:106 br label %d107d:108 %x = phi i64 [1, %a], [2, %b]109 ret i64 %x110}111 112define i64 @phi_i64_large(i1 %c) {113; CHECK-LABEL: 'phi_i64_large'114; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b115; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d116; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d117; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi i64 [ 42, %a ], [ 123456, %b ]118; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i64 %x119;120 br i1 %c, label %a, label %b121a:122 br label %d123b:124 br label %d125d:126 %x = phi i64 [42, %a], [123456, %b]127 ret i64 %x128}129 130define half @phi_f16(i1 %c) {131; CHECK-LABEL: 'phi_f16'132; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b133; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d134; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d135; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi half [ 0xHE3CE, %a ], [ 0xH5144, %b ]136; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret half %x137;138 br i1 %c, label %a, label %b139a:140 br label %d141b:142 br label %d143d:144 %x = phi half [-999.0, %a], [42.125, %b]145 ret half %x146}147 148define float @phi_f32(i1 %c) {149; CHECK-LABEL: 'phi_f32'150; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b151; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d152; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d153; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi float [ -9.990000e+02, %a ], [ 4.212500e+01, %b ]154; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret float %x155;156 br i1 %c, label %a, label %b157a:158 br label %d159b:160 br label %d161d:162 %x = phi float [-999.0, %a], [42.125, %b]163 ret float %x164}165 166define double @phi_f64(i1 %c) {167; CHECK-LABEL: 'phi_f64'168; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br i1 %c, label %a, label %b169; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d170; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: br label %d171; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %x = phi double [ -9.990000e+02, %a ], [ 4.212500e+01, %b ]172; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret double %x173;174 br i1 %c, label %a, label %b175a:176 br label %d177b:178 br label %d179d:180 %x = phi double [-999.0, %a], [42.125, %b]181 ret double %x182}183