[PATCH] D125692: [KnownBits] Add operator==

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 16 08:24:35 PDT 2022


nikic created this revision.
nikic added reviewers: RKSimon, craig.topper, spatel.
Herald added subscribers: foad, StephenFan, hiraditya.
Herald added a project: All.
nikic requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Checking whether two KnownBits are the same is somewhat common, mainly in test code.

I don't think there is a lot of room for confusion with "determine what the KnownBits for an icmp eq would be", as that has a different result type (this is the `eq()` method implements, which returns `Optional<bool>`).


https://reviews.llvm.org/D125692

Files:
  llvm/include/llvm/Support/KnownBits.h
  llvm/lib/Support/KnownBits.cpp
  llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
  llvm/unittests/IR/ConstantRangeTest.cpp
  llvm/unittests/Support/KnownBitsTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D125692.429722.patch
Type: text/x-patch
Size: 5403 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220516/491798f0/attachment.bin>


More information about the llvm-commits mailing list