[KnownBits] Add operator==
authorNikita Popov <npopov@redhat.com>
Mon, 16 May 2022 15:20:19 +0000 (17:20 +0200)
committerNikita Popov <npopov@redhat.com>
Tue, 17 May 2022 07:38:13 +0000 (09:38 +0200)
commita694546f7cdf6fbcacddf229eeff5316e4bd0eae
tree12032b7a5290b9aa0f2818e8c7c5e3ea61584799
parent5646d82885f64f1f886d84aff5422697f355f6c4
[KnownBits] Add operator==

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 what the eq() method implements,
which returns Optional<bool>).

Differential Revision: https://reviews.llvm.org/D125692
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