175 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py2; RUN: opt -passes="print<cost-model>" -cost-kind=all 2>&1 -disable-output -mtriple=thumbv8.1m.main-none-eabi -mattr=+mve.fp < %s | FileCheck %s --check-prefix=CHECK-MVE3; RUN: opt -passes="print<cost-model>" -cost-kind=all 2>&1 -disable-output -mtriple=thumbv8m.main-none-eabi < %s | FileCheck %s --check-prefix=CHECK-V8M-MAIN4; RUN: opt -passes="print<cost-model>" -cost-kind=all 2>&1 -disable-output -mtriple=thumbv8m.base-none-eabi < %s | FileCheck %s --check-prefix=CHECK-V8M-BASE5; RUN: opt -passes="print<cost-model>" -cost-kind=all 2>&1 -disable-output -mtriple=armv8r-none-eabi -mattr=+neon,+fp-armv8 < %s | FileCheck %s --check-prefix=CHECK-V8R6 7target datalayout = "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64"8 9define i32 @cmps() {10; CHECK-MVE-LABEL: 'cmps'11; CHECK-MVE-NEXT: Cost Model: Found costs of 1 for: %a = icmp slt i8 undef, undef12; CHECK-MVE-NEXT: Cost Model: Found costs of 1 for: %b = icmp ult i16 undef, undef13; CHECK-MVE-NEXT: Cost Model: Found costs of 1 for: %c = icmp sge i32 undef, undef14; CHECK-MVE-NEXT: Cost Model: Found costs of 1 for: %d = icmp ne i64 undef, undef15; CHECK-MVE-NEXT: Cost Model: Found costs of RThru:2 CodeSize:1 Lat:2 SizeLat:2 for: %e = icmp slt <16 x i8> undef, undef16; CHECK-MVE-NEXT: Cost Model: Found costs of RThru:2 CodeSize:1 Lat:2 SizeLat:2 for: %f = icmp ult <8 x i16> undef, undef17; CHECK-MVE-NEXT: Cost Model: Found costs of RThru:2 CodeSize:1 Lat:2 SizeLat:2 for: %g = icmp sge <4 x i32> undef, undef18; CHECK-MVE-NEXT: Cost Model: Found costs of 1 for: %a7 = fcmp oge half undef, undef19; CHECK-MVE-NEXT: Cost Model: Found costs of 1 for: %a8 = fcmp ogt float undef, undef20; CHECK-MVE-NEXT: Cost Model: Found costs of 1 for: %a9 = fcmp ogt double undef, undef21; CHECK-MVE-NEXT: Cost Model: Found costs of RThru:2 CodeSize:1 Lat:2 SizeLat:2 for: %a10 = fcmp olt <8 x half> undef, undef22; CHECK-MVE-NEXT: Cost Model: Found costs of RThru:2 CodeSize:1 Lat:2 SizeLat:2 for: %a11 = fcmp oge <4 x float> undef, undef23; CHECK-MVE-NEXT: Cost Model: Found costs of RThru:8 CodeSize:4 Lat:8 SizeLat:8 for: %a12 = fcmp oge <2 x double> undef, undef24; CHECK-MVE-NEXT: Cost Model: Found costs of 1 for: %p = icmp eq ptr undef, undef25; CHECK-MVE-NEXT: Cost Model: Found costs of RThru:2 CodeSize:1 Lat:2 SizeLat:2 for: %q = icmp eq <4 x ptr> undef, undef26; CHECK-MVE-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret i32 undef27;28; CHECK-V8M-MAIN-LABEL: 'cmps'29; CHECK-V8M-MAIN-NEXT: Cost Model: Found costs of 1 for: %a = icmp slt i8 undef, undef30; CHECK-V8M-MAIN-NEXT: Cost Model: Found costs of 1 for: %b = icmp ult i16 undef, undef31; CHECK-V8M-MAIN-NEXT: Cost Model: Found costs of 1 for: %c = icmp sge i32 undef, undef32; CHECK-V8M-MAIN-NEXT: Cost Model: Found costs of 1 for: %d = icmp ne i64 undef, undef33; CHECK-V8M-MAIN-NEXT: Cost Model: Found costs of 32 for: %e = icmp slt <16 x i8> undef, undef34; CHECK-V8M-MAIN-NEXT: Cost Model: Found costs of 16 for: %f = icmp ult <8 x i16> undef, undef35; CHECK-V8M-MAIN-NEXT: Cost Model: Found costs of 8 for: %g = icmp sge <4 x i32> undef, undef36; CHECK-V8M-MAIN-NEXT: Cost Model: Found costs of 1 for: %a7 = fcmp oge half undef, undef37; CHECK-V8M-MAIN-NEXT: Cost Model: Found costs of 1 for: %a8 = fcmp ogt float undef, undef38; CHECK-V8M-MAIN-NEXT: Cost Model: Found costs of 1 for: %a9 = fcmp ogt double undef, undef39; CHECK-V8M-MAIN-NEXT: Cost Model: Found costs of 16 for: %a10 = fcmp olt <8 x half> undef, undef40; CHECK-V8M-MAIN-NEXT: Cost Model: Found costs of 8 for: %a11 = fcmp oge <4 x float> undef, undef41; CHECK-V8M-MAIN-NEXT: Cost Model: Found costs of 6 for: %a12 = fcmp oge <2 x double> undef, undef42; CHECK-V8M-MAIN-NEXT: Cost Model: Found costs of 1 for: %p = icmp eq ptr undef, undef43; CHECK-V8M-MAIN-NEXT: Cost Model: Found costs of 8 for: %q = icmp eq <4 x ptr> undef, undef44; CHECK-V8M-MAIN-NEXT: Cost Model: Found costs of 1 for: ret i32 undef45;46; CHECK-V8M-BASE-LABEL: 'cmps'47; CHECK-V8M-BASE-NEXT: Cost Model: Found costs of 1 for: %a = icmp slt i8 undef, undef48; CHECK-V8M-BASE-NEXT: Cost Model: Found costs of 1 for: %b = icmp ult i16 undef, undef49; CHECK-V8M-BASE-NEXT: Cost Model: Found costs of 1 for: %c = icmp sge i32 undef, undef50; CHECK-V8M-BASE-NEXT: Cost Model: Found costs of 1 for: %d = icmp ne i64 undef, undef51; CHECK-V8M-BASE-NEXT: Cost Model: Found costs of 32 for: %e = icmp slt <16 x i8> undef, undef52; CHECK-V8M-BASE-NEXT: Cost Model: Found costs of 16 for: %f = icmp ult <8 x i16> undef, undef53; CHECK-V8M-BASE-NEXT: Cost Model: Found costs of 8 for: %g = icmp sge <4 x i32> undef, undef54; CHECK-V8M-BASE-NEXT: Cost Model: Found costs of 1 for: %a7 = fcmp oge half undef, undef55; CHECK-V8M-BASE-NEXT: Cost Model: Found costs of 1 for: %a8 = fcmp ogt float undef, undef56; CHECK-V8M-BASE-NEXT: Cost Model: Found costs of 1 for: %a9 = fcmp ogt double undef, undef57; CHECK-V8M-BASE-NEXT: Cost Model: Found costs of 16 for: %a10 = fcmp olt <8 x half> undef, undef58; CHECK-V8M-BASE-NEXT: Cost Model: Found costs of 8 for: %a11 = fcmp oge <4 x float> undef, undef59; CHECK-V8M-BASE-NEXT: Cost Model: Found costs of 6 for: %a12 = fcmp oge <2 x double> undef, undef60; CHECK-V8M-BASE-NEXT: Cost Model: Found costs of 1 for: %p = icmp eq ptr undef, undef61; CHECK-V8M-BASE-NEXT: Cost Model: Found costs of 8 for: %q = icmp eq <4 x ptr> undef, undef62; CHECK-V8M-BASE-NEXT: Cost Model: Found costs of 1 for: ret i32 undef63;64; CHECK-V8R-LABEL: 'cmps'65; CHECK-V8R-NEXT: Cost Model: Found costs of 1 for: %a = icmp slt i8 undef, undef66; CHECK-V8R-NEXT: Cost Model: Found costs of 1 for: %b = icmp ult i16 undef, undef67; CHECK-V8R-NEXT: Cost Model: Found costs of 1 for: %c = icmp sge i32 undef, undef68; CHECK-V8R-NEXT: Cost Model: Found costs of 1 for: %d = icmp ne i64 undef, undef69; CHECK-V8R-NEXT: Cost Model: Found costs of 1 for: %e = icmp slt <16 x i8> undef, undef70; CHECK-V8R-NEXT: Cost Model: Found costs of 1 for: %f = icmp ult <8 x i16> undef, undef71; CHECK-V8R-NEXT: Cost Model: Found costs of 1 for: %g = icmp sge <4 x i32> undef, undef72; CHECK-V8R-NEXT: Cost Model: Found costs of 1 for: %a7 = fcmp oge half undef, undef73; CHECK-V8R-NEXT: Cost Model: Found costs of 1 for: %a8 = fcmp ogt float undef, undef74; CHECK-V8R-NEXT: Cost Model: Found costs of 1 for: %a9 = fcmp ogt double undef, undef75; CHECK-V8R-NEXT: Cost Model: Found costs of 24 for: %a10 = fcmp olt <8 x half> undef, undef76; CHECK-V8R-NEXT: Cost Model: Found costs of 1 for: %a11 = fcmp oge <4 x float> undef, undef77; CHECK-V8R-NEXT: Cost Model: Found costs of 4 for: %a12 = fcmp oge <2 x double> undef, undef78; CHECK-V8R-NEXT: Cost Model: Found costs of 1 for: %p = icmp eq ptr undef, undef79; CHECK-V8R-NEXT: Cost Model: Found costs of 1 for: %q = icmp eq <4 x ptr> undef, undef80; CHECK-V8R-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret i32 undef81;82 %a = icmp slt i8 undef, undef83 %b = icmp ult i16 undef, undef84 %c = icmp sge i32 undef, undef85 %d = icmp ne i64 undef, undef86 %e = icmp slt <16 x i8> undef, undef87 %f = icmp ult <8 x i16> undef, undef88 %g = icmp sge <4 x i32> undef, undef89 %a7 = fcmp oge half undef, undef90 %a8 = fcmp ogt float undef, undef91 %a9 = fcmp ogt double undef, undef92 %a10 = fcmp olt <8 x half> undef, undef93 %a11 = fcmp oge <4 x float> undef, undef94 %a12 = fcmp oge <2 x double> undef, undef95 %p = icmp eq ptr undef, undef96 %q = icmp eq <4 x ptr> undef, undef97 ret i32 undef98}99 100define void @minmax() {101; CHECK-MVE-LABEL: 'minmax'102; CHECK-MVE-NEXT: Cost Model: Found costs of 1 for: %c1 = icmp slt i8 undef, undef103; CHECK-MVE-NEXT: Cost Model: Found costs of RThru:1 CodeSize:2 Lat:1 SizeLat:1 for: %s1 = select i1 %c1, i8 undef, i8 undef104; CHECK-MVE-NEXT: Cost Model: Found costs of 1 for: %c2 = icmp slt i16 undef, undef105; CHECK-MVE-NEXT: Cost Model: Found costs of RThru:1 CodeSize:2 Lat:1 SizeLat:1 for: %s2 = select i1 %c2, i16 undef, i16 undef106; CHECK-MVE-NEXT: Cost Model: Found costs of 1 for: %c3 = icmp slt i32 undef, undef107; CHECK-MVE-NEXT: Cost Model: Found costs of RThru:1 CodeSize:2 Lat:1 SizeLat:1 for: %s3 = select i1 %c3, i32 undef, i32 undef108; CHECK-MVE-NEXT: Cost Model: Found costs of 0 for: %c4 = icmp slt <4 x i32> undef, undef109; CHECK-MVE-NEXT: Cost Model: Found costs of RThru:2 CodeSize:1 Lat:2 SizeLat:2 for: %s4 = select <4 x i1> %c4, <4 x i32> undef, <4 x i32> undef110; CHECK-MVE-NEXT: Cost Model: Found costs of 1 for: %c5 = icmp slt ptr undef, undef111; CHECK-MVE-NEXT: Cost Model: Found costs of RThru:1 CodeSize:2 Lat:1 SizeLat:1 for: %s5 = select i1 %c5, ptr undef, ptr undef112; CHECK-MVE-NEXT: Cost Model: Found costs of RThru:2 CodeSize:1 Lat:2 SizeLat:2 for: %c6 = icmp slt <4 x ptr> undef, undef113; CHECK-MVE-NEXT: Cost Model: Found costs of RThru:2 CodeSize:1 Lat:2 SizeLat:2 for: %s6 = select <4 x i1> %c6, <4 x ptr> undef, <4 x ptr> undef114; CHECK-MVE-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void115;116; CHECK-V8M-MAIN-LABEL: 'minmax'117; CHECK-V8M-MAIN-NEXT: Cost Model: Found costs of 1 for: %c1 = icmp slt i8 undef, undef118; CHECK-V8M-MAIN-NEXT: Cost Model: Found costs of RThru:1 CodeSize:2 Lat:1 SizeLat:1 for: %s1 = select i1 %c1, i8 undef, i8 undef119; CHECK-V8M-MAIN-NEXT: Cost Model: Found costs of 1 for: %c2 = icmp slt i16 undef, undef120; CHECK-V8M-MAIN-NEXT: Cost Model: Found costs of RThru:1 CodeSize:2 Lat:1 SizeLat:1 for: %s2 = select i1 %c2, i16 undef, i16 undef121; CHECK-V8M-MAIN-NEXT: Cost Model: Found costs of 1 for: %c3 = icmp slt i32 undef, undef122; CHECK-V8M-MAIN-NEXT: Cost Model: Found costs of RThru:1 CodeSize:2 Lat:1 SizeLat:1 for: %s3 = select i1 %c3, i32 undef, i32 undef123; CHECK-V8M-MAIN-NEXT: Cost Model: Found costs of 0 for: %c4 = icmp slt <4 x i32> undef, undef124; CHECK-V8M-MAIN-NEXT: Cost Model: Found costs of RThru:16 CodeSize:20 Lat:16 SizeLat:16 for: %s4 = select <4 x i1> %c4, <4 x i32> undef, <4 x i32> undef125; CHECK-V8M-MAIN-NEXT: Cost Model: Found costs of 1 for: %c5 = icmp slt ptr undef, undef126; CHECK-V8M-MAIN-NEXT: Cost Model: Found costs of RThru:1 CodeSize:2 Lat:1 SizeLat:1 for: %s5 = select i1 %c5, ptr undef, ptr undef127; CHECK-V8M-MAIN-NEXT: Cost Model: Found costs of 8 for: %c6 = icmp slt <4 x ptr> undef, undef128; CHECK-V8M-MAIN-NEXT: Cost Model: Found costs of RThru:8 CodeSize:12 Lat:8 SizeLat:8 for: %s6 = select <4 x i1> %c6, <4 x ptr> undef, <4 x ptr> undef129; CHECK-V8M-MAIN-NEXT: Cost Model: Found costs of 1 for: ret void130;131; CHECK-V8M-BASE-LABEL: 'minmax'132; CHECK-V8M-BASE-NEXT: Cost Model: Found costs of 1 for: %c1 = icmp slt i8 undef, undef133; CHECK-V8M-BASE-NEXT: Cost Model: Found costs of RThru:1 CodeSize:2 Lat:1 SizeLat:1 for: %s1 = select i1 %c1, i8 undef, i8 undef134; CHECK-V8M-BASE-NEXT: Cost Model: Found costs of 1 for: %c2 = icmp slt i16 undef, undef135; CHECK-V8M-BASE-NEXT: Cost Model: Found costs of RThru:1 CodeSize:2 Lat:1 SizeLat:1 for: %s2 = select i1 %c2, i16 undef, i16 undef136; CHECK-V8M-BASE-NEXT: Cost Model: Found costs of 1 for: %c3 = icmp slt i32 undef, undef137; CHECK-V8M-BASE-NEXT: Cost Model: Found costs of RThru:1 CodeSize:2 Lat:1 SizeLat:1 for: %s3 = select i1 %c3, i32 undef, i32 undef138; CHECK-V8M-BASE-NEXT: Cost Model: Found costs of 0 for: %c4 = icmp slt <4 x i32> undef, undef139; CHECK-V8M-BASE-NEXT: Cost Model: Found costs of RThru:16 CodeSize:20 Lat:16 SizeLat:16 for: %s4 = select <4 x i1> %c4, <4 x i32> undef, <4 x i32> undef140; CHECK-V8M-BASE-NEXT: Cost Model: Found costs of 1 for: %c5 = icmp slt ptr undef, undef141; CHECK-V8M-BASE-NEXT: Cost Model: Found costs of RThru:1 CodeSize:2 Lat:1 SizeLat:1 for: %s5 = select i1 %c5, ptr undef, ptr undef142; CHECK-V8M-BASE-NEXT: Cost Model: Found costs of 8 for: %c6 = icmp slt <4 x ptr> undef, undef143; CHECK-V8M-BASE-NEXT: Cost Model: Found costs of RThru:8 CodeSize:12 Lat:8 SizeLat:8 for: %s6 = select <4 x i1> %c6, <4 x ptr> undef, <4 x ptr> undef144; CHECK-V8M-BASE-NEXT: Cost Model: Found costs of 1 for: ret void145;146; CHECK-V8R-LABEL: 'minmax'147; CHECK-V8R-NEXT: Cost Model: Found costs of 1 for: %c1 = icmp slt i8 undef, undef148; CHECK-V8R-NEXT: Cost Model: Found costs of 1 for: %s1 = select i1 %c1, i8 undef, i8 undef149; CHECK-V8R-NEXT: Cost Model: Found costs of 1 for: %c2 = icmp slt i16 undef, undef150; CHECK-V8R-NEXT: Cost Model: Found costs of 1 for: %s2 = select i1 %c2, i16 undef, i16 undef151; CHECK-V8R-NEXT: Cost Model: Found costs of 1 for: %c3 = icmp slt i32 undef, undef152; CHECK-V8R-NEXT: Cost Model: Found costs of 1 for: %s3 = select i1 %c3, i32 undef, i32 undef153; CHECK-V8R-NEXT: Cost Model: Found costs of 0 for: %c4 = icmp slt <4 x i32> undef, undef154; CHECK-V8R-NEXT: Cost Model: Found costs of 1 for: %s4 = select <4 x i1> %c4, <4 x i32> undef, <4 x i32> undef155; CHECK-V8R-NEXT: Cost Model: Found costs of 1 for: %c5 = icmp slt ptr undef, undef156; CHECK-V8R-NEXT: Cost Model: Found costs of 1 for: %s5 = select i1 %c5, ptr undef, ptr undef157; CHECK-V8R-NEXT: Cost Model: Found costs of 1 for: %c6 = icmp slt <4 x ptr> undef, undef158; CHECK-V8R-NEXT: Cost Model: Found costs of 1 for: %s6 = select <4 x i1> %c6, <4 x ptr> undef, <4 x ptr> undef159; CHECK-V8R-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void160;161 %c1 = icmp slt i8 undef, undef162 %s1 = select i1 %c1, i8 undef, i8 undef163 %c2 = icmp slt i16 undef, undef164 %s2 = select i1 %c2, i16 undef, i16 undef165 %c3 = icmp slt i32 undef, undef166 %s3 = select i1 %c3, i32 undef, i32 undef167 %c4 = icmp slt <4 x i32> undef, undef168 %s4 = select <4 x i1> %c4, <4 x i32> undef, <4 x i32> undef169 %c5 = icmp slt ptr undef, undef170 %s5 = select i1 %c5, ptr undef, ptr undef171 %c6 = icmp slt <4 x ptr> undef, undef172 %s6 = select <4 x i1> %c6, <4 x ptr> undef, <4 x ptr> undef173 ret void174}175