59 lines · plain
1# RUN: llc -mtriple=amdgcn -mcpu=hawaii -run-pass=none -o - %s | FileCheck -check-prefix=MCPU %s2# RUN: llc -mtriple=amdgcn -mattr=+unaligned-access-mode -run-pass=none -o - %s | FileCheck -check-prefix=MATTR %s3 4# FIXME: This overrides attributes that already are present. It should probably5# only touch functions without an existing attribute.6 7# MCPU: @with_cpu_attr() #0 {8# MCPU: @no_cpu_attr() #1 {9 10# MCPU: attributes #0 = { "target-cpu"="fiji" }11# MCPU: attributes #1 = { "target-cpu"="hawaii" }12 13# MATTR: attributes #0 = { "target-cpu"="fiji" "target-features"="+unaligned-access-mode" }14# MATTR: attributes #1 = { "target-features"="+unaligned-access-mode" }15 16--- |17 define amdgpu_kernel void @with_cpu_attr() #0 {18 ret void19 }20 21 define amdgpu_kernel void @no_cpu_attr() {22 ret void23 }24 25 attributes #0 = { "target-cpu"="fiji" }26...27 28---29name: with_cpu_attr30legalized: true31regBankSelected: true32tracksRegLiveness: true33 34body: |35 bb.0:36 liveins: $sgpr0, $sgpr137 38 %0:sgpr(s32) = COPY $sgpr039 %1:sgpr(s32) = COPY $sgpr140 %2:vgpr(s32) = G_OR %0, %141 S_ENDPGM 0, implicit %242...43 44---45name: no_cpu_attr46legalized: true47regBankSelected: true48tracksRegLiveness: true49 50body: |51 bb.0:52 liveins: $sgpr0, $sgpr153 54 %0:sgpr(s32) = COPY $sgpr055 %1:sgpr(s32) = COPY $sgpr156 %2:vgpr(s32) = G_OR %0, %157 S_ENDPGM 0, implicit %258...59