[llvm] [KnownBits][APInt] Optimize isConstant (NFC) (PR #191919)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 19 12:45:26 PDT 2026


https://github.com/nikic commented:

This looks ok, but I do wonder if it wouldn't be better to make the underlying API something like isInverseOf() which checks that LHS == ~RHS. This means that isConstant() will return true only if all bits are known *and* there are no conflicts. As-implemented, it will return true if all bits are known and there are conflicts. The original implementation had pretty weird behavior, like it wouldn't return for all known with conflicts, but could for some known with conflict...


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


More information about the llvm-commits mailing list