1; RUN: opt < %s -analyze -branch-prob | FileCheck %s 2; RUN: opt < %s -analyze -lazy-branch-prob | FileCheck %s 3; RUN: opt < %s -passes='print<branch-prob>' -disable-output 2>&1 | FileCheck %s 4 5define i32 @test1(i32 %i, i32* %a) { 6; CHECK: Printing analysis {{.*}} for function 'test1' 7entry: 8 br label %body 9; CHECK: edge entry -> body probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge] 10 11body: 12 %iv = phi i32 [ 0, %entry ], [ %next, %body ] 13 %base = phi i32 [ 0, %entry ], [ %sum, %body ] 14 %arrayidx = getelementptr inbounds i32, i32* %a, i32 %iv 15 %0 = load i32, i32* %arrayidx 16 %sum = add nsw i32 %0, %base 17 %next = add i32 %iv, 1 18 %exitcond = icmp eq i32 %next, %i 19 br i1 %exitcond, label %exit, label %body 20; CHECK: edge body -> exit probability is 0x04000000 / 0x80000000 = 3.12% 21; CHECK: edge body -> body probability is 0x7c000000 / 0x80000000 = 96.88% [HOT edge] 22 23exit: 24 ret i32 %sum 25} 26 27define i32 @test2(i32 %i, i32 %a, i32 %b) { 28; CHECK: Printing analysis {{.*}} for function 'test2' 29entry: 30 %cond = icmp ult i32 %i, 42 31 br i1 %cond, label %then, label %else, !prof !0 32; CHECK: edge entry -> then probability is 0x78787878 / 0x80000000 = 94.12% [HOT edge] 33; CHECK: edge entry -> else probability is 0x07878788 / 0x80000000 = 5.88% 34 35then: 36 br label %exit 37; CHECK: edge then -> exit probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge] 38 39else: 40 br label %exit 41; CHECK: edge else -> exit probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge] 42 43exit: 44 %result = phi i32 [ %a, %then ], [ %b, %else ] 45 ret i32 %result 46} 47 48!0 = !{!"branch_weights", i32 64, i32 4} 49 50define i32 @test3(i32 %i, i32 %a, i32 %b, i32 %c, i32 %d, i32 %e) { 51; CHECK: Printing analysis {{.*}} for function 'test3' 52entry: 53 switch i32 %i, label %case_a [ i32 1, label %case_b 54 i32 2, label %case_c 55 i32 3, label %case_d 56 i32 4, label %case_e ], !prof !1 57; CHECK: edge entry -> case_a probability is 0x06666666 / 0x80000000 = 5.00% 58; CHECK: edge entry -> case_b probability is 0x06666666 / 0x80000000 = 5.00% 59; CHECK: edge entry -> case_c probability is 0x66666666 / 0x80000000 = 80.00% 60; CHECK: edge entry -> case_d probability is 0x06666666 / 0x80000000 = 5.00% 61; CHECK: edge entry -> case_e probability is 0x06666666 / 0x80000000 = 5.00% 62 63case_a: 64 br label %exit 65; CHECK: edge case_a -> exit probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge] 66 67case_b: 68 br label %exit 69; CHECK: edge case_b -> exit probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge] 70 71case_c: 72 br label %exit 73; CHECK: edge case_c -> exit probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge] 74 75case_d: 76 br label %exit 77; CHECK: edge case_d -> exit probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge] 78 79case_e: 80 br label %exit 81; CHECK: edge case_e -> exit probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge] 82 83exit: 84 %result = phi i32 [ %a, %case_a ], 85 [ %b, %case_b ], 86 [ %c, %case_c ], 87 [ %d, %case_d ], 88 [ %e, %case_e ] 89 ret i32 %result 90} 91 92!1 = !{!"branch_weights", i32 4, i32 4, i32 64, i32 4, i32 4} 93 94define i32 @test4(i32 %x) nounwind uwtable readnone ssp { 95; CHECK: Printing analysis {{.*}} for function 'test4' 96entry: 97 %conv = sext i32 %x to i64 98 switch i64 %conv, label %return [ 99 i64 0, label %sw.bb 100 i64 1, label %sw.bb 101 i64 2, label %sw.bb 102 i64 5, label %sw.bb1 103 ], !prof !2 104; CHECK: edge entry -> return probability is 0x0a8a8a8b / 0x80000000 = 8.24% 105; CHECK: edge entry -> sw.bb probability is 0x15151515 / 0x80000000 = 16.47% 106; CHECK: edge entry -> sw.bb1 probability is 0x60606060 / 0x80000000 = 75.29% 107 108sw.bb: 109 br label %return 110 111sw.bb1: 112 br label %return 113 114return: 115 %retval.0 = phi i32 [ 5, %sw.bb1 ], [ 1, %sw.bb ], [ 0, %entry ] 116 ret i32 %retval.0 117} 118 119!2 = !{!"branch_weights", i32 7, i32 6, i32 4, i32 4, i32 64} 120 121declare void @coldfunc() cold 122 123define i32 @test5(i32 %a, i32 %b, i1 %flag) { 124; CHECK: Printing analysis {{.*}} for function 'test5' 125entry: 126 br i1 %flag, label %then, label %else 127; CHECK: edge entry -> then probability is 0x07878788 / 0x80000000 = 5.88% 128; CHECK: edge entry -> else probability is 0x78787878 / 0x80000000 = 94.12% [HOT edge] 129 130then: 131 call void @coldfunc() 132 br label %exit 133; CHECK: edge then -> exit probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge] 134 135else: 136 br label %exit 137; CHECK: edge else -> exit probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge] 138 139exit: 140 %result = phi i32 [ %a, %then ], [ %b, %else ] 141 ret i32 %result 142} 143 144define i32 @test_cold_loop(i32 %a, i32 %b) { 145entry: 146 %cond1 = icmp eq i32 %a, 42 147 br i1 %cond1, label %header, label %exit 148 149header: 150 br label %body 151 152body: 153 %cond2 = icmp eq i32 %b, 42 154 br i1 %cond2, label %header, label %exit 155; CHECK: edge body -> header probability is 0x40000000 / 0x80000000 = 50.00% 156 157exit: 158 call void @coldfunc() 159 ret i32 %b 160} 161 162declare i32 @regular_function(i32 %i) 163 164define i32 @test_cold_call_sites_with_prof(i32 %a, i32 %b, i1 %flag, i1 %flag2) { 165; CHECK: Printing analysis {{.*}} for function 'test_cold_call_sites_with_prof' 166entry: 167 br i1 %flag, label %then, label %else 168; CHECK: edge entry -> then probability is 0x07878788 / 0x80000000 = 5.88% 169; CHECK: edge entry -> else probability is 0x78787878 / 0x80000000 = 94.12% [HOT edge] 170 171then: 172 br i1 %flag2, label %then2, label %else2, !prof !3 173; CHECK: edge then -> then2 probability is 0x7ebb907a / 0x80000000 = 99.01% [HOT edge] 174; CHECK: edge then -> else2 probability is 0x01446f86 / 0x80000000 = 0.99% 175 176then2: 177 br label %join 178; CHECK: edge then2 -> join probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge] 179 180else2: 181 br label %join 182; CHECK: edge else2 -> join probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge] 183 184join: 185 %joinresult = phi i32 [ %a, %then2 ], [ %b, %else2 ] 186 call void @coldfunc() 187 br label %exit 188; CHECK: edge join -> exit probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge] 189 190else: 191 br label %exit 192; CHECK: edge else -> exit probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge] 193 194exit: 195 %result = phi i32 [ %joinresult, %join ], [ %b, %else ] 196 ret i32 %result 197} 198 199!3 = !{!"branch_weights", i32 100, i32 1} 200 201define i32 @test_cold_call_sites(i32* %a) { 202; Test that edges to blocks post-dominated by cold call sites 203; are marked as not expected to be taken. 204; TODO(dnovillo) The calls to regular_function should not be merged, but 205; they are currently being merged. Convert this into a code generation test 206; after that is fixed. 207 208; CHECK: Printing analysis {{.*}} for function 'test_cold_call_sites' 209; CHECK: edge entry -> then probability is 0x07878788 / 0x80000000 = 5.88% 210; CHECK: edge entry -> else probability is 0x78787878 / 0x80000000 = 94.12% [HOT edge] 211 212entry: 213 %gep1 = getelementptr i32, i32* %a, i32 1 214 %val1 = load i32, i32* %gep1 215 %cond1 = icmp ugt i32 %val1, 1 216 br i1 %cond1, label %then, label %else 217 218then: 219 ; This function is not declared cold, but this call site is. 220 %val4 = call i32 @regular_function(i32 %val1) cold 221 br label %exit 222 223else: 224 %gep2 = getelementptr i32, i32* %a, i32 2 225 %val2 = load i32, i32* %gep2 226 %val3 = call i32 @regular_function(i32 %val2) 227 br label %exit 228 229exit: 230 %ret = phi i32 [ %val4, %then ], [ %val3, %else ] 231 ret i32 %ret 232} 233 234; CHECK-LABEL: test_invoke_code_callsite1 235define i32 @test_invoke_code_callsite1(i1 %c) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { 236entry: 237 br i1 %c, label %if.then, label %if.end 238; Edge "entry->if.end" should have higher probability based on the cold call 239; heuristic which treat %if.then as a cold block because the normal destination 240; of the invoke instruction in %if.then is post-dominated by ColdFunc(). 241; CHECK: edge entry -> if.then probability is 0x07878788 / 0x80000000 = 5.88% 242; CHECK: edge entry -> if.end probability is 0x78787878 / 0x80000000 = 94.12% [HOT edge] 243 244if.then: 245 invoke i32 @InvokeCall() 246 to label %invoke.cont unwind label %lpad 247; CHECK: edge if.then -> invoke.cont probability is 0x7ffff800 / 0x80000000 = 100.00% [HOT edge] 248; CHECK: edge if.then -> lpad probability is 0x00000800 / 0x80000000 = 0.00% 249 250invoke.cont: 251 call void @ColdFunc() #0 252 br label %if.end 253 254lpad: 255 %ll = landingpad { i8*, i32 } 256 cleanup 257 br label %if.end 258 259if.end: 260 ret i32 0 261} 262 263; CHECK-LABEL: test_invoke_code_callsite2 264define i32 @test_invoke_code_callsite2(i1 %c) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { 265entry: 266 br i1 %c, label %if.then, label %if.end 267 268; CHECK: edge entry -> if.then probability is 0x40000000 / 0x80000000 = 50.00% 269; CHECK: edge entry -> if.end probability is 0x40000000 / 0x80000000 = 50.00% 270 271if.then: 272 invoke i32 @InvokeCall() 273 to label %invoke.cont unwind label %lpad 274; The cold call heuristic should not kick in when the cold callsite is in EH path. 275; CHECK: edge if.then -> invoke.cont probability is 0x7ffff800 / 0x80000000 = 100.00% [HOT edge] 276; CHECK: edge if.then -> lpad probability is 0x00000800 / 0x80000000 = 0.00% 277 278invoke.cont: 279 br label %if.end 280 281lpad: 282 %ll = landingpad { i8*, i32 } 283 cleanup 284 call void @ColdFunc() #0 285 br label %if.end 286 287if.end: 288 ret i32 0 289} 290 291; CHECK-LABEL: test_invoke_code_callsite3 292define i32 @test_invoke_code_callsite3(i1 %c) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { 293entry: 294 br i1 %c, label %if.then, label %if.end 295; CHECK: edge entry -> if.then probability is 0x07878788 / 0x80000000 = 5.88% 296; CHECK: edge entry -> if.end probability is 0x78787878 / 0x80000000 = 94.12% [HOT edge] 297 298if.then: 299 invoke i32 @InvokeCall() 300 to label %invoke.cont unwind label %lpad 301; Regardless of cold calls, edge weights from a invoke instruction should be 302; determined by the invoke heuristic. 303; CHECK: edge if.then -> invoke.cont probability is 0x7ffff800 / 0x80000000 = 100.00% [HOT edge] 304; CHECK: edge if.then -> lpad probability is 0x00000800 / 0x80000000 = 0.00% 305 306invoke.cont: 307 call void @ColdFunc() #0 308 br label %if.end 309 310lpad: 311 %ll = landingpad { i8*, i32 } 312 cleanup 313 call void @ColdFunc() #0 314 br label %if.end 315 316if.end: 317 ret i32 0 318} 319 320declare i32 @__gxx_personality_v0(...) 321declare void @ColdFunc() 322declare i32 @InvokeCall() 323 324attributes #0 = { cold } 325 326 327define i32 @zero1(i32 %i, i32 %a, i32 %b) { 328; CHECK: Printing analysis {{.*}} for function 'zero1' 329entry: 330 %cond = icmp eq i32 %i, 0 331 br i1 %cond, label %then, label %else 332; CHECK: edge entry -> then probability is 0x30000000 / 0x80000000 = 37.50% 333; CHECK: edge entry -> else probability is 0x50000000 / 0x80000000 = 62.50% 334 335then: 336 br label %exit 337 338else: 339 br label %exit 340 341exit: 342 %result = phi i32 [ %a, %then ], [ %b, %else ] 343 ret i32 %result 344} 345 346define i32 @zero2(i32 %i, i32 %a, i32 %b) { 347; CHECK: Printing analysis {{.*}} for function 'zero2' 348entry: 349 %cond = icmp ne i32 %i, -1 350 br i1 %cond, label %then, label %else 351; CHECK: edge entry -> then probability is 0x50000000 / 0x80000000 = 62.50% 352; CHECK: edge entry -> else probability is 0x30000000 / 0x80000000 = 37.50% 353 354then: 355 br label %exit 356 357else: 358 br label %exit 359 360exit: 361 %result = phi i32 [ %a, %then ], [ %b, %else ] 362 ret i32 %result 363} 364 365define i32 @zero3(i32 %i, i32 %a, i32 %b) { 366; CHECK: Printing analysis {{.*}} for function 'zero3' 367entry: 368; AND'ing with a single bit bitmask essentially leads to a bool comparison, 369; meaning we don't have probability information. 370 %and = and i32 %i, 2 371 %tobool = icmp eq i32 %and, 0 372 br i1 %tobool, label %then, label %else 373; CHECK: edge entry -> then probability is 0x40000000 / 0x80000000 = 50.00% 374; CHECK: edge entry -> else probability is 0x40000000 / 0x80000000 = 50.00% 375 376then: 377; AND'ing with other bitmask might be something else, so we still assume the 378; usual probabilities. 379 %and2 = and i32 %i, 5 380 %tobool2 = icmp eq i32 %and2, 0 381 br i1 %tobool2, label %else, label %exit 382; CHECK: edge then -> else probability is 0x30000000 / 0x80000000 = 37.50% 383; CHECK: edge then -> exit probability is 0x50000000 / 0x80000000 = 62.50% 384 385else: 386 br label %exit 387 388exit: 389 %result = phi i32 [ %a, %then ], [ %b, %else ] 390 ret i32 %result 391} 392 393define i32 @test_unreachable_with_prof_greater(i32 %a, i32 %b) { 394; CHECK: Printing analysis {{.*}} for function 'test_unreachable_with_prof_greater' 395entry: 396 %cond = icmp eq i32 %a, 42 397 br i1 %cond, label %exit, label %unr, !prof !4 398 399; CHECK: edge entry -> exit probability is 0x7fffffff / 0x80000000 = 100.00% [HOT edge] 400; CHECK: edge entry -> unr probability is 0x00000001 / 0x80000000 = 0.00% 401 402unr: 403 unreachable 404 405exit: 406 ret i32 %b 407} 408 409!4 = !{!"branch_weights", i32 0, i32 1} 410 411define i32 @test_unreachable_with_prof_equal(i32 %a, i32 %b) { 412; CHECK: Printing analysis {{.*}} for function 'test_unreachable_with_prof_equal' 413entry: 414 %cond = icmp eq i32 %a, 42 415 br i1 %cond, label %exit, label %unr, !prof !5 416 417; CHECK: edge entry -> exit probability is 0x7fffffff / 0x80000000 = 100.00% [HOT edge] 418; CHECK: edge entry -> unr probability is 0x00000001 / 0x80000000 = 0.00% 419 420unr: 421 unreachable 422 423exit: 424 ret i32 %b 425} 426 427!5 = !{!"branch_weights", i32 2147483647, i32 1} 428 429define i32 @test_unreachable_with_prof_zero(i32 %a, i32 %b) { 430; CHECK: Printing analysis {{.*}} for function 'test_unreachable_with_prof_zero' 431entry: 432 %cond = icmp eq i32 %a, 42 433 br i1 %cond, label %exit, label %unr, !prof !6 434 435; CHECK: edge entry -> exit probability is 0x7fffffff / 0x80000000 = 100.00% [HOT edge] 436; CHECK: edge entry -> unr probability is 0x00000001 / 0x80000000 = 0.00% 437 438unr: 439 unreachable 440 441exit: 442 ret i32 %b 443} 444 445!6 = !{!"branch_weights", i32 0, i32 0} 446 447define i32 @test_unreachable_with_prof_less(i32 %a, i32 %b) { 448; CHECK: Printing analysis {{.*}} for function 'test_unreachable_with_prof_less' 449entry: 450 %cond = icmp eq i32 %a, 42 451 br i1 %cond, label %exit, label %unr, !prof !7 452 453; CHECK: edge entry -> exit probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge] 454; CHECK: edge entry -> unr probability is 0x00000000 / 0x80000000 = 0.00% 455 456unr: 457 unreachable 458 459exit: 460 ret i32 %b 461} 462 463!7 = !{!"branch_weights", i32 1, i32 0} 464 465define i32 @test_unreachable_with_switch_prof1(i32 %i, i32 %a, i32 %b, i32 %c, i32 %d, i32 %e) { 466; CHECK: Printing analysis {{.*}} for function 'test_unreachable_with_switch_prof1' 467entry: 468 switch i32 %i, label %case_a [ i32 1, label %case_b 469 i32 2, label %case_c 470 i32 3, label %case_d 471 i32 4, label %case_e ], !prof !8 472; CHECK: edge entry -> case_a probability is 0x00000001 / 0x80000000 = 0.00% 473; CHECK: edge entry -> case_b probability is 0x07ffffff / 0x80000000 = 6.25% 474; CHECK: edge entry -> case_c probability is 0x67ffffff / 0x80000000 = 81.25% [HOT edge] 475; CHECK: edge entry -> case_d probability is 0x07ffffff / 0x80000000 = 6.25% 476; CHECK: edge entry -> case_e probability is 0x07ffffff / 0x80000000 = 6.25% 477 478case_a: 479 unreachable 480 481case_b: 482 br label %exit 483; CHECK: edge case_b -> exit probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge] 484 485case_c: 486 br label %exit 487; CHECK: edge case_c -> exit probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge] 488 489case_d: 490 br label %exit 491; CHECK: edge case_d -> exit probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge] 492 493case_e: 494 br label %exit 495; CHECK: edge case_e -> exit probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge] 496 497exit: 498 %result = phi i32 [ %b, %case_b ], 499 [ %c, %case_c ], 500 [ %d, %case_d ], 501 [ %e, %case_e ] 502 ret i32 %result 503} 504 505!8 = !{!"branch_weights", i32 4, i32 4, i32 64, i32 4, i32 4} 506 507define i32 @test_unreachable_with_switch_prof2(i32 %i, i32 %a, i32 %b, i32 %c, i32 %d, i32 %e) { 508; CHECK: Printing analysis {{.*}} for function 'test_unreachable_with_switch_prof2' 509entry: 510 switch i32 %i, label %case_a [ i32 1, label %case_b 511 i32 2, label %case_c 512 i32 3, label %case_d 513 i32 4, label %case_e ], !prof !9 514; CHECK: edge entry -> case_a probability is 0x00000001 / 0x80000000 = 0.00% 515; CHECK: edge entry -> case_b probability is 0x00000001 / 0x80000000 = 0.00% 516; CHECK: edge entry -> case_c probability is 0x6aaaaaaa / 0x80000000 = 83.33% [HOT edge] 517; CHECK: edge entry -> case_d probability is 0x0aaaaaaa / 0x80000000 = 8.33% 518; CHECK: edge entry -> case_e probability is 0x0aaaaaaa / 0x80000000 = 8.33% 519 520case_a: 521 unreachable 522 523case_b: 524 unreachable 525 526case_c: 527 br label %exit 528; CHECK: edge case_c -> exit probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge] 529 530case_d: 531 br label %exit 532; CHECK: edge case_d -> exit probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge] 533 534case_e: 535 br label %exit 536; CHECK: edge case_e -> exit probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge] 537 538exit: 539 %result = phi i32 [ %c, %case_c ], 540 [ %d, %case_d ], 541 [ %e, %case_e ] 542 ret i32 %result 543} 544 545!9 = !{!"branch_weights", i32 4, i32 4, i32 64, i32 4, i32 4} 546 547define i32 @test_unreachable_with_switch_prof3(i32 %i, i32 %a, i32 %b, i32 %c, i32 %d, i32 %e) { 548; CHECK: Printing analysis {{.*}} for function 'test_unreachable_with_switch_prof3' 549entry: 550 switch i32 %i, label %case_a [ i32 1, label %case_b 551 i32 2, label %case_c 552 i32 3, label %case_d 553 i32 4, label %case_e ], !prof !10 554; CHECK: edge entry -> case_a probability is 0x00000000 / 0x80000000 = 0.00% 555; CHECK: edge entry -> case_b probability is 0x00000001 / 0x80000000 = 0.00% 556; CHECK: edge entry -> case_c probability is 0x6e08fb82 / 0x80000000 = 85.96% [HOT edge] 557; CHECK: edge entry -> case_d probability is 0x08fb823e / 0x80000000 = 7.02% 558; CHECK: edge entry -> case_e probability is 0x08fb823e / 0x80000000 = 7.02% 559 560case_a: 561 unreachable 562 563case_b: 564 unreachable 565 566case_c: 567 br label %exit 568; CHECK: edge case_c -> exit probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge] 569 570case_d: 571 br label %exit 572; CHECK: edge case_d -> exit probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge] 573 574case_e: 575 br label %exit 576; CHECK: edge case_e -> exit probability is 0x80000000 / 0x80000000 = 100.00% [HOT edge] 577 578exit: 579 %result = phi i32 [ %c, %case_c ], 580 [ %d, %case_d ], 581 [ %e, %case_e ] 582 ret i32 %result 583} 584 585!10 = !{!"branch_weights", i32 0, i32 4, i32 64, i32 4, i32 4} 586 587define i32 @test_unreachable_with_switch_prof4(i32 %i, i32 %a, i32 %b, i32 %c, i32 %d, i32 %e) { 588; CHECK: Printing analysis {{.*}} for function 'test_unreachable_with_switch_prof4' 589entry: 590 switch i32 %i, label %case_a [ i32 1, label %case_b 591 i32 2, label %case_c 592 i32 3, label %case_d 593 i32 4, label %case_e ], !prof !11 594; CHECK: edge entry -> case_a probability is 0x1999999a / 0x80000000 = 20.00% 595; CHECK: edge entry -> case_b probability is 0x1999999a / 0x80000000 = 20.00% 596; CHECK: edge entry -> case_c probability is 0x1999999a / 0x80000000 = 20.00% 597; CHECK: edge entry -> case_d probability is 0x1999999a / 0x80000000 = 20.00% 598; CHECK: edge entry -> case_e probability is 0x1999999a / 0x80000000 = 20.00% 599 600case_a: 601 unreachable 602 603case_b: 604 unreachable 605 606case_c: 607 unreachable 608 609case_d: 610 unreachable 611 612case_e: 613 unreachable 614 615} 616 617!11 = !{!"branch_weights", i32 0, i32 4, i32 64, i32 4, i32 4} 618