1; RUN: opt -cost-model -analyze -mtriple=amdgcn-unknown-amdhsa < %s | FileCheck -check-prefixes=ALL,SLOW16 %s 2; RUN: opt -cost-model -analyze -mtriple=amdgcn-unknown-amdhsa -mcpu=gfx900 < %s | FileCheck -check-prefixes=ALL,FAST16 %s 3; RUN: opt -cost-model -cost-kind=code-size -analyze -mtriple=amdgcn-unknown-amdhsa < %s | FileCheck -check-prefixes=ALL,SLOW16 %s 4; RUN: opt -cost-model -cost-kind=code-size -analyze -mtriple=amdgcn-unknown-amdhsa -mcpu=gfx900 < %s | FileCheck -check-prefixes=ALL,FAST16 %s 5; END. 6 7; ALL-LABEL: 'or' 8; ALL: estimated cost of 1 for {{.*}} or i32 9; ALL: estimated cost of 2 for {{.*}} or i64 10; SLOW16: estimated cost of 2 for {{.*}} or <2 x i16> 11; FAST16: estimated cost of 1 for {{.*}} or <2 x i16> 12define amdgpu_kernel void @or() #0 { 13 %i32 = or i32 undef, undef 14 %i64 = or i64 undef, undef 15 %v2i16 = or <2 x i16> undef, undef 16 ret void 17} 18 19; ALL-LABEL: 'xor' 20; ALL: estimated cost of 1 for {{.*}} xor i32 21; ALL: estimated cost of 2 for {{.*}} xor i64 22; SLOW16: estimated cost of 2 for {{.*}} xor <2 x i16> 23; FAST16: estimated cost of 1 for {{.*}} xor <2 x i16> 24define amdgpu_kernel void @xor() #0 { 25 %i32 = xor i32 undef, undef 26 %i64 = xor i64 undef, undef 27 %v2i16 = xor <2 x i16> undef, undef 28 ret void 29} 30 31; ALL-LABEL: 'and' 32; ALL: estimated cost of 1 for {{.*}} and i32 33; ALL: estimated cost of 2 for {{.*}} and i64 34; SLOW16: estimated cost of 2 for {{.*}} and <2 x i16> 35; FAST16: estimated cost of 1 for {{.*}} and <2 x i16> 36define amdgpu_kernel void @and() #0 { 37 %i32 = and i32 undef, undef 38 %i64 = and i64 undef, undef 39 %v2i16 = and <2 x i16> undef, undef 40 ret void 41} 42 43attributes #0 = { nounwind } 44