Merging r260703:
[oota-llvm.git] / test / Transforms / InstCombine / load-combine-metadata.ll
1 ; RUN: opt -instcombine -S < %s | FileCheck %s
2
3 target datalayout = "e-m:e-p:64:64:64-i64:64-f80:128-n8:16:32:64-S128"
4
5 ; CHECK-LABEL: @test_load_load_combine_metadata(
6 ; Check that range and AA metadata is combined
7 ; CHECK: %[[V:.*]] = load i32, i32* %0
8 ; CHECK-SAME: !tbaa !{{[0-9]+}}
9 ; CHECK-SAME: !range ![[RANGE:[0-9]+]]
10 ; CHECK: store i32 %[[V]], i32* %1
11 ; CHECK: store i32 %[[V]], i32* %2
12 define void @test_load_load_combine_metadata(i32*, i32*, i32*) {
13   %a = load i32, i32* %0, !tbaa !8, !range !0, !alias.scope !5, !noalias !6
14   %b = load i32, i32* %0, !tbaa !8, !range !1
15   store i32 %a, i32* %1
16   store i32 %b, i32* %2
17   ret void
18 }
19
20 ; CHECK: ![[RANGE]] = !{i32 0, i32 5, i32 7, i32 9}
21 !0 = !{ i32 0, i32 5 }
22 !1 = !{ i32 7, i32 9 }
23 !2 = !{!2}
24 !3 = !{!3, !2}
25 !4 = !{!4, !2}
26 !5 = !{!3}
27 !6 = !{!4}
28 !7 = !{ !"tbaa root" }
29 !8 = !{ !7, !7, i64 0 }