[llvm] [ValueTracking][SelectionDAG] Use KnownBits::reverseBits/byteSwap. NFC (PR #155847)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 28 08:07:05 PDT 2025


================
@@ -1834,13 +1834,11 @@ static void computeKnownBitsFromOperator(const Operator *I,
       }
       case Intrinsic::bitreverse:
         computeKnownBits(I->getOperand(0), DemandedElts, Known2, Q, Depth + 1);
-        Known.Zero |= Known2.Zero.reverseBits();
-        Known.One |= Known2.One.reverseBits();
+        Known = Known.unionWith(Known2.reverseBits());
----------------
jayfoad wrote:

I guess they should all use unionWith, to take advantage of any ConstantRange info that might have been calculated before this switch.

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


More information about the llvm-commits mailing list