1 ; RUN: opt -mtriple=x86_64-unknown-linux-gnu -load-store-vectorizer -S < %s | \
3 ; RUN: opt -mtriple=x86_64-unknown-linux-gnu -aa-pipeline=basic-aa -passes='function(load-store-vectorizer)' -S < %s | \
6 ; The GPU Load & Store Vectorizer may merge differently-typed accesses into a
7 ; single instruction. This test checks that we merge TBAA tags for such
10 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
16 %struct.S = type { float, i32 }
23 define float @foo(%struct.S* %p) {
26 ; CHECK: load <2 x i32>, {{.*}}, !tbaa [[TAG_char:!.*]]
27 ; CHECK: store <2 x i32> {{.*}}, !tbaa [[TAG_char]]
28 %f = getelementptr inbounds %struct.S, %struct.S* %p, i64 0, i32 0
29 %0 = load float, float* %f, align 4, !tbaa !2
30 %sub = fadd float %0, -1.000000e+00
31 store float %sub, float* %f, align 4, !tbaa !2
32 %i = getelementptr inbounds %struct.S, %struct.S* %p, i64 0, i32 1
33 %1 = load i32, i32* %i, align 4, !tbaa !8
34 %sub1 = add nsw i32 %1, -1
35 store i32 %sub1, i32* %i, align 4, !tbaa !8
40 !3 = !{!"_ZTS1S", !4, i64 0, !7, i64 4}
41 !4 = !{!"float", !5, i64 0}
42 !5 = !{!"omnipotent char", !6, i64 0}
43 !6 = !{!"Simple C++ TBAA"}
44 !7 = !{!"int", !5, i64 0}
47 ; CHECK-DAG: [[TYPE_char:!.*]] = !{!"omnipotent char", {{.*}}, i64 0}
48 ; CHECK-DAG: [[TAG_char]] = !{[[TYPE_char]], [[TYPE_char]], i64 0}