54 lines · plain
1; RUN: opt < %s -passes="print<cost-model>" 2>&1 -disable-output -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 -mattr=+vsx | FileCheck %s2; RUN: opt < %s -passes="print<cost-model>" 2>&1 -disable-output -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr9 -mattr=+vsx | FileCheck --check-prefix=CHECK-P9 %s3 4define void @testi16(i16 %arg1, i16 %arg2, ptr %arg3) {5 6 %s1 = add i16 %arg1, %arg27 %s2 = zext i16 %arg1 to i328 %s3 = load i16, ptr %arg39 store i16 %arg2, ptr %arg310 %c = icmp eq i16 %arg1, %arg211 12 ret void13 ; CHECK: cost of 1 {{.*}} add14 ; CHECK: cost of 1 {{.*}} zext15 ; CHECK: cost of 1 {{.*}} load16 ; CHECK: cost of 1 {{.*}} store17 ; CHECK: cost of 1 {{.*}} icmp18 ; CHECK-P9: cost of 1 {{.*}} add19 ; CHECK-P9: cost of 1 {{.*}} zext20 ; CHECK-P9: cost of 1 {{.*}} load21 ; CHECK-P9: cost of 1 {{.*}} store22 ; CHECK-P9: cost of 1 {{.*}} icmp23}24 25define void @test4xi16(<4 x i16> %arg1, <4 x i16> %arg2) {26 27 %v1 = add <4 x i16> %arg1, %arg228 %v2 = zext <4 x i16> %arg1 to <4 x i32>29 %v3 = shufflevector <4 x i16> %arg1, <4 x i16> undef, <4 x i32> zeroinitializer30 %c = icmp eq <4 x i16> %arg1, %arg231 32 ret void33 ; CHECK: cost of 1 {{.*}} add34 ; CHECK: cost of 1 {{.*}} zext35 ; CHECK: cost of 1 {{.*}} shufflevector36 ; CHECK: cost of 1 {{.*}} icmp37 ; CHECK-P9: cost of 2 {{.*}} add38 ; CHECK-P9: cost of 2 {{.*}} zext39 ; CHECK-P9: cost of 2 {{.*}} shufflevector40 ; CHECK-P9: cost of 2 {{.*}} icmp41}42 43define void @test4xi32(<4 x i32> %arg1, <4 x i32> %arg2, ptr %arg3) {44 45 %v1 = load <4 x i32>, ptr %arg346 store <4 x i32> %arg2, ptr %arg347 48 ret void49 ; CHECK: cost of 1 {{.*}} load50 ; CHECK: cost of 1 {{.*}} store51 ; CHECK-P9: cost of 2 {{.*}} load52 ; CHECK-P9: cost of 2 {{.*}} store53}54