[llvm] [KnownBits] Add operator<<=(unsigned) and operator>>=(unsigned). NFC (PR #155751)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 28 07:20:39 PDT 2025


================
@@ -487,6 +487,20 @@ struct KnownBits {
   /// Update known bits based on XORing with RHS.
   LLVM_ABI KnownBits &operator^=(const KnownBits &RHS);
 
+  /// Shift known bits left by ShAmt. Shift in bits are unknown.
+  KnownBits &operator<<=(unsigned ShAmt) {
----------------
topperc wrote:

&, |, ^ are the only operators with this property. Ideally they'd be named `KnownBits::and`, `KnownBits::or`, and `KnownBits::xor` like add, sub, mul, shl, etc. But C/C++ treats `and`, `or`, `xor` as keywords.

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


More information about the llvm-commits mailing list