1 ; RUN: opt -inline -enable-noalias-to-md-conversion -S < %s | FileCheck %s
2 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
3 target triple = "x86_64-unknown-linux-gnu"
5 define void @hello(float* noalias nocapture %a, float* nocapture readonly %c) #0 {
7 %0 = load float, float* %c, align 4
8 %arrayidx = getelementptr inbounds float, float* %a, i64 5
9 store float %0, float* %arrayidx, align 4
13 define void @foo(float* nocapture %a, float* nocapture readonly %c) #0 {
15 tail call void @hello(float* %a, float* %c)
16 %0 = load float, float* %c, align 4
17 %arrayidx = getelementptr inbounds float, float* %a, i64 7
18 store float %0, float* %arrayidx, align 4
22 ; CHECK: define void @foo(float* nocapture %a, float* nocapture readonly %c) #0 {
24 ; CHECK: %0 = load float, float* %c, align 4, !noalias !0
25 ; CHECK: %arrayidx.i = getelementptr inbounds float, float* %a, i64 5
26 ; CHECK: store float %0, float* %arrayidx.i, align 4, !alias.scope !0
27 ; CHECK: %1 = load float, float* %c, align 4
28 ; CHECK: %arrayidx = getelementptr inbounds float, float* %a, i64 7
29 ; CHECK: store float %1, float* %arrayidx, align 4
33 define void @hello2(float* noalias nocapture %a, float* noalias nocapture %b, float* nocapture readonly %c) #0 {
35 %0 = load float, float* %c, align 4
36 %arrayidx = getelementptr inbounds float, float* %a, i64 5
37 store float %0, float* %arrayidx, align 4
38 %arrayidx1 = getelementptr inbounds float, float* %b, i64 8
39 store float %0, float* %arrayidx1, align 4
43 define void @foo2(float* nocapture %a, float* nocapture %b, float* nocapture readonly %c) #0 {
45 tail call void @hello2(float* %a, float* %b, float* %c)
46 %0 = load float, float* %c, align 4
47 %arrayidx = getelementptr inbounds float, float* %a, i64 7
48 store float %0, float* %arrayidx, align 4
52 ; CHECK: define void @foo2(float* nocapture %a, float* nocapture %b, float* nocapture readonly %c) #0 {
54 ; CHECK: %0 = load float, float* %c, align 4, !noalias !3
55 ; CHECK: %arrayidx.i = getelementptr inbounds float, float* %a, i64 5
56 ; CHECK: store float %0, float* %arrayidx.i, align 4, !alias.scope !7, !noalias !8
57 ; CHECK: %arrayidx1.i = getelementptr inbounds float, float* %b, i64 8
58 ; CHECK: store float %0, float* %arrayidx1.i, align 4, !alias.scope !8, !noalias !7
59 ; CHECK: %1 = load float, float* %c, align 4
60 ; CHECK: %arrayidx = getelementptr inbounds float, float* %a, i64 7
61 ; CHECK: store float %1, float* %arrayidx, align 4
65 attributes #0 = { nounwind uwtable }
68 ; CHECK: !1 = distinct !{!1, !2, !"hello: %a"}
69 ; CHECK: !2 = distinct !{!2, !"hello"}
70 ; CHECK: !3 = !{!4, !6}
71 ; CHECK: !4 = distinct !{!4, !5, !"hello2: %a"}
72 ; CHECK: !5 = distinct !{!5, !"hello2"}
73 ; CHECK: !6 = distinct !{!6, !5, !"hello2: %b"}