noalias-cs.ll 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. ; RUN: opt -inline -enable-noalias-to-md-conversion -S < %s | FileCheck %s
  2. target datalayout = "e-i64:64-f80:128-n8:16:32:64-S128"
  3. target triple = "x86_64-unknown-linux-gnu"
  4. ; Function Attrs: nounwind uwtable
  5. define void @foo2(float* nocapture %a, float* nocapture %b, float* nocapture readonly %c) #0 {
  6. entry:
  7. %0 = load float, float* %c, align 4, !noalias !3
  8. %arrayidx.i = getelementptr inbounds float, float* %a, i64 5
  9. store float %0, float* %arrayidx.i, align 4, !alias.scope !7, !noalias !8
  10. %arrayidx1.i = getelementptr inbounds float, float* %b, i64 8
  11. store float %0, float* %arrayidx1.i, align 4, !alias.scope !8, !noalias !7
  12. %1 = load float, float* %c, align 4
  13. %arrayidx = getelementptr inbounds float, float* %a, i64 7
  14. store float %1, float* %arrayidx, align 4
  15. ret void
  16. }
  17. define void @foo(float* nocapture %a, float* nocapture %b, float* nocapture readonly %c) #0 {
  18. entry:
  19. call void @foo2(float* %a, float* %b, float* %c), !noalias !0
  20. call void @foo2(float* %b, float* %b, float* %a), !alias.scope !0
  21. ret void
  22. }
  23. ; CHECK: define void @foo(float* nocapture %a, float* nocapture %b, float* nocapture readonly %c) #0 {
  24. ; CHECK: entry:
  25. ; CHECK: %0 = load float, float* %c, align 4, !noalias !6
  26. ; CHECK: %arrayidx.i.i = getelementptr inbounds float, float* %a, i64 5
  27. ; CHECK: store float %0, float* %arrayidx.i.i, align 4, !alias.scope !12, !noalias !13
  28. ; CHECK: %arrayidx1.i.i = getelementptr inbounds float, float* %b, i64 8
  29. ; CHECK: store float %0, float* %arrayidx1.i.i, align 4, !alias.scope !14, !noalias !15
  30. ; CHECK: %1 = load float, float* %c, align 4, !noalias !16
  31. ; CHECK: %arrayidx.i = getelementptr inbounds float, float* %a, i64 7
  32. ; CHECK: store float %1, float* %arrayidx.i, align 4, !noalias !16
  33. ; CHECK: %2 = load float, float* %a, align 4, !alias.scope !16, !noalias !17
  34. ; CHECK: %arrayidx.i.i.1 = getelementptr inbounds float, float* %b, i64 5
  35. ; CHECK: store float %2, float* %arrayidx.i.i.1, align 4, !alias.scope !21, !noalias !22
  36. ; CHECK: %arrayidx1.i.i.2 = getelementptr inbounds float, float* %b, i64 8
  37. ; CHECK: store float %2, float* %arrayidx1.i.i.2, align 4, !alias.scope !23, !noalias !24
  38. ; CHECK: %3 = load float, float* %a, align 4, !alias.scope !16
  39. ; CHECK: %arrayidx.i.3 = getelementptr inbounds float, float* %b, i64 7
  40. ; CHECK: store float %3, float* %arrayidx.i.3, align 4, !alias.scope !16
  41. ; CHECK: ret void
  42. ; CHECK: }
  43. attributes #0 = { nounwind uwtable }
  44. !0 = !{!1}
  45. !1 = distinct !{!1, !2, !"hello: %a"}
  46. !2 = distinct !{!2, !"hello"}
  47. !3 = !{!4, !6}
  48. !4 = distinct !{!4, !5, !"hello2: %a"}
  49. !5 = distinct !{!5, !"hello2"}
  50. !6 = distinct !{!6, !5, !"hello2: %b"}
  51. !7 = !{!4}
  52. !8 = !{!6}
  53. ; CHECK: !0 = !{!1, !3}
  54. ; CHECK: !1 = distinct !{!1, !2, !"hello2: %a"}
  55. ; CHECK: !2 = distinct !{!2, !"hello2"}
  56. ; CHECK: !3 = distinct !{!3, !2, !"hello2: %b"}
  57. ; CHECK: !4 = !{!1}
  58. ; CHECK: !5 = !{!3}
  59. ; CHECK: !6 = !{!7, !9, !10}
  60. ; CHECK: !7 = distinct !{!7, !8, !"hello2: %a"}
  61. ; CHECK: !8 = distinct !{!8, !"hello2"}
  62. ; CHECK: !9 = distinct !{!9, !8, !"hello2: %b"}
  63. ; CHECK: !10 = distinct !{!10, !11, !"hello: %a"}
  64. ; CHECK: !11 = distinct !{!11, !"hello"}
  65. ; CHECK: !12 = !{!7}
  66. ; CHECK: !13 = !{!9, !10}
  67. ; CHECK: !14 = !{!9}
  68. ; CHECK: !15 = !{!7, !10}
  69. ; CHECK: !16 = !{!10}
  70. ; CHECK: !17 = !{!18, !20}
  71. ; CHECK: !18 = distinct !{!18, !19, !"hello2: %a"}
  72. ; CHECK: !19 = distinct !{!19, !"hello2"}
  73. ; CHECK: !20 = distinct !{!20, !19, !"hello2: %b"}
  74. ; CHECK: !21 = !{!18, !10}
  75. ; CHECK: !22 = !{!20}
  76. ; CHECK: !23 = !{!20, !10}
  77. ; CHECK: !24 = !{!18}