Guest User

Untitled

a guest
Apr 9th, 2018
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
LLVM 1.00 KB | None | 0 0
  1. % cat eh2.ll
  2. ; ModuleID = 'eh1.cc'
  3.  
  4. declare void @f()
  5. declare void @g()
  6. declare void @e()
  7.  
  8.  
  9. define void @test() uwtable {
  10. entry:
  11.   call void @f()
  12.   invoke void @e() to label %cont unwind label %lpad
  13.  
  14. cont:
  15.   call void @g()
  16.   unreachable
  17.  
  18. lpad:
  19.   %lpad.32 = landingpad { i8*, i32 } personality i8*
  20.                bitcast (i32 (...)* @__gxx_personality_v0 to i8*) cleanup
  21.   ret void
  22. }
  23.  
  24.  
  25. % ./bin/opt -analyze -branch-prob eh2.ll
  26. Printing analysis 'Branch Probability Analysis' for function 'test':
  27. ---- Branch Probabilities ----
  28.   edge entry -> cont probability is 1 / 1024 = 0.0976562%
  29.   edge entry -> lpad probability is 1023 / 1024 = 99.9023% [HOT edge]
  30.  
  31.  
  32.  
  33. % ./bin/llc -O2 -debug-only=block-placement2 -enable-block-placement -o - eh2.ll
  34.         .file   "eh2.ll"
  35. Attempting merge from: BB#0 (derived from LLVM BB 'entry')
  36.     BB#1 (derived from LLVM BB 'cont') -> 16 / 32 = 50% (prob)
  37.     BB#2 (derived from LLVM BB 'lpad') -> 16 / 32 = 50% (prob)
Add Comment
Please, Sign In to add comment