1; RUN: opt -cost-model -analyze -mtriple=amdgcn-unknown-amdhsa < %s | FileCheck %s 2 3; CHECK: 'mul_i32' 4; CHECK: estimated cost of 3 for {{.*}} mul i32 5define void @mul_i32(i32 addrspace(1)* %out, i32 addrspace(1)* %vaddr, i32 %b) #0 { 6 %vec = load i32, i32 addrspace(1)* %vaddr 7 %mul = mul i32 %vec, %b 8 store i32 %mul, i32 addrspace(1)* %out 9 ret void 10} 11 12; CHECK: 'mul_v2i32' 13; CHECK: estimated cost of 6 for {{.*}} mul <2 x i32> 14define void @mul_v2i32(<2 x i32> addrspace(1)* %out, <2 x i32> addrspace(1)* %vaddr, <2 x i32> %b) #0 { 15 %vec = load <2 x i32>, <2 x i32> addrspace(1)* %vaddr 16 %mul = mul <2 x i32> %vec, %b 17 store <2 x i32> %mul, <2 x i32> addrspace(1)* %out 18 ret void 19} 20 21; CHECK: 'mul_v3i32' 22; CHECK: estimated cost of 9 for {{.*}} mul <3 x i32> 23define void @mul_v3i32(<3 x i32> addrspace(1)* %out, <3 x i32> addrspace(1)* %vaddr, <3 x i32> %b) #0 { 24 %vec = load <3 x i32>, <3 x i32> addrspace(1)* %vaddr 25 %mul = mul <3 x i32> %vec, %b 26 store <3 x i32> %mul, <3 x i32> addrspace(1)* %out 27 ret void 28} 29 30; CHECK: 'mul_v4i32' 31; CHECK: estimated cost of 12 for {{.*}} mul <4 x i32> 32define void @mul_v4i32(<4 x i32> addrspace(1)* %out, <4 x i32> addrspace(1)* %vaddr, <4 x i32> %b) #0 { 33 %vec = load <4 x i32>, <4 x i32> addrspace(1)* %vaddr 34 %mul = mul <4 x i32> %vec, %b 35 store <4 x i32> %mul, <4 x i32> addrspace(1)* %out 36 ret void 37} 38 39; CHECK: 'mul_i64' 40; CHECK: estimated cost of 16 for {{.*}} mul i64 41define void @mul_i64(i64 addrspace(1)* %out, i64 addrspace(1)* %vaddr, i64 %b) #0 { 42 %vec = load i64, i64 addrspace(1)* %vaddr 43 %mul = mul i64 %vec, %b 44 store i64 %mul, i64 addrspace(1)* %out 45 ret void 46} 47 48; CHECK: 'mul_v2i64' 49; CHECK: estimated cost of 32 for {{.*}} mul <2 x i64> 50define void @mul_v2i64(<2 x i64> addrspace(1)* %out, <2 x i64> addrspace(1)* %vaddr, <2 x i64> %b) #0 { 51 %vec = load <2 x i64>, <2 x i64> addrspace(1)* %vaddr 52 %mul = mul <2 x i64> %vec, %b 53 store <2 x i64> %mul, <2 x i64> addrspace(1)* %out 54 ret void 55} 56 57; CHECK: 'mul_v3i64' 58; CHECK: estimated cost of 48 for {{.*}} mul <3 x i64> 59define void @mul_v3i64(<3 x i64> addrspace(1)* %out, <3 x i64> addrspace(1)* %vaddr, <3 x i64> %b) #0 { 60 %vec = load <3 x i64>, <3 x i64> addrspace(1)* %vaddr 61 %mul = mul <3 x i64> %vec, %b 62 store <3 x i64> %mul, <3 x i64> addrspace(1)* %out 63 ret void 64} 65 66; CHECK: 'mul_v4i64' 67; CHECK: estimated cost of 64 for {{.*}} mul <4 x i64> 68define void @mul_v4i64(<4 x i64> addrspace(1)* %out, <4 x i64> addrspace(1)* %vaddr, <4 x i64> %b) #0 { 69 %vec = load <4 x i64>, <4 x i64> addrspace(1)* %vaddr 70 %mul = mul <4 x i64> %vec, %b 71 store <4 x i64> %mul, <4 x i64> addrspace(1)* %out 72 ret void 73} 74 75 76; CHECK: 'mul_v8i64' 77; CHECK: estimated cost of 128 for {{.*}} mul <8 x i64> 78define void @mul_v8i64(<8 x i64> addrspace(1)* %out, <8 x i64> addrspace(1)* %vaddr, <8 x i64> %b) #0 { 79 %vec = load <8 x i64>, <8 x i64> addrspace(1)* %vaddr 80 %mul = mul <8 x i64> %vec, %b 81 store <8 x i64> %mul, <8 x i64> addrspace(1)* %out 82 ret void 83} 84 85attributes #0 = { nounwind } 86