globals_lowering.ll 695 B

123456789101112131415
  1. ; RUN: llc < %s -march=nvptx -mcpu=sm_20 -relocation-model=static | FileCheck %s --check-prefix CHK
  2. %MyStruct = type { i32, i32, float }
  3. @Gbl = internal addrspace(3) global [1024 x %MyStruct] zeroinitializer
  4. ; CHK-LABEL: foo
  5. define void @foo(float %f) {
  6. entry:
  7. ; CHK: ld.shared.f32 %{{[a-zA-Z0-9]+}}, [Gbl+8];
  8. %0 = load float, float addrspace(3)* getelementptr inbounds ([1024 x %MyStruct], [1024 x %MyStruct] addrspace(3)* @Gbl, i32 0, i32 0, i32 2)
  9. %add = fadd float %0, %f
  10. ; CHK: st.shared.f32 [Gbl+8], %{{[a-zA-Z0-9]+}};
  11. store float %add, float addrspace(3)* getelementptr inbounds ([1024 x %MyStruct], [1024 x %MyStruct] addrspace(3)* @Gbl, i32 0, i32 0, i32 2)
  12. ret void
  13. }