[llvm] Avoid BlockFrequency overflow problems (PR #66280)

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 13 12:51:27 PDT 2023


MatzeB wrote:

An alternative fix for this would be to perform the arithemtic on `APInt(128, )` here. You can see this style used in other places of the codebase. In the end I decided that this solution seems more elegant as we can keep everything abstracted in a `BlockFrequency` instance instead of computing with raw integers which somewhat was the reason for the trouble here in the first place. The overflow check is also more efficient than an `APInt(128 ,` which requires heap-allocation.

https://github.com/llvm/llvm-project/pull/66280


More information about the llvm-commits mailing list