|
| 1 | +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py |
| 2 | +; RUN: opt -S -codegenprepare -mtriple=aarch64-none-linux-gnu < %s | FileCheck %s |
| 3 | + |
| 4 | +@_MergedGlobals = external dso_local global <{ i32, i32 }>, align 4 |
| 5 | + |
| 6 | +define dso_local i32 @f(i1 %a, i8 %b) local_unnamed_addr { |
| 7 | +; CHECK-LABEL: @f( |
| 8 | +; CHECK-NEXT: br label [[TMP6:%.*]] |
| 9 | +; CHECK: 1: |
| 10 | +; CHECK-NEXT: br i1 [[A:%.*]], label [[TMP2:%.*]], label [[TMP6]] |
| 11 | +; CHECK: 2: |
| 12 | +; CHECK-NEXT: [[TMP3:%.*]] = phi i32* [ getelementptr inbounds (<{ i32, i32 }>, <{ i32, i32 }>* @_MergedGlobals, i32 0, i32 1), [[TMP1:%.*]] ], [ [[TMP16:%.*]], [[TMP14:%.*]] ] |
| 13 | +; CHECK-NEXT: [[TMP4:%.*]] = phi i32* [ getelementptr inbounds (<{ i32, i32 }>, <{ i32, i32 }>* @_MergedGlobals, i32 0, i32 1), [[TMP1]] ], [ [[TMP15:%.*]], [[TMP14]] ] |
| 14 | +; CHECK-NEXT: ret i32 0 |
| 15 | +; CHECK: 5: |
| 16 | +; CHECK-NEXT: br label [[TMP6]] |
| 17 | +; CHECK: 6: |
| 18 | +; CHECK-NEXT: [[TMP7:%.*]] = phi i32* [ getelementptr inbounds (<{ i32, i32 }>, <{ i32, i32 }>* @_MergedGlobals, i32 0, i32 0), [[TMP0:%.*]] ], [ [[TMP3]], [[TMP5:%.*]] ], [ getelementptr inbounds (<{ i32, i32 }>, <{ i32, i32 }>* @_MergedGlobals, i32 0, i32 1), [[TMP1]] ] |
| 19 | +; CHECK-NEXT: [[TMP8:%.*]] = phi i32* [ getelementptr inbounds (<{ i32, i32 }>, <{ i32, i32 }>* @_MergedGlobals, i32 0, i32 0), [[TMP0]] ], [ [[TMP4]], [[TMP5]] ], [ getelementptr inbounds (<{ i32, i32 }>, <{ i32, i32 }>* @_MergedGlobals, i32 0, i32 1), [[TMP1]] ] |
| 20 | +; CHECK-NEXT: br label [[TMP9:%.*]] |
| 21 | +; CHECK: 9: |
| 22 | +; CHECK-NEXT: [[TMP10:%.*]] = phi i32* [ [[TMP16]], [[TMP14]] ], [ [[TMP7]], [[TMP6]] ] |
| 23 | +; CHECK-NEXT: [[TMP11:%.*]] = phi i32* [ [[TMP16]], [[TMP14]] ], [ [[TMP8]], [[TMP6]] ] |
| 24 | +; CHECK-NEXT: [[TMP12:%.*]] = phi i32* [ [[TMP15]], [[TMP14]] ], [ [[TMP8]], [[TMP6]] ] |
| 25 | +; CHECK-NEXT: br i1 [[A]], label [[TMP14]], label [[TMP13:%.*]] |
| 26 | +; CHECK: 13: |
| 27 | +; CHECK-NEXT: store i32 5, i32* [[TMP11]], align 4 |
| 28 | +; CHECK-NEXT: br label [[TMP14]] |
| 29 | +; CHECK: 14: |
| 30 | +; CHECK-NEXT: [[TMP15]] = phi i32* [ [[TMP12]], [[TMP13]] ], [ [[TMP10]], [[TMP9]] ] |
| 31 | +; CHECK-NEXT: [[TMP16]] = phi i32* [ [[TMP11]], [[TMP13]] ], [ [[TMP10]], [[TMP9]] ] |
| 32 | +; CHECK-NEXT: br i1 [[A]], label [[TMP2]], label [[TMP9]] |
| 33 | +; |
| 34 | + br label %11 |
| 35 | + |
| 36 | +1: ; No predecessors! |
| 37 | + br i1 %a, label %2, label %10 |
| 38 | + |
| 39 | +2: ; preds = %22, %1 |
| 40 | + %3 = phi i32* [ getelementptr inbounds (<{ i32, i32 }>, <{ i32, i32 }>* @_MergedGlobals, i32 0, i32 1), %1 ], [ %21, %22 ] |
| 41 | + %4 = phi i32* [ getelementptr inbounds (<{ i32, i32 }>, <{ i32, i32 }>* @_MergedGlobals, i32 0, i32 1), %1 ], [ %20, %22 ] |
| 42 | + ret i32 0 |
| 43 | + |
| 44 | +5: ; No predecessors! |
| 45 | + %6 = icmp ugt i8 %b, 50 |
| 46 | + br label %7 |
| 47 | + |
| 48 | +7: ; preds = %10, %5 |
| 49 | + %8 = phi i32* [ %3, %5 ], [ getelementptr inbounds (<{ i32, i32 }>, <{ i32, i32 }>* @_MergedGlobals, i32 0, i32 1), %10 ] |
| 50 | + %9 = phi i32* [ %4, %5 ], [ getelementptr inbounds (<{ i32, i32 }>, <{ i32, i32 }>* @_MergedGlobals, i32 0, i32 1), %10 ] |
| 51 | + br label %11 |
| 52 | + |
| 53 | +10: ; preds = %1 |
| 54 | + br label %7 |
| 55 | + |
| 56 | +11: ; preds = %7, %0 |
| 57 | + %12 = phi i32* [ getelementptr inbounds (<{ i32, i32 }>, <{ i32, i32 }>* @_MergedGlobals, i32 0, i32 0), %0 ], [ %8, %7 ] |
| 58 | + %13 = phi i32* [ getelementptr inbounds (<{ i32, i32 }>, <{ i32, i32 }>* @_MergedGlobals, i32 0, i32 0), %0 ], [ %9, %7 ] |
| 59 | + br label %14 |
| 60 | + |
| 61 | +14: ; preds = %19, %11 |
| 62 | + %15 = phi i32* [ %21, %19 ], [ %12, %11 ] |
| 63 | + %16 = phi i32* [ %21, %19 ], [ %13, %11 ] |
| 64 | + %17 = phi i32* [ %20, %19 ], [ %13, %11 ] |
| 65 | + br i1 %a, label %19, label %18 |
| 66 | + |
| 67 | +18: ; preds = %14 |
| 68 | + store i32 5, i32* %16, align 4 |
| 69 | + br label %19 |
| 70 | + |
| 71 | +19: ; preds = %18, %14 |
| 72 | + %20 = phi i32* [ %17, %18 ], [ %15, %14 ] |
| 73 | + %21 = phi i32* [ %16, %18 ], [ %15, %14 ] |
| 74 | + br i1 %a, label %22, label %14 |
| 75 | + |
| 76 | +22: ; preds = %19 |
| 77 | + br label %2 |
| 78 | +} |
0 commit comments