59 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py2; RUN: opt -mtriple=riscv32 -passes="print<cost-model>" 2>&1 -disable-output < %s \3; RUN: | FileCheck %s --check-prefix=CHECK-THROUGHPUT4; RUN: opt -mtriple=riscv64 -passes="print<cost-model>" 2>&1 -disable-output < %s \5; RUN: | FileCheck %s --check-prefix=CHECK-THROUGHPUT6 7; RUN: opt -mtriple=riscv32 -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=code-size < %s \8; RUN: | FileCheck %s --check-prefix=CHECK-SIZE9; RUN: opt -mtriple=riscv64 -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=code-size < %s \10; RUN: | FileCheck %s --check-prefix=CHECK-SIZE11 12 13define void @op() {14 ; Logical and/or - select's cost must be equivalent to that of binop15; CHECK-THROUGHPUT-LABEL: 'op'16; CHECK-THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %sand = select i1 undef, i1 undef, i1 false17; CHECK-THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %band = and i1 undef, undef18; CHECK-THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %sor = select i1 undef, i1 true, i1 undef19; CHECK-THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %bor = or i1 undef, undef20; CHECK-THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void21;22; CHECK-SIZE-LABEL: 'op'23; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %sand = select i1 undef, i1 undef, i1 false24; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %band = and i1 undef, undef25; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %sor = select i1 undef, i1 true, i1 undef26; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %bor = or i1 undef, undef27; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void28;29 %sand = select i1 undef, i1 undef, i1 false30 %band = and i1 undef, undef31 %sor = select i1 undef, i1 true, i1 undef32 %bor = or i1 undef, undef33 34 ret void35}36 37define void @vecop() {38; CHECK-THROUGHPUT-LABEL: 'vecop'39; CHECK-THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %sand = select <4 x i1> undef, <4 x i1> undef, <4 x i1> zeroinitializer40; CHECK-THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %band = and <4 x i1> undef, undef41; CHECK-THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %sor = select <4 x i1> undef, <4 x i1> splat (i1 true), <4 x i1> undef42; CHECK-THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %bor = or <4 x i1> undef, undef43; CHECK-THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void44;45; CHECK-SIZE-LABEL: 'vecop'46; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %sand = select <4 x i1> undef, <4 x i1> undef, <4 x i1> zeroinitializer47; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %band = and <4 x i1> undef, undef48; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %sor = select <4 x i1> undef, <4 x i1> splat (i1 true), <4 x i1> undef49; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %bor = or <4 x i1> undef, undef50; CHECK-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void51;52 %sand = select <4 x i1> undef, <4 x i1> undef, <4 x i1> <i1 false, i1 false, i1 false, i1 false>53 %band = and <4 x i1> undef, undef54 %sor = select <4 x i1> undef, <4 x i1> <i1 true, i1 true, i1 true, i1 true>, <4 x i1> undef55 %bor = or <4 x i1> undef, undef56 57 ret void58}59