bug22322.ll 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. ; RUN: llc < %s -march=nvptx -mcpu=sm_20 | FileCheck %s
  2. target datalayout = "e-i64:64-v16:16-v32:32-n16:32:64"
  3. target triple = "nvptx64-nvidia-cuda"
  4. %class.float3 = type { float, float, float }
  5. ; Function Attrs: nounwind
  6. ; CHECK-LABEL: some_kernel
  7. define void @some_kernel(%class.float3* nocapture %dst) #0 {
  8. _ZL11compute_vecRK6float3jb.exit:
  9. %ret_vec.sroa.8.i = alloca float, align 4
  10. %0 = tail call i32 @llvm.ptx.read.ctaid.x()
  11. %1 = tail call i32 @llvm.ptx.read.ntid.x()
  12. %2 = mul nsw i32 %1, %0
  13. %3 = tail call i32 @llvm.ptx.read.tid.x()
  14. %4 = add nsw i32 %2, %3
  15. %5 = zext i32 %4 to i64
  16. %6 = bitcast float* %ret_vec.sroa.8.i to i8*
  17. call void @llvm.lifetime.start(i64 4, i8* %6)
  18. %7 = and i32 %4, 15
  19. %8 = icmp eq i32 %7, 0
  20. %9 = select i1 %8, float 0.000000e+00, float -1.000000e+00
  21. store float %9, float* %ret_vec.sroa.8.i, align 4
  22. ; CHECK: setp.lt.f32 %p{{[0-9]+}}, %f{{[0-9]+}}, 0f00000000
  23. %10 = fcmp olt float %9, 0.000000e+00
  24. %ret_vec.sroa.8.i.val = load float, float* %ret_vec.sroa.8.i, align 4
  25. %11 = select i1 %10, float 0.000000e+00, float %ret_vec.sroa.8.i.val
  26. call void @llvm.lifetime.end(i64 4, i8* %6)
  27. %12 = getelementptr inbounds %class.float3, %class.float3* %dst, i64 %5, i32 0
  28. store float 0.000000e+00, float* %12, align 4
  29. %13 = getelementptr inbounds %class.float3, %class.float3* %dst, i64 %5, i32 1
  30. store float %11, float* %13, align 4
  31. %14 = getelementptr inbounds %class.float3, %class.float3* %dst, i64 %5, i32 2
  32. store float 0.000000e+00, float* %14, align 4
  33. ret void
  34. }
  35. ; Function Attrs: nounwind readnone
  36. declare i32 @llvm.ptx.read.ctaid.x() #1
  37. ; Function Attrs: nounwind readnone
  38. declare i32 @llvm.ptx.read.ntid.x() #1
  39. ; Function Attrs: nounwind readnone
  40. declare i32 @llvm.ptx.read.tid.x() #1
  41. ; Function Attrs: nounwind
  42. declare void @llvm.lifetime.start(i64, i8* nocapture) #2
  43. ; Function Attrs: nounwind
  44. declare void @llvm.lifetime.end(i64, i8* nocapture) #2
  45. attributes #0 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "stack-protector-buffer-size"="8" "unsafe-fp-math"="true" "use-soft-float"="false" }
  46. attributes #1 = { nounwind readnone }
  47. attributes #2 = { nounwind }
  48. !nvvm.annotations = !{!0}
  49. !llvm.ident = !{!1}
  50. !0 = !{void (%class.float3*)* @some_kernel, !"kernel", i32 1}
  51. !1 = !{!"clang version 3.5.1 (tags/RELEASE_351/final)"}