1 ; RUN: opt -cost-model -analyze -mtriple=amdgcn-unknown-amdhsa < %s | FileCheck %s
4 ; CHECK: estimated cost of 1 for {{.*}} or i32
5 define amdgpu_kernel void @or_i32(i32 addrspace(1)* %out, i32 addrspace(1)* %vaddr, i32 %b) #0 {
6 %vec = load i32, i32 addrspace(1)* %vaddr
8 store i32 %or, i32 addrspace(1)* %out
13 ; CHECK: estimated cost of 2 for {{.*}} or i64
14 define amdgpu_kernel void @or_i64(i64 addrspace(1)* %out, i64 addrspace(1)* %vaddr, i64 %b) #0 {
15 %vec = load i64, i64 addrspace(1)* %vaddr
17 store i64 %or, i64 addrspace(1)* %out
22 ; CHECK: estimated cost of 1 for {{.*}} xor i32
23 define amdgpu_kernel void @xor_i32(i32 addrspace(1)* %out, i32 addrspace(1)* %vaddr, i32 %b) #0 {
24 %vec = load i32, i32 addrspace(1)* %vaddr
25 %or = xor i32 %vec, %b
26 store i32 %or, i32 addrspace(1)* %out
31 ; CHECK: estimated cost of 2 for {{.*}} xor i64
32 define amdgpu_kernel void @xor_i64(i64 addrspace(1)* %out, i64 addrspace(1)* %vaddr, i64 %b) #0 {
33 %vec = load i64, i64 addrspace(1)* %vaddr
34 %or = xor i64 %vec, %b
35 store i64 %or, i64 addrspace(1)* %out
41 ; CHECK: estimated cost of 1 for {{.*}} and i32
42 define amdgpu_kernel void @and_i32(i32 addrspace(1)* %out, i32 addrspace(1)* %vaddr, i32 %b) #0 {
43 %vec = load i32, i32 addrspace(1)* %vaddr
44 %or = and i32 %vec, %b
45 store i32 %or, i32 addrspace(1)* %out
50 ; CHECK: estimated cost of 2 for {{.*}} and i64
51 define amdgpu_kernel void @and_i64(i64 addrspace(1)* %out, i64 addrspace(1)* %vaddr, i64 %b) #0 {
52 %vec = load i64, i64 addrspace(1)* %vaddr
53 %or = and i64 %vec, %b
54 store i64 %or, i64 addrspace(1)* %out
59 attributes #0 = { nounwind }