nounroll.ll 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. ; RUN: llc < %s -march=nvptx64 -mcpu=sm_20 | FileCheck %s
  2. target datalayout = "e-i64:64-v16:16-v32:32-n16:32:64"
  3. target triple = "nvptx64-unknown-unknown"
  4. ; Compiled from the following CUDA code:
  5. ;
  6. ; #pragma nounroll
  7. ; for (int i = 0; i < 2; ++i)
  8. ; output[i] = input[i];
  9. define void @nounroll(float* %input, float* %output) {
  10. ; CHECK-LABEL: .visible .func nounroll(
  11. entry:
  12. br label %for.body
  13. for.body:
  14. ; CHECK: .pragma "nounroll"
  15. %i.06 = phi i32 [ 0, %entry ], [ %inc, %for.body ]
  16. %idxprom = sext i32 %i.06 to i64
  17. %arrayidx = getelementptr inbounds float, float* %input, i64 %idxprom
  18. %0 = load float, float* %arrayidx, align 4
  19. ; CHECK: ld.f32
  20. %arrayidx2 = getelementptr inbounds float, float* %output, i64 %idxprom
  21. store float %0, float* %arrayidx2, align 4
  22. ; CHECK: st.f32
  23. %inc = add nuw nsw i32 %i.06, 1
  24. %exitcond = icmp eq i32 %inc, 2
  25. br i1 %exitcond, label %for.end, label %for.body, !llvm.loop !0
  26. ; CHECK-NOT: ld.f32
  27. ; CHECK-NOT: st.f32
  28. for.end:
  29. ret void
  30. }
  31. !0 = distinct !{!0, !1}
  32. !1 = !{!"llvm.loop.unroll.disable"}