[llvm] Bfi precision (PR #66285)

Duncan P. N. Exon Smith via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 13 13:46:30 PDT 2023


dexonsmith wrote:

Comment in the code from the Phab review, which I think was committed mostly as is (https://reviews.llvm.org/D3125, but it wasn't used; the active review was on the commits list):
```
  // Scale the Factor to a size that creates integers.  Ideally, integers would
  // be scaled so that Max == UINT64_MAX so that they can be best
  // differentiated.  However, the register allocator currently deals poorly
  // with large numbers.  Instead, push Min up a little from 1 to give some
  // room to differentiate small, unequal numbers.
  //
  // TODO: fix issues downstream so that ScalingFactor can be Float(1,64)/Max.
```
My memory is that I had equivalent code to this change originally, then backed off to this compromise after hitting performance regressions, but the intention was (originally) to figure out what was wrong we could go back to this.

I don't have access to my email from the time, but I dug up the start of the llvm-commits thread at <https://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20140303/207695.html>. Unfortunately it's split by week. I'll reply again if I can find the specific motivation in the thread.

There's been a lot of work on BFI since then so it's possible this will work now.

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


More information about the llvm-commits mailing list