BranchProb: modify the definition of an edge in BranchProbabilityInfo to handle
[oota-llvm.git] / test / CodeGen / Generic / MachineBranchProb.ll
1 ; RUN: llc < %s -print-machineinstrs=expand-isel-pseudos -o /dev/null 2>&1 | FileCheck %s
2
3 ; Make sure we have the correct weight attached to each successor.
4 define i32 @test2(i32 %x) nounwind uwtable readnone ssp {
5 ; CHECK: Machine code for function test2:
6 entry:
7   %conv = sext i32 %x to i64
8   switch i64 %conv, label %return [
9     i64 0, label %sw.bb
10     i64 1, label %sw.bb
11     i64 4, label %sw.bb
12     i64 5, label %sw.bb1
13   ], !prof !0
14 ; CHECK: BB#0: derived from LLVM BB %entry
15 ; CHECK: Successors according to CFG: BB#2(64) BB#4(14)
16 ; CHECK: BB#4: derived from LLVM BB %entry
17 ; CHECK: Successors according to CFG: BB#1(10) BB#5(4)
18 ; CHECK: BB#5: derived from LLVM BB %entry
19 ; CHECK: Successors according to CFG: BB#1(4) BB#3(7)
20
21 sw.bb:
22   br label %return
23
24 sw.bb1:
25   br label %return
26
27 return:
28   %retval.0 = phi i32 [ 5, %sw.bb1 ], [ 1, %sw.bb ], [ 0, %entry ]
29   ret i32 %retval.0
30 }
31
32 !0 = metadata !{metadata !"branch_weights", i32 7, i32 6, i32 4, i32 4, i32 64}