[all-commits] [llvm/llvm-project] ca8f82: [KnownFPClass] Restrict KnownFPClass::bitcast/toKn...

Eric Ross via All-commits all-commits at lists.llvm.org
Sat Sep 12 16:10:22 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ca8f82b625494996d4f9f61f30d25b62a5660dca
      https://github.com/llvm/llvm-project/commit/ca8f82b625494996d4f9f61f30d25b62a5660dca
  Author: Eric Ross <zerico2005 at gmail.com>
  Date:   2026-09-12 (Sat, 12 Sep 2026)

  Changed paths:
    M llvm/lib/Support/KnownFPClass.cpp
    M llvm/test/Transforms/InstCombine/known-bits.ll
    M llvm/unittests/Support/KnownFPClassTest.cpp

  Log Message:
  -----------
  [KnownFPClass] Restrict KnownFPClass::bitcast/toKnownBits deductions to verified FP semantics (#221133)

`KnownFPClass::bitcast` and `KnownFPClass::toKnownBits` previously made
deductions for floating-point semantics whose bit representations had
not been verified.

I have made it so `KnownFPClass::bitcast` and
`KnownFPClass::toKnownBits` return `fcAllFlags`/unknown for any
`APFloat` semantics we have not verified. Currently, this prevents
potentially invalid deductions for `PPCDoubleDouble` (mostly in regards
to the signbit and endianess). It also allows these functions to be
"safely" used with the 4/6/8 bit floating point types since we
conservatively return unknown.

Currently the list of supported/verified semantics for both `bitcast`
and `toKnownBits` are:
```
IEEEhalf
BFloat
IEEEsingle
IEEEdouble
IEEEquad
x87DoubleExtended
```



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list