1 # RUN: llc -march=amdgcn -mcpu=hawaii -run-pass=none -o - %s | FileCheck -check-prefix=MCPU %s
2 # RUN: llc -march=amdgcn -mattr=+unaligned-access-mode -run-pass=none -o - %s | FileCheck -check-prefix=MATTR %s
4 # FIXME: This overrides attributes that already are present. It should probably
5 # only touch functions without an existing attribute.
7 # MCPU: @with_cpu_attr() #0 {
8 # MCPU: @no_cpu_attr() #1 {
10 # MCPU: attributes #0 = { "target-cpu"="fiji" }
11 # MCPU: attributes #1 = { "target-cpu"="hawaii" }
13 # MATTR: attributes #0 = { "target-cpu"="fiji" "target-features"="+unaligned-access-mode" }
14 # MATTR: attributes #1 = { "target-features"="+unaligned-access-mode" }
17 define amdgpu_kernel void @with_cpu_attr() #0 {
21 define amdgpu_kernel void @no_cpu_attr() {
25 attributes #0 = { "target-cpu"="fiji" }
32 tracksRegLiveness: true
36 liveins: $sgpr0, $sgpr1
38 %0:sgpr(s32) = COPY $sgpr0
39 %1:sgpr(s32) = COPY $sgpr1
40 %2:vgpr(s32) = G_OR %0, %1
41 S_ENDPGM 0, implicit %2
48 tracksRegLiveness: true
52 liveins: $sgpr0, $sgpr1
54 %0:sgpr(s32) = COPY $sgpr0
55 %1:sgpr(s32) = COPY $sgpr1
56 %2:vgpr(s32) = G_OR %0, %1
57 S_ENDPGM 0, implicit %2