brintos

brintos / llvm-project-archived public Read only

0
0
Text · 8.8 KiB · 5029ef9 Raw
163 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 52; RUN: opt -passes="print<cost-model>" -cost-kind=all 2>&1 -disable-output -mtriple=aarch64--linux-gnu -mattr=+sve  < %s | FileCheck %s3 4target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"5 6; Check icmp for legal integer vectors.7define void @cmp_legal_int() {8; CHECK-LABEL: 'cmp_legal_int'9; CHECK-NEXT:  Cost Model: Found costs of 1 for: %1 = icmp ne <vscale x 2 x i64> undef, undef10; CHECK-NEXT:  Cost Model: Found costs of 1 for: %2 = icmp ne <vscale x 4 x i32> undef, undef11; CHECK-NEXT:  Cost Model: Found costs of 1 for: %3 = icmp ne <vscale x 8 x i16> undef, undef12; CHECK-NEXT:  Cost Model: Found costs of 1 for: %4 = icmp ne <vscale x 16 x i8> undef, undef13; CHECK-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void14;15  %1 = icmp ne <vscale x 2 x i64> undef, undef16  %2 = icmp ne <vscale x 4 x i32> undef, undef17  %3 = icmp ne <vscale x 8 x i16> undef, undef18  %4 = icmp ne <vscale x 16 x i8> undef, undef19  ret void20}21 22; Check icmp for an illegal integer vector.23define <vscale x 4 x i1> @cmp_nxv4i64() {24; CHECK-LABEL: 'cmp_nxv4i64'25; CHECK-NEXT:  Cost Model: Found costs of 2 for: %res = icmp ne <vscale x 4 x i64> undef, undef26; CHECK-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <vscale x 4 x i1> %res27;28  %res = icmp ne <vscale x 4 x i64> undef, undef29  ret <vscale x 4 x i1> %res30}31 32; Check icmp for legal predicate vectors.33define void @cmp_legal_pred() {34; CHECK-LABEL: 'cmp_legal_pred'35; CHECK-NEXT:  Cost Model: Found costs of 1 for: %1 = icmp ne <vscale x 2 x i1> undef, undef36; CHECK-NEXT:  Cost Model: Found costs of 1 for: %2 = icmp ne <vscale x 4 x i1> undef, undef37; CHECK-NEXT:  Cost Model: Found costs of 1 for: %3 = icmp ne <vscale x 8 x i1> undef, undef38; CHECK-NEXT:  Cost Model: Found costs of 1 for: %4 = icmp ne <vscale x 16 x i1> undef, undef39; CHECK-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void40;41  %1 = icmp ne <vscale x 2 x i1> undef, undef42  %2 = icmp ne <vscale x 4 x i1> undef, undef43  %3 = icmp ne <vscale x 8 x i1> undef, undef44  %4 = icmp ne <vscale x 16 x i1> undef, undef45  ret void46}47 48; Check icmp for an illegal predicate vector.49define <vscale x 32 x i1> @cmp_nxv32i1() {50; CHECK-LABEL: 'cmp_nxv32i1'51; CHECK-NEXT:  Cost Model: Found costs of 2 for: %res = icmp ne <vscale x 32 x i1> undef, undef52; CHECK-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <vscale x 32 x i1> %res53;54  %res = icmp ne <vscale x 32 x i1> undef, undef55  ret <vscale x 32 x i1> %res56}57 58; Check fcmp for legal FP vectors59define void @cmp_legal_fp() #0 {60; CHECK-LABEL: 'cmp_legal_fp'61; CHECK-NEXT:  Cost Model: Found costs of RThru:2 CodeSize:1 Lat:2 SizeLat:1 for: %1 = fcmp oge <vscale x 2 x double> undef, undef62; CHECK-NEXT:  Cost Model: Found costs of RThru:2 CodeSize:1 Lat:2 SizeLat:1 for: %2 = fcmp oge <vscale x 4 x float> undef, undef63; CHECK-NEXT:  Cost Model: Found costs of RThru:2 CodeSize:1 Lat:2 SizeLat:1 for: %3 = fcmp oge <vscale x 8 x half> undef, undef64; CHECK-NEXT:  Cost Model: Found costs of RThru:13 CodeSize:5 Lat:5 SizeLat:5 for: %4 = fcmp oge <vscale x 8 x bfloat> undef, undef65; CHECK-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void66;67  %1 = fcmp oge <vscale x 2 x double> undef, undef68  %2 = fcmp oge <vscale x 4 x float> undef, undef69  %3 = fcmp oge <vscale x 8 x half> undef, undef70  %4 = fcmp oge <vscale x 8 x bfloat> undef, undef71  ret void72}73 74; Check fcmp for an illegal FP vector75define <vscale x 16 x i1> @cmp_nxv16f16() {76; CHECK-LABEL: 'cmp_nxv16f16'77; CHECK-NEXT:  Cost Model: Found costs of RThru:4 CodeSize:2 Lat:2 SizeLat:2 for: %res = fcmp oge <vscale x 16 x half> undef, undef78; CHECK-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <vscale x 16 x i1> %res79;80  %res = fcmp oge <vscale x 16 x half> undef, undef81  ret <vscale x 16 x i1> %res82}83 84; Check select for legal integer vectors85define void @sel_legal_int() {86; CHECK-LABEL: 'sel_legal_int'87; CHECK-NEXT:  Cost Model: Found costs of 1 for: %1 = select <vscale x 2 x i1> undef, <vscale x 2 x i64> undef, <vscale x 2 x i64> undef88; CHECK-NEXT:  Cost Model: Found costs of 1 for: %2 = select <vscale x 4 x i1> undef, <vscale x 4 x i32> undef, <vscale x 4 x i32> undef89; CHECK-NEXT:  Cost Model: Found costs of 1 for: %3 = select <vscale x 8 x i1> undef, <vscale x 8 x i16> undef, <vscale x 8 x i16> undef90; CHECK-NEXT:  Cost Model: Found costs of 1 for: %4 = select <vscale x 16 x i1> undef, <vscale x 16 x i8> undef, <vscale x 16 x i8> undef91; CHECK-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void92;93  %1 = select <vscale x 2 x i1> undef, <vscale x 2 x i64> undef, <vscale x 2 x i64> undef94  %2 = select <vscale x 4 x i1> undef, <vscale x 4 x i32> undef, <vscale x 4 x i32> undef95  %3 = select <vscale x 8 x i1> undef, <vscale x 8 x i16> undef, <vscale x 8 x i16> undef96  %4 = select <vscale x 16 x i1> undef, <vscale x 16 x i8> undef, <vscale x 16 x i8> undef97  ret void98}99 100; Check select for an illegal integer vector101define <vscale x 16 x i16> @sel_nxv16i16() {102; CHECK-LABEL: 'sel_nxv16i16'103; CHECK-NEXT:  Cost Model: Found costs of 2 for: %res = select <vscale x 16 x i1> undef, <vscale x 16 x i16> undef, <vscale x 16 x i16> undef104; CHECK-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <vscale x 16 x i16> %res105;106  %res = select <vscale x 16 x i1> undef, <vscale x 16 x i16> undef, <vscale x 16 x i16> undef107  ret <vscale x 16 x i16> %res108}109 110; Check select for a legal FP vector111define void @sel_legal_fp() #0 {112; CHECK-LABEL: 'sel_legal_fp'113; CHECK-NEXT:  Cost Model: Found costs of 1 for: %1 = select <vscale x 2 x i1> undef, <vscale x 2 x double> undef, <vscale x 2 x double> undef114; CHECK-NEXT:  Cost Model: Found costs of 1 for: %2 = select <vscale x 4 x i1> undef, <vscale x 4 x float> undef, <vscale x 4 x float> undef115; CHECK-NEXT:  Cost Model: Found costs of 1 for: %3 = select <vscale x 8 x i1> undef, <vscale x 8 x half> undef, <vscale x 8 x half> undef116; CHECK-NEXT:  Cost Model: Found costs of 1 for: %4 = select <vscale x 8 x i1> undef, <vscale x 8 x bfloat> undef, <vscale x 8 x bfloat> undef117; CHECK-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void118;119  %1 = select <vscale x 2 x i1> undef, <vscale x 2 x double> undef, <vscale x 2 x double> undef120  %2 = select <vscale x 4 x i1> undef, <vscale x 4 x float> undef, <vscale x 4 x float> undef121  %3 = select <vscale x 8 x i1> undef, <vscale x 8 x half> undef, <vscale x 8 x half> undef122  %4 = select <vscale x 8 x i1> undef, <vscale x 8 x bfloat> undef, <vscale x 8 x bfloat> undef123  ret void124}125 126; Check select for an illegal FP vector127define <vscale x 8 x float> @sel_nxv8f32() {128; CHECK-LABEL: 'sel_nxv8f32'129; CHECK-NEXT:  Cost Model: Found costs of 2 for: %res = select <vscale x 8 x i1> undef, <vscale x 8 x float> undef, <vscale x 8 x float> undef130; CHECK-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <vscale x 8 x float> %res131;132  %res = select <vscale x 8 x i1> undef, <vscale x 8 x float> undef, <vscale x 8 x float> undef133  ret <vscale x 8 x float> %res134}135 136; Check select for a legal predicate vector137define void @sel_legal_pred() {138; CHECK-LABEL: 'sel_legal_pred'139; CHECK-NEXT:  Cost Model: Found costs of 1 for: %1 = select <vscale x 2 x i1> undef, <vscale x 2 x i1> undef, <vscale x 2 x i1> undef140; CHECK-NEXT:  Cost Model: Found costs of 1 for: %2 = select <vscale x 4 x i1> undef, <vscale x 4 x i1> undef, <vscale x 4 x i1> undef141; CHECK-NEXT:  Cost Model: Found costs of 1 for: %3 = select <vscale x 8 x i1> undef, <vscale x 8 x i1> undef, <vscale x 8 x i1> undef142; CHECK-NEXT:  Cost Model: Found costs of 1 for: %4 = select <vscale x 16 x i1> undef, <vscale x 16 x i1> undef, <vscale x 16 x i1> undef143; CHECK-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void144;145  %1 = select <vscale x 2 x i1> undef, <vscale x 2 x i1> undef, <vscale x 2 x i1> undef146  %2 = select <vscale x 4 x i1> undef, <vscale x 4 x i1> undef, <vscale x 4 x i1> undef147  %3 = select <vscale x 8 x i1> undef, <vscale x 8 x i1> undef, <vscale x 8 x i1> undef148  %4 = select <vscale x 16 x i1> undef, <vscale x 16 x i1> undef, <vscale x 16 x i1> undef149  ret void150}151 152; Check select for an illegal predicate vector153define <vscale x 32 x i1> @sel_nxv32i1() {154; CHECK-LABEL: 'sel_nxv32i1'155; CHECK-NEXT:  Cost Model: Found costs of 2 for: %res = select <vscale x 32 x i1> undef, <vscale x 32 x i1> undef, <vscale x 32 x i1> undef156; CHECK-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <vscale x 32 x i1> %res157;158  %res = select <vscale x 32 x i1> undef, <vscale x 32 x i1> undef, <vscale x 32 x i1> undef159  ret <vscale x 32 x i1> %res160}161 162attributes #0 = { "target-features"="+sve,+bf16" }163