HomePhabricator

[test] Make bt_order_by_weight in switch.ll more robust

Authored by aeubanks on Oct 27 2020, 3:47 PM.

Description

[test] Make bt_order_by_weight in switch.ll more robust

Branch weights are not represented internally linearly with the value in
the IR. In its current state the test happened to pass, but the branch
weights for 0,3,6 and 2,5,8,9 were not actually equal.

$ opt -passes='print<branch-prob>'

shows that the sum of the branch probabilities going to bb0 and bb2 were not the same.

Printing analysis results of BPI for function 'bt_order_by_weight':
---- Branch Probabilities ----
  edge entry -> bb0 probability is 0x00000003 / 0x80000000 = 0.00%
  edge entry -> bb2 probability is 0x00000004 / 0x80000000 = 0.00%

with this change:

Printing analysis results of BPI for function 'bt_order_by_weight':
---- Branch Probabilities ----
  edge entry -> bb0 probability is 0x00000004 / 0x80000000 = 0.00%
  edge entry -> bb2 probability is 0x00000004 / 0x80000000 = 0.00%

Reviewed By: hans

Differential Revision: https://reviews.llvm.org/D90273

Details

Committed
aeubanksOct 28 2020, 12:56 PM
Reviewer
hans
Differential Revision
D90273: [test] Make bt_order_by_weight in switch.ll more robust
Parents
rG0661328d7efb: [Clang][OpenMP] Added the support for target data nowait
Branches
Unknown
Tags
Unknown