2020-09-18 04:51:01 +08:00
|
|
|
; RUN: opt -analyze -branch-prob < %s -enable-new-pm=0 | FileCheck %s
|
2016-05-05 10:59:57 +08:00
|
|
|
; RUN: opt < %s -passes='print<branch-prob>' -disable-output 2>&1 | FileCheck %s
|
2016-04-19 03:01:28 +08:00
|
|
|
|
|
|
|
declare i32 @llvm.experimental.deoptimize.i32(...)
|
|
|
|
|
|
|
|
define i32 @test1(i32 %a, i32 %b) {
|
2016-05-05 10:59:57 +08:00
|
|
|
; CHECK-LABEL: Printing analysis {{.*}} for function 'test1':
|
2016-04-19 03:01:28 +08:00
|
|
|
entry:
|
|
|
|
%cond = icmp eq i32 %a, 42
|
|
|
|
br i1 %cond, label %exit, label %deopt
|
|
|
|
|
2020-06-18 17:20:55 +08:00
|
|
|
; CHECK: edge entry -> exit probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge]
|
|
|
|
; CHECK: edge entry -> deopt probability is 0x00000000 / 0x80000000 = 0.00%
|
2016-04-19 03:01:28 +08:00
|
|
|
|
|
|
|
deopt:
|
|
|
|
%rval = call i32(...) @llvm.experimental.deoptimize.i32() [ "deopt"() ]
|
|
|
|
ret i32 %rval
|
|
|
|
|
|
|
|
exit:
|
|
|
|
ret i32 %b
|
|
|
|
}
|