1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ;RUN: opt -newgvn -S < %s | FileCheck %s
3 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
4 target triple = "x86_64-apple-macosx10.12.0"
6 ; Function Attrs: nounwind ssp uwtable
7 define void @reorder_ref_pic_list() local_unnamed_addr {
8 ; CHECK-LABEL: @reorder_ref_pic_list(
10 ; CHECK-NEXT: br i1 undef, label [[FOR_END:%.*]], label [[FOR_BODY_PREHEADER:%.*]]
11 ; CHECK: for.body.preheader:
12 ; CHECK-NEXT: br label [[FOR_BODY:%.*]]
14 ; CHECK-NEXT: [[REFIDXLX_0:%.*]] = phi i32 [ [[INC_I51:%.*]], [[IF_ELSE58:%.*]] ], [ 0, [[FOR_BODY_PREHEADER]] ]
15 ; CHECK-NEXT: br i1 undef, label [[IF_THEN13:%.*]], label [[IF_ELSE58]]
17 ; CHECK-NEXT: [[INC_I:%.*]] = add nsw i32 [[REFIDXLX_0]], 1
18 ; CHECK-NEXT: br label [[FOR_BODY8_I:%.*]]
20 ; CHECK-NEXT: br i1 undef, label [[FOR_INC24_I:%.*]], label [[IF_THEN17_I:%.*]]
22 ; CHECK-NEXT: br label [[FOR_INC24_I]]
24 ; CHECK-NEXT: br label [[FOR_BODY8_I]]
26 ; CHECK-NEXT: [[INC_I51]] = add nsw i32 [[REFIDXLX_0]], 1
27 ; CHECK-NEXT: br label [[FOR_BODY]]
29 ; CHECK-NEXT: ret void
32 br i1 undef, label %for.end, label %for.body.preheader
34 for.body.preheader: ; preds = %entry
37 for.body: ; preds = %if.else58, %for.body.preheader
38 %refIdxLX.0 = phi i32 [ %inc.i51, %if.else58 ], [ 0, %for.body.preheader ]
39 br i1 undef, label %if.then13, label %if.else58
41 if.then13: ; preds = %for.body
42 %inc.i = add nsw i32 %refIdxLX.0, 1
45 for.body8.i: ; preds = %for.inc24.i, %if.then13
46 %nIdx.052.i = phi i32 [ %inc.i, %if.then13 ], [ %nIdx.1.i, %for.inc24.i ]
47 br i1 undef, label %for.inc24.i, label %if.then17.i
49 if.then17.i: ; preds = %for.body8.i
52 for.inc24.i: ; preds = %if.then17.i, %for.body8.i
53 %nIdx.1.i = phi i32 [ undef, %if.then17.i ], [ %nIdx.052.i, %for.body8.i ]
56 if.else58: ; preds = %for.body
57 %inc.i51 = add nsw i32 %refIdxLX.0, 1
60 for.end: ; preds = %entry