26 lines · plain
1; RUN: opt < %s -passes="print<cost-model>" 2>&1 -disable-output -mtriple=systemz-unknown -mcpu=z13 | FileCheck %s2;3; Test that load and test results in 0 cost for the compare.4 5define i64 @fun0(ptr %Src, i64 %Arg) {6 %Ld1 = load i64, ptr %Src7 %Cmp = icmp eq i64 %Ld1, 08 %S = select i1 %Cmp, i64 %Arg, i64 %Ld19 ret i64 %S10; CHECK: function 'fun0'11; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %Ld1 = load i64, ptr %Src12; CHECK: Cost Model: Found an estimated cost of 0 for instruction: %Cmp = icmp eq i64 %Ld1, 013; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %S = select14}15 16define i32 @fun1(ptr %Src, i32 %Arg) {17 %Ld1 = load i32, ptr %Src18 %Cmp = icmp eq i32 %Ld1, 019 %S = select i1 %Cmp, i32 %Arg, i32 %Ld120 ret i32 %S21; CHECK: function 'fun1'22; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %Ld1 = load i32, ptr %Src23; CHECK: Cost Model: Found an estimated cost of 0 for instruction: %Cmp = icmp eq i32 %Ld1, 024; CHECK: Cost Model: Found an estimated cost of 1 for instruction: %S = select25}26