[PATCH] D90273: [test] Make bt_order_by_weight in switch.ll more robust

Hans Wennborg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 28 00:35:25 PDT 2020


hans added a comment.

Thanks for fixing, but can you  please elaborate a little since I'm not familiar with the details here:

> Branch weights are not represented internally linearly with the value in the IR.

That's surprising. How are they represented then? In the IR, the weights for cases 0,3,6 and 2,5,8,9 both add up to 12. Did that not reflect how the weights added up internally.

> Also, going over uint32_t messes with the values, and this test shouldn't be testing for that.

Is something else handling that, then? I think there was a bug here, which is exactly why the test is checking that things still work when this happens.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D90273/new/

https://reviews.llvm.org/D90273



More information about the llvm-commits mailing list