blob: 8528a391cf956577708a187b1e12f3dfdcb2108d [file] [log] [blame]
Hal Finkel61c38612014-08-14 21:09:37 +00001; RUN: opt -inline -enable-noalias-to-md-conversion -S < %s | FileCheck %s
2target datalayout = "e-i64:64-f80:128-n8:16:32:64-S128"
3target triple = "x86_64-unknown-linux-gnu"
4
5; Function Attrs: nounwind uwtable
6define void @foo2(float* nocapture %a, float* nocapture %b, float* nocapture readonly %c) #0 {
7entry:
David Blaikiea79ac142015-02-27 21:17:42 +00008 %0 = load float, float* %c, align 4, !noalias !3
David Blaikie79e6c742015-02-27 19:29:02 +00009 %arrayidx.i = getelementptr inbounds float, float* %a, i64 5
Hal Finkel61c38612014-08-14 21:09:37 +000010 store float %0, float* %arrayidx.i, align 4, !alias.scope !7, !noalias !8
David Blaikie79e6c742015-02-27 19:29:02 +000011 %arrayidx1.i = getelementptr inbounds float, float* %b, i64 8
Hal Finkel61c38612014-08-14 21:09:37 +000012 store float %0, float* %arrayidx1.i, align 4, !alias.scope !8, !noalias !7
David Blaikiea79ac142015-02-27 21:17:42 +000013 %1 = load float, float* %c, align 4
David Blaikie79e6c742015-02-27 19:29:02 +000014 %arrayidx = getelementptr inbounds float, float* %a, i64 7
Hal Finkel61c38612014-08-14 21:09:37 +000015 store float %1, float* %arrayidx, align 4
16 ret void
17}
18
19define void @foo(float* nocapture %a, float* nocapture %b, float* nocapture readonly %c) #0 {
20entry:
21 call void @foo2(float* %a, float* %b, float* %c), !noalias !0
22 call void @foo2(float* %b, float* %b, float* %a), !alias.scope !0
23 ret void
24}
25
26; CHECK: define void @foo(float* nocapture %a, float* nocapture %b, float* nocapture readonly %c) #0 {
27; CHECK: entry:
David Blaikiea79ac142015-02-27 21:17:42 +000028; CHECK: %0 = load float, float* %c, align 4, !noalias !6
David Blaikie79e6c742015-02-27 19:29:02 +000029; CHECK: %arrayidx.i.i = getelementptr inbounds float, float* %a, i64 5
Hal Finkel61c38612014-08-14 21:09:37 +000030; CHECK: store float %0, float* %arrayidx.i.i, align 4, !alias.scope !12, !noalias !13
David Blaikie79e6c742015-02-27 19:29:02 +000031; CHECK: %arrayidx1.i.i = getelementptr inbounds float, float* %b, i64 8
Hal Finkel61c38612014-08-14 21:09:37 +000032; CHECK: store float %0, float* %arrayidx1.i.i, align 4, !alias.scope !14, !noalias !15
David Blaikiea79ac142015-02-27 21:17:42 +000033; CHECK: %1 = load float, float* %c, align 4, !noalias !16
David Blaikie79e6c742015-02-27 19:29:02 +000034; CHECK: %arrayidx.i = getelementptr inbounds float, float* %a, i64 7
Hal Finkel61c38612014-08-14 21:09:37 +000035; CHECK: store float %1, float* %arrayidx.i, align 4, !noalias !16
David Blaikiea79ac142015-02-27 21:17:42 +000036; CHECK: %2 = load float, float* %a, align 4, !alias.scope !16, !noalias !17
David Blaikie79e6c742015-02-27 19:29:02 +000037; CHECK: %arrayidx.i.i1 = getelementptr inbounds float, float* %b, i64 5
Hal Finkel61c38612014-08-14 21:09:37 +000038; CHECK: store float %2, float* %arrayidx.i.i1, align 4, !alias.scope !21, !noalias !22
David Blaikie79e6c742015-02-27 19:29:02 +000039; CHECK: %arrayidx1.i.i2 = getelementptr inbounds float, float* %b, i64 8
Hal Finkel61c38612014-08-14 21:09:37 +000040; CHECK: store float %2, float* %arrayidx1.i.i2, align 4, !alias.scope !23, !noalias !24
David Blaikiea79ac142015-02-27 21:17:42 +000041; CHECK: %3 = load float, float* %a, align 4, !alias.scope !16
David Blaikie79e6c742015-02-27 19:29:02 +000042; CHECK: %arrayidx.i3 = getelementptr inbounds float, float* %b, i64 7
Hal Finkel61c38612014-08-14 21:09:37 +000043; CHECK: store float %3, float* %arrayidx.i3, align 4, !alias.scope !16
44; CHECK: ret void
45; CHECK: }
46
47attributes #0 = { nounwind uwtable }
48
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000049!0 = !{!1}
Duncan P. N. Exon Smith090a19b2015-01-08 22:38:29 +000050!1 = distinct !{!1, !2, !"hello: %a"}
51!2 = distinct !{!2, !"hello"}
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000052!3 = !{!4, !6}
Duncan P. N. Exon Smith090a19b2015-01-08 22:38:29 +000053!4 = distinct !{!4, !5, !"hello2: %a"}
54!5 = distinct !{!5, !"hello2"}
55!6 = distinct !{!6, !5, !"hello2: %b"}
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000056!7 = !{!4}
57!8 = !{!6}
Hal Finkel61c38612014-08-14 21:09:37 +000058
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000059; CHECK: !0 = !{!1, !3}
Duncan P. N. Exon Smith090a19b2015-01-08 22:38:29 +000060; CHECK: !1 = distinct !{!1, !2, !"hello2: %a"}
61; CHECK: !2 = distinct !{!2, !"hello2"}
62; CHECK: !3 = distinct !{!3, !2, !"hello2: %b"}
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000063; CHECK: !4 = !{!1}
64; CHECK: !5 = !{!3}
65; CHECK: !6 = !{!7, !9, !10}
Duncan P. N. Exon Smith090a19b2015-01-08 22:38:29 +000066; CHECK: !7 = distinct !{!7, !8, !"hello2: %a"}
67; CHECK: !8 = distinct !{!8, !"hello2"}
68; CHECK: !9 = distinct !{!9, !8, !"hello2: %b"}
69; CHECK: !10 = distinct !{!10, !11, !"hello: %a"}
70; CHECK: !11 = distinct !{!11, !"hello"}
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000071; CHECK: !12 = !{!7}
72; CHECK: !13 = !{!9, !10}
73; CHECK: !14 = !{!9}
74; CHECK: !15 = !{!7, !10}
75; CHECK: !16 = !{!10}
76; CHECK: !17 = !{!18, !20}
Duncan P. N. Exon Smith090a19b2015-01-08 22:38:29 +000077; CHECK: !18 = distinct !{!18, !19, !"hello2: %a"}
78; CHECK: !19 = distinct !{!19, !"hello2"}
79; CHECK: !20 = distinct !{!20, !19, !"hello2: %b"}
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000080; CHECK: !21 = !{!18, !10}
81; CHECK: !22 = !{!20}
82; CHECK: !23 = !{!20, !10}
83; CHECK: !24 = !{!18}
Hal Finkel61c38612014-08-14 21:09:37 +000084