28 lines · plain
1; RUN: opt < %s -passes="print<cost-model>" 2>&1 -disable-output -mtriple=systemz-unknown -mcpu=z13 | FileCheck %s2;3; Test costs for i8 and i16 comparisons against memory with a small immediate.4 5define i32 @fun0(ptr %Src, ptr %Dst, i8 %Val) {6; CHECK: function 'fun0'7; CHECK: Cost Model: Found an estimated cost of 0 for instruction: %Ld = load i8, ptr %Src8; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %Cmp = icmp eq i8 %Ld, 1239; CHECK: Cost Model: Found an estimated cost of 2 for instruction: %Ret = zext i1 %Cmp to i3210; CHECK: Cost Model: Found an estimated cost of 1 for instruction: ret i32 %Ret11 %Ld = load i8, ptr %Src12 %Cmp = icmp eq i8 %Ld, 12313 %Ret = zext i1 %Cmp to i3214 ret i32 %Ret15}16 17define i32 @fun1(ptr %Src, ptr %Dst, i16 %Val) {18; CHECK: function 'fun1'19; CHECK: Cost Model: Found an estimated cost of 0 for instruction: %Ld = load i16, ptr %Src20; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %Cmp = icmp eq i1621; CHECK: Cost Model: Found an estimated cost of 2 for instruction: %Ret = zext i1 %Cmp to i3222; CHECK: Cost Model: Found an estimated cost of 1 for instruction: ret i32 %Ret23 %Ld = load i16, ptr %Src24 %Cmp = icmp eq i16 %Ld, 123425 %Ret = zext i1 %Cmp to i3226 ret i32 %Ret27}28