[PATCH] D65303: [BPI] Adjust the probability for floating point unordered comparison

Steve Canon via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 26 06:33:40 PDT 2019


scanon requested changes to this revision.
scanon added inline comments.
This revision now requires changes to proceed.


================
Comment at: lib/Analysis/BranchProbabilityInfo.cpp:122
+/// This is the probability for an ordered floating point comparison.
+static const uint32_t FPH_ORD_WEIGHT = 1024 * 1024 - 1;
+/// This is the probability for an unordered floating point comparison, it means
----------------
How was this weight selected? Why 2**20 - 1 in particular? If it's just to match IH_TAKEN_WEIGHT, let's use that value instead of repeating it here.

The comment could probable use a little work, too. I broadly agree with the *effect* of this change, but I don't think that unordered is that rare--rather, NaN is often an indication that something has gone wrong, and it makes sense to move that off the hot path.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D65303





More information about the llvm-commits mailing list