44 lines · plain
1; RUN: opt -S -passes=jump-threading %s | FileCheck %s2 3; Test if edge weights are properly updated after jump threading.4 5; CHECK: !2 = !{!"branch_weights", i32 1561806291, i32 585677357}6 7define void @foo(i32 %n) !prof !0 {8entry:9 %cmp = icmp sgt i32 %n, 1010 br i1 %cmp, label %if.then.1, label %if.else.1, !prof !111 12if.then.1:13 tail call void @a()14 br label %if.cond15 16if.else.1:17 tail call void @b()18 br label %if.cond19 20if.cond:21 %cmp1 = icmp sgt i32 %n, 522 br i1 %cmp1, label %if.then.2, label %if.else.2, !prof !223 24if.then.2:25 tail call void @c()26 br label %if.end27 28if.else.2:29 tail call void @d()30 br label %if.end31 32if.end:33 ret void34}35 36declare void @a()37declare void @b()38declare void @c()39declare void @d()40 41!0 = !{!"function_entry_count", i64 1}42!1 = !{!"branch_weights", i32 10, i32 5}43!2 = !{!"branch_weights", i32 10, i32 1}44