1 ; RUN: opt -passes=gvn -S < %s | FileCheck %s
3 target datalayout = "e-p:64:64:64"
5 ; GVN should preserve the TBAA tag on loads when doing PRE.
8 ; CHECK: %tmp33.pre = load i16, ptr %P, align 2, !tbaa !0
9 ; CHECK: br label %for.body
10 define void @test(ptr %P, ptr %Q) nounwind {
12 br i1 undef, label %bb.nph, label %for.end
14 bb.nph: ; preds = %entry
17 for.body: ; preds = %for.body, %bb.nph
18 %tmp33 = load i16, ptr %P, align 2, !tbaa !0
19 store i16 %tmp33, ptr %Q
21 store i16 0, ptr %P, align 2, !tbaa !0
22 br i1 false, label %for.end, label %for.body
24 for.end: ; preds = %for.body, %entry
29 !1 = !{!"omnipotent char", !2}
30 !2 = !{!"Simple C/C++ TBAA"}