brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.1 KiB · 2f8743a Raw
46 lines · plain
1; RUN: opt < %s -passes="print<cost-model>" 2>&1 -disable-output -mtriple=systemz-unknown -mcpu=z13 \2; RUN:  | FileCheck %s3;4; Test that i8/i16 operands get extra costs for extensions to i32 only in5; cases where this is needed.6 7define void @icmp() {8  %li8_0 = load i8, ptr undef9  %li8_1 = load i8, ptr undef10  icmp slt i8 %li8_0, %li8_111 12  %a0 = add i8 %li8_0, 113  %a1 = add i8 %li8_1, 114  icmp slt i8 %a0, %a115 16  icmp slt i8 %a0, 12317 18  %li16_0 = load i16, ptr undef19  %li16_1 = load i16, ptr undef20  icmp slt i16 %li16_0, %li16_121 22  %a2 = add i16 %li16_0, 123  %a3 = add i16 %li16_1, 124  icmp slt i16 %a2, %a325 26  icmp slt i16 %a2, 12327 28  ret void;29; CHECK: function 'icmp'30; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %li8_0 = load i8, ptr undef31; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %li8_1 = load i8, ptr undef32; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %1 = icmp slt i8 %li8_0, %li8_133; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %a0 = add i8 %li8_0, 134; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %a1 = add i8 %li8_1, 135; CHECK: Cost Model: Found an estimated cost of 3 for instruction:   %2 = icmp slt i8 %a0, %a136; CHECK: Cost Model: Found an estimated cost of 2 for instruction:   %3 = icmp slt i8 %a0, 12337; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %li16_0 = load i16, ptr undef38; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %li16_1 = load i16, ptr undef39; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %4 = icmp slt i16 %li16_0, %li16_140; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %a2 = add i16 %li16_0, 141; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %a3 = add i16 %li16_1, 142; CHECK: Cost Model: Found an estimated cost of 3 for instruction:   %5 = icmp slt i16 %a2, %a343; CHECK: Cost Model: Found an estimated cost of 2 for instruction:   %6 = icmp slt i16 %a2, 12344; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   ret void45}46