Reapply r121905 (automatic synthesis of @llvm.sadd.with.overflow) with a fix for...
[oota-llvm.git] / test / Transforms / GVN / preserve-tbaa.ll
1 ; RUN: opt -tbaa -basicaa -gvn -S < %s | FileCheck %s
2
3 target datalayout = "e-p:64:64:64"
4
5 ; GVN should preserve the TBAA tag on loads when doing PRE.
6
7 ; CHECK: @test
8 ; CHECK: %tmp33.pre = load i16* undef, align 2, !tbaa !0
9 ; CHECK: br label %for.body
10 define void @test() nounwind {
11 entry:
12   br i1 undef, label %bb.nph, label %for.end
13
14 bb.nph:                                           ; preds = %entry
15   br label %for.body
16
17 for.body:                                         ; preds = %for.body, %bb.nph
18   %tmp33 = load i16* undef, align 2, !tbaa !0
19   store i16 undef, i16* undef, align 2, !tbaa !0
20   br i1 false, label %for.end, label %for.body
21
22 for.end:                                          ; preds = %for.body, %entry
23   ret void
24 }
25
26 !0 = metadata !{metadata !"short", metadata !1}
27 !1 = metadata !{metadata !"omnipotent char", metadata !2}
28 !2 = metadata !{metadata !"Simple C/C++ TBAA", null}