1; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py 2; RUN: opt -cost-model -analyze -mtriple=thumbv8.1m.main-none-eabi -mattr=+mve.fp < %s | FileCheck %s --check-prefix=CHECK-MVE-RECIP 3; RUN: opt -cost-model -analyze -mtriple=thumbv8m.main-none-eabi < %s | FileCheck %s --check-prefix=CHECK-V8M-MAIN-RECIP 4; RUN: opt -cost-model -analyze -mtriple=thumbv8m.base-none-eabi < %s | FileCheck %s --check-prefix=CHECK-V8M-BASE-RECIP 5; RUN: opt -cost-model -analyze -mtriple=armv8r-none-eabi < %s | FileCheck %s --check-prefix=CHECK-V8R-RECIP 6; RUN: opt -cost-model -analyze -cost-kind=code-size -mtriple=thumbv8.1m.main-none-eabi -mattr=+mve.fp < %s | FileCheck %s --check-prefix=CHECK-MVE-SIZE 7; RUN: opt -cost-model -analyze -cost-kind=code-size -mtriple=thumbv8m.main-none-eabi < %s | FileCheck %s --check-prefix=CHECK-V8M-MAIN-SIZE 8; RUN: opt -cost-model -analyze -cost-kind=code-size -mtriple=thumbv8m.base-none-eabi < %s | FileCheck %s --check-prefix=CHECK-V8M-BASE-SIZE 9; RUN: opt -cost-model -analyze -cost-kind=code-size -mtriple=armv8r-none-eabi < %s | FileCheck %s --check-prefix=CHECK-V8R-SIZE 10 11define i32 @cmps() { 12; CHECK-MVE-RECIP-LABEL: 'cmps' 13; CHECK-MVE-RECIP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a = icmp slt i8 undef, undef 14; CHECK-MVE-RECIP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %b = icmp ult i16 undef, undef 15; CHECK-MVE-RECIP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c = icmp sge i32 undef, undef 16; CHECK-MVE-RECIP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %d = icmp ne i64 undef, undef 17; CHECK-MVE-RECIP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %e = icmp slt <16 x i8> undef, undef 18; CHECK-MVE-RECIP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %f = icmp ult <8 x i16> undef, undef 19; CHECK-MVE-RECIP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %g = icmp sge <4 x i32> undef, undef 20; CHECK-MVE-RECIP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a7 = fcmp oge half undef, undef 21; CHECK-MVE-RECIP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a8 = fcmp ogt float undef, undef 22; CHECK-MVE-RECIP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a9 = fcmp ogt double undef, undef 23; CHECK-MVE-RECIP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %a10 = fcmp olt <8 x half> undef, undef 24; CHECK-MVE-RECIP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %a11 = fcmp oge <4 x float> undef, undef 25; CHECK-MVE-RECIP-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %a12 = fcmp oge <2 x double> undef, undef 26; CHECK-MVE-RECIP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef 27; 28; CHECK-V8M-MAIN-RECIP-LABEL: 'cmps' 29; CHECK-V8M-MAIN-RECIP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a = icmp slt i8 undef, undef 30; CHECK-V8M-MAIN-RECIP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %b = icmp ult i16 undef, undef 31; CHECK-V8M-MAIN-RECIP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c = icmp sge i32 undef, undef 32; CHECK-V8M-MAIN-RECIP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %d = icmp ne i64 undef, undef 33; CHECK-V8M-MAIN-RECIP-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %e = icmp slt <16 x i8> undef, undef 34; CHECK-V8M-MAIN-RECIP-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %f = icmp ult <8 x i16> undef, undef 35; CHECK-V8M-MAIN-RECIP-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %g = icmp sge <4 x i32> undef, undef 36; CHECK-V8M-MAIN-RECIP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a7 = fcmp oge half undef, undef 37; CHECK-V8M-MAIN-RECIP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a8 = fcmp ogt float undef, undef 38; CHECK-V8M-MAIN-RECIP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a9 = fcmp ogt double undef, undef 39; CHECK-V8M-MAIN-RECIP-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %a10 = fcmp olt <8 x half> undef, undef 40; CHECK-V8M-MAIN-RECIP-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %a11 = fcmp oge <4 x float> undef, undef 41; CHECK-V8M-MAIN-RECIP-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %a12 = fcmp oge <2 x double> undef, undef 42; CHECK-V8M-MAIN-RECIP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i32 undef 43; 44; CHECK-V8M-BASE-RECIP-LABEL: 'cmps' 45; CHECK-V8M-BASE-RECIP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a = icmp slt i8 undef, undef 46; CHECK-V8M-BASE-RECIP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %b = icmp ult i16 undef, undef 47; CHECK-V8M-BASE-RECIP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c = icmp sge i32 undef, undef 48; CHECK-V8M-BASE-RECIP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %d = icmp ne i64 undef, undef 49; CHECK-V8M-BASE-RECIP-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %e = icmp slt <16 x i8> undef, undef 50; CHECK-V8M-BASE-RECIP-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %f = icmp ult <8 x i16> undef, undef 51; CHECK-V8M-BASE-RECIP-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %g = icmp sge <4 x i32> undef, undef 52; CHECK-V8M-BASE-RECIP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a7 = fcmp oge half undef, undef 53; CHECK-V8M-BASE-RECIP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a8 = fcmp ogt float undef, undef 54; CHECK-V8M-BASE-RECIP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a9 = fcmp ogt double undef, undef 55; CHECK-V8M-BASE-RECIP-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %a10 = fcmp olt <8 x half> undef, undef 56; CHECK-V8M-BASE-RECIP-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %a11 = fcmp oge <4 x float> undef, undef 57; CHECK-V8M-BASE-RECIP-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %a12 = fcmp oge <2 x double> undef, undef 58; CHECK-V8M-BASE-RECIP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i32 undef 59; 60; CHECK-V8R-RECIP-LABEL: 'cmps' 61; CHECK-V8R-RECIP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a = icmp slt i8 undef, undef 62; CHECK-V8R-RECIP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %b = icmp ult i16 undef, undef 63; CHECK-V8R-RECIP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c = icmp sge i32 undef, undef 64; CHECK-V8R-RECIP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %d = icmp ne i64 undef, undef 65; CHECK-V8R-RECIP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %e = icmp slt <16 x i8> undef, undef 66; CHECK-V8R-RECIP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %f = icmp ult <8 x i16> undef, undef 67; CHECK-V8R-RECIP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %g = icmp sge <4 x i32> undef, undef 68; CHECK-V8R-RECIP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a7 = fcmp oge half undef, undef 69; CHECK-V8R-RECIP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a8 = fcmp ogt float undef, undef 70; CHECK-V8R-RECIP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a9 = fcmp ogt double undef, undef 71; CHECK-V8R-RECIP-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %a10 = fcmp olt <8 x half> undef, undef 72; CHECK-V8R-RECIP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a11 = fcmp oge <4 x float> undef, undef 73; CHECK-V8R-RECIP-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %a12 = fcmp oge <2 x double> undef, undef 74; CHECK-V8R-RECIP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef 75; 76; CHECK-MVE-SIZE-LABEL: 'cmps' 77; CHECK-MVE-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a = icmp slt i8 undef, undef 78; CHECK-MVE-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %b = icmp ult i16 undef, undef 79; CHECK-MVE-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c = icmp sge i32 undef, undef 80; CHECK-MVE-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %d = icmp ne i64 undef, undef 81; CHECK-MVE-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %e = icmp slt <16 x i8> undef, undef 82; CHECK-MVE-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %f = icmp ult <8 x i16> undef, undef 83; CHECK-MVE-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %g = icmp sge <4 x i32> undef, undef 84; CHECK-MVE-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a7 = fcmp oge half undef, undef 85; CHECK-MVE-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a8 = fcmp ogt float undef, undef 86; CHECK-MVE-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a9 = fcmp ogt double undef, undef 87; CHECK-MVE-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a10 = fcmp olt <8 x half> undef, undef 88; CHECK-MVE-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a11 = fcmp oge <4 x float> undef, undef 89; CHECK-MVE-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a12 = fcmp oge <2 x double> undef, undef 90; CHECK-MVE-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i32 undef 91; 92; CHECK-V8M-MAIN-SIZE-LABEL: 'cmps' 93; CHECK-V8M-MAIN-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a = icmp slt i8 undef, undef 94; CHECK-V8M-MAIN-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %b = icmp ult i16 undef, undef 95; CHECK-V8M-MAIN-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c = icmp sge i32 undef, undef 96; CHECK-V8M-MAIN-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %d = icmp ne i64 undef, undef 97; CHECK-V8M-MAIN-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %e = icmp slt <16 x i8> undef, undef 98; CHECK-V8M-MAIN-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %f = icmp ult <8 x i16> undef, undef 99; CHECK-V8M-MAIN-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %g = icmp sge <4 x i32> undef, undef 100; CHECK-V8M-MAIN-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a7 = fcmp oge half undef, undef 101; CHECK-V8M-MAIN-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a8 = fcmp ogt float undef, undef 102; CHECK-V8M-MAIN-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a9 = fcmp ogt double undef, undef 103; CHECK-V8M-MAIN-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a10 = fcmp olt <8 x half> undef, undef 104; CHECK-V8M-MAIN-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a11 = fcmp oge <4 x float> undef, undef 105; CHECK-V8M-MAIN-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a12 = fcmp oge <2 x double> undef, undef 106; CHECK-V8M-MAIN-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i32 undef 107; 108; CHECK-V8M-BASE-SIZE-LABEL: 'cmps' 109; CHECK-V8M-BASE-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a = icmp slt i8 undef, undef 110; CHECK-V8M-BASE-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %b = icmp ult i16 undef, undef 111; CHECK-V8M-BASE-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c = icmp sge i32 undef, undef 112; CHECK-V8M-BASE-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %d = icmp ne i64 undef, undef 113; CHECK-V8M-BASE-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %e = icmp slt <16 x i8> undef, undef 114; CHECK-V8M-BASE-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %f = icmp ult <8 x i16> undef, undef 115; CHECK-V8M-BASE-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %g = icmp sge <4 x i32> undef, undef 116; CHECK-V8M-BASE-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a7 = fcmp oge half undef, undef 117; CHECK-V8M-BASE-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a8 = fcmp ogt float undef, undef 118; CHECK-V8M-BASE-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a9 = fcmp ogt double undef, undef 119; CHECK-V8M-BASE-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a10 = fcmp olt <8 x half> undef, undef 120; CHECK-V8M-BASE-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a11 = fcmp oge <4 x float> undef, undef 121; CHECK-V8M-BASE-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a12 = fcmp oge <2 x double> undef, undef 122; CHECK-V8M-BASE-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i32 undef 123; 124; CHECK-V8R-SIZE-LABEL: 'cmps' 125; CHECK-V8R-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a = icmp slt i8 undef, undef 126; CHECK-V8R-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %b = icmp ult i16 undef, undef 127; CHECK-V8R-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %c = icmp sge i32 undef, undef 128; CHECK-V8R-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %d = icmp ne i64 undef, undef 129; CHECK-V8R-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %e = icmp slt <16 x i8> undef, undef 130; CHECK-V8R-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %f = icmp ult <8 x i16> undef, undef 131; CHECK-V8R-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %g = icmp sge <4 x i32> undef, undef 132; CHECK-V8R-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a7 = fcmp oge half undef, undef 133; CHECK-V8R-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a8 = fcmp ogt float undef, undef 134; CHECK-V8R-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a9 = fcmp ogt double undef, undef 135; CHECK-V8R-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a10 = fcmp olt <8 x half> undef, undef 136; CHECK-V8R-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a11 = fcmp oge <4 x float> undef, undef 137; CHECK-V8R-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %a12 = fcmp oge <2 x double> undef, undef 138; CHECK-V8R-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i32 undef 139; 140 %a = icmp slt i8 undef, undef 141 %b = icmp ult i16 undef, undef 142 %c = icmp sge i32 undef, undef 143 %d = icmp ne i64 undef, undef 144 %e = icmp slt <16 x i8> undef, undef 145 %f = icmp ult <8 x i16> undef, undef 146 %g = icmp sge <4 x i32> undef, undef 147 %a7 = fcmp oge half undef, undef 148 %a8 = fcmp ogt float undef, undef 149 %a9 = fcmp ogt double undef, undef 150 %a10 = fcmp olt <8 x half> undef, undef 151 %a11 = fcmp oge <4 x float> undef, undef 152 %a12 = fcmp oge <2 x double> undef, undef 153 ret i32 undef 154} 155