diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp index 7fe129b8456f6..e6282fc8cdbbc 100644 --- a/llvm/lib/Analysis/ValueTracking.cpp +++ b/llvm/lib/Analysis/ValueTracking.cpp @@ -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()); break; case Intrinsic::bswap: computeKnownBits(I->getOperand(0), DemandedElts, Known2, Q, Depth + 1); - Known.Zero |= Known2.Zero.byteSwap(); - Known.One |= Known2.One.byteSwap(); + Known = Known.unionWith(Known2.byteSwap()); break; case Intrinsic::ctlz: { computeKnownBits(I->getOperand(0), DemandedElts, Known2, Q, Depth + 1); diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp index 402a012e8e555..7e5844d1a8963 100644 --- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp @@ -2363,8 +2363,7 @@ bool TargetLowering::SimplifyDemandedBits( if (SimplifyDemandedBits(Src, DemandedSrcBits, DemandedElts, Known2, TLO, Depth + 1)) return true; - Known.One = Known2.One.reverseBits(); - Known.Zero = Known2.Zero.reverseBits(); + Known = Known2.reverseBits(); break; } case ISD::BSWAP: { @@ -2397,8 +2396,7 @@ bool TargetLowering::SimplifyDemandedBits( if (SimplifyDemandedBits(Src, DemandedSrcBits, DemandedElts, Known2, TLO, Depth + 1)) return true; - Known.One = Known2.One.byteSwap(); - Known.Zero = Known2.Zero.byteSwap(); + Known = Known2.byteSwap(); break; } case ISD::CTPOP: {