1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -jump-threading < %s | FileCheck %s
4 define void @test(i8* %ptr) {
7 ; CHECK-NEXT: call void @llvm.experimental.noalias.scope.decl(metadata !0)
8 ; CHECK-NEXT: br label [[LOOP:%.*]]
10 ; CHECK-NEXT: [[I:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[I_INC:%.*]], [[LATCH:%.*]] ]
11 ; CHECK-NEXT: [[C:%.*]] = icmp eq i32 [[I]], 100
12 ; CHECK-NEXT: br i1 [[C]], label [[EXIT:%.*]], label [[LATCH]]
14 ; CHECK-NEXT: call void @llvm.experimental.noalias.scope.decl(metadata !3)
15 ; CHECK-NEXT: store i8 0, i8* [[PTR:%.*]], align 1, !noalias !0
16 ; CHECK-NEXT: store i8 1, i8* [[PTR]], align 1, !noalias !3
17 ; CHECK-NEXT: [[I_INC]] = add i32 [[I]], 1
18 ; CHECK-NEXT: br label [[LOOP]]
20 ; CHECK-NEXT: call void @llvm.experimental.noalias.scope.decl(metadata !5)
21 ; CHECK-NEXT: store i8 0, i8* [[PTR]], align 1, !noalias !0
22 ; CHECK-NEXT: store i8 1, i8* [[PTR]], align 1, !noalias !5
23 ; CHECK-NEXT: ret void
26 call void @llvm.experimental.noalias.scope.decl(metadata !0)
30 %i = phi i32 [ 0, %entry ], [ %i.inc, %latch ]
31 %c = icmp eq i32 %i, 100
32 br i1 %c, label %if, label %latch
38 %p = phi i1 [ true, %if ], [ false, %loop ]
39 call void @llvm.experimental.noalias.scope.decl(metadata !3)
40 store i8 0, i8* %ptr, !noalias !0
41 store i8 1, i8* %ptr, !noalias !3
42 %i.inc = add i32 %i, 1
43 br i1 %p, label %exit, label %loop
49 declare void @llvm.experimental.noalias.scope.decl(metadata)
52 !1 = distinct !{!1, !2, !"scope1"}
53 !2 = distinct !{!2, !"domain"}
55 !4 = distinct !{!4, !2, !"scope2"}
58 ; CHECK: !1 = distinct !{!1, !2, !"scope1"}
59 ; CHECK: !2 = distinct !{!2, !"domain"}
61 ; CHECK: !4 = distinct !{!4, !2, !"scope2"}
63 ; CHECK: !6 = distinct !{!6, !2, !"scope2:thread"}