aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
diff options
context:
space:
mode:
authorArthur Eubanks <aeubanks@google.com>2020-10-27 15:47:59 -0700
committerArthur Eubanks <aeubanks@google.com>2020-10-28 12:56:23 -0700
commit3b2256a41b062ff5e9dcf52a99b945cadf2388d1 (patch)
tree739c014478303f7beb289223232bb21004b33ca4 /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
parent0661328d7efb81a8ac7f2ca0734a65f9be105f29 (diff)
downloadllvm-3b2256a41b062ff5e9dcf52a99b945cadf2388d1.zip
llvm-3b2256a41b062ff5e9dcf52a99b945cadf2388d1.tar.gz
llvm-3b2256a41b062ff5e9dcf52a99b945cadf2388d1.tar.bz2
[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
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
0 files changed, 0 insertions, 0 deletions