summaryrefslogtreecommitdiffstats
path: root/llvm/test/Analysis/BranchProbabilityInfo/deopt-intrinsic.ll
blob: 8728d4ab8fefc9b0b1333281f71dfa1695a153ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
; RUN: opt -analyze -branch-prob < %s | FileCheck %s

declare i32 @llvm.experimental.deoptimize.i32(...)

define i32 @test1(i32 %a, i32 %b) {
; CHECK-LABEL: Printing analysis 'Branch Probability Analysis' for function 'test1':
entry:
  %cond = icmp eq i32 %a, 42
  br i1 %cond, label %exit, label %deopt

; CHECK:  edge entry -> exit probability is 0x7ffff800 / 0x80000000 = 100.00% [HOT edge]
; CHECK:  edge entry -> deopt probability is 0x00000800 / 0x80000000 = 0.00%

deopt:
  %rval = call i32(...) @llvm.experimental.deoptimize.i32() [ "deopt"() ]
  ret i32 %rval

exit:
  ret i32 %b
}
OpenPOWER on IntegriCloud