1; REQUIRES: asserts 2; RUN: opt -S -passes=dfa-jump-threading %s -debug-only=dfa-jump-threading 2>&1 | FileCheck %s 3 4; CHECK-COUNT-3: Exiting early due to unpredictability heuristic. 5 6@.str.1 = private unnamed_addr constant [3 x i8] c"10\00", align 1 7@.str.2 = private unnamed_addr constant [3 x i8] c"30\00", align 1 8@.str.3 = private unnamed_addr constant [3 x i8] c"20\00", align 1 9@.str.4 = private unnamed_addr constant [3 x i8] c"40\00", align 1 10 11define void @test1(i32 noundef %num, i32 noundef %num2) { 12entry: 13 br label %while.body 14 15while.body: ; preds = %entry, %sw.epilog 16 %num.addr.0 = phi i32 [ %num, %entry ], [ %num.addr.1, %sw.epilog ] 17 switch i32 %num.addr.0, label %sw.default [ 18 i32 10, label %sw.bb 19 i32 30, label %sw.bb1 20 i32 20, label %sw.bb2 21 i32 40, label %sw.bb3 22 ] 23 24sw.bb: ; preds = %while.body 25 %call.i = tail call i32 @bar(ptr noundef nonnull @.str.1) 26 br label %sw.epilog 27 28sw.bb1: ; preds = %while.body 29 %call.i4 = tail call i32 @bar(ptr noundef nonnull @.str.2) 30 br label %sw.epilog 31 32sw.bb2: ; preds = %while.body 33 %call.i5 = tail call i32 @bar(ptr noundef nonnull @.str.3) 34 br label %sw.epilog 35 36sw.bb3: ; preds = %while.body 37 %call.i6 = tail call i32 @bar(ptr noundef nonnull @.str.4) 38 %call = tail call noundef i32 @foo() 39 %add = add nsw i32 %call, %num2 40 br label %sw.epilog 41 42sw.default: ; preds = %while.body 43 ret void 44 45sw.epilog: ; preds = %sw.bb3, %sw.bb2, %sw.bb1, %sw.bb 46 %num.addr.1 = phi i32 [ %add, %sw.bb3 ], [ 40, %sw.bb2 ], [ 20, %sw.bb1 ], [ 30, %sw.bb ] 47 br label %while.body 48} 49 50 51define void @test2(i32 noundef %num, i32 noundef %num2) { 52entry: 53 br label %while.body 54 55while.body: ; preds = %entry, %sw.epilog 56 %num.addr.0 = phi i32 [ %num, %entry ], [ %num.addr.1, %sw.epilog ] 57 switch i32 %num.addr.0, label %sw.default [ 58 i32 10, label %sw.epilog 59 i32 30, label %sw.bb1 60 i32 20, label %sw.bb2 61 i32 40, label %sw.bb3 62 ] 63 64sw.bb1: ; preds = %while.body 65 br label %sw.epilog 66 67sw.bb2: ; preds = %while.body 68 br label %sw.epilog 69 70sw.bb3: ; preds = %while.body 71 br label %sw.epilog 72 73sw.default: ; preds = %while.body 74 ret void 75 76sw.epilog: ; preds = %while.body, %sw.bb3, %sw.bb2, %sw.bb1 77 %.str.4.sink = phi ptr [ @.str.4, %sw.bb3 ], [ @.str.3, %sw.bb2 ], [ @.str.2, %sw.bb1 ], [ @.str.1, %while.body ] 78 %num.addr.1 = phi i32 [ %num2, %sw.bb3 ], [ 40, %sw.bb2 ], [ 20, %sw.bb1 ], [ 30, %while.body ] 79 %call.i6 = tail call i32 @bar(ptr noundef nonnull %.str.4.sink) 80 br label %while.body 81} 82 83 84define void @test3(i32 noundef %num, i32 noundef %num2) { 85entry: 86 %add = add nsw i32 %num2, 40 87 br label %while.body 88 89while.body: ; preds = %entry, %sw.epilog 90 %num.addr.0 = phi i32 [ %num, %entry ], [ %num.addr.1, %sw.epilog ] 91 switch i32 %num.addr.0, label %sw.default [ 92 i32 10, label %sw.bb 93 i32 30, label %sw.bb1 94 i32 20, label %sw.bb2 95 i32 40, label %sw.bb3 96 ] 97 98sw.bb: ; preds = %while.body 99 %call.i = tail call i32 @bar(ptr noundef nonnull @.str.1) 100 br label %sw.epilog 101 102sw.bb1: ; preds = %while.body 103 %call.i5 = tail call i32 @bar(ptr noundef nonnull @.str.2) 104 br label %sw.epilog 105 106sw.bb2: ; preds = %while.body 107 %call.i6 = tail call i32 @bar(ptr noundef nonnull @.str.3) 108 br label %sw.epilog 109 110sw.bb3: ; preds = %while.body 111 %call.i7 = tail call i32 @bar(ptr noundef nonnull @.str.4) 112 br label %sw.epilog 113 114sw.default: ; preds = %while.body 115 ret void 116 117sw.epilog: ; preds = %sw.bb3, %sw.bb2, %sw.bb1, %sw.bb 118 %num.addr.1 = phi i32 [ %add, %sw.bb3 ], [ 40, %sw.bb2 ], [ 20, %sw.bb1 ], [ 30, %sw.bb ] 119 br label %while.body 120} 121 122 123declare noundef i32 @foo() 124declare noundef i32 @bar(ptr nocapture noundef readonly) 125