@@ -119,7 +119,7 @@ Value *InstCombinerImpl::SimplifyDemandedUseBits(Value *V, APInt DemandedMask,
119119 " Value *V, DemandedMask and Known must have same BitWidth" );
120120
121121 if (isa<Constant>(V)) {
122- computeKnownBits (V, Known , Depth, CxtI);
122+ Known = computeKnownBits (V, Depth, CxtI);
123123 return nullptr ;
124124 }
125125
@@ -132,7 +132,7 @@ Value *InstCombinerImpl::SimplifyDemandedUseBits(Value *V, APInt DemandedMask,
132132
133133 Instruction *I = dyn_cast<Instruction>(V);
134134 if (!I) {
135- computeKnownBits (V, Known , Depth, CxtI);
135+ Known = computeKnownBits (V, Depth, CxtI);
136136 return nullptr ; // Only analyze instructions.
137137 }
138138
@@ -184,7 +184,7 @@ Value *InstCombinerImpl::SimplifyDemandedUseBits(Value *V, APInt DemandedMask,
184184
185185 switch (I->getOpcode ()) {
186186 default :
187- computeKnownBits (I, Known , Depth, CxtI);
187+ Known = computeKnownBits (I, Depth, CxtI);
188188 break ;
189189 case Instruction::And: {
190190 // If either the LHS or the RHS are Zero, the result is zero.
@@ -598,7 +598,7 @@ Value *InstCombinerImpl::SimplifyDemandedUseBits(Value *V, APInt DemandedMask,
598598 return InsertNewInstWith (And1, I->getIterator ());
599599 }
600600
601- computeKnownBits (I, Known , Depth, CxtI);
601+ Known = computeKnownBits (I, Depth, CxtI);
602602 break ;
603603 }
604604 case Instruction::Shl: {
@@ -660,7 +660,7 @@ Value *InstCombinerImpl::SimplifyDemandedUseBits(Value *V, APInt DemandedMask,
660660 return I;
661661 }
662662 }
663- computeKnownBits (I, Known , Depth, CxtI);
663+ Known = computeKnownBits (I, Depth, CxtI);
664664 }
665665 break ;
666666 }
@@ -712,7 +712,7 @@ Value *InstCombinerImpl::SimplifyDemandedUseBits(Value *V, APInt DemandedMask,
712712 if (ShiftAmt)
713713 Known.Zero .setHighBits (ShiftAmt); // high bits known zero.
714714 } else {
715- computeKnownBits (I, Known , Depth, CxtI);
715+ Known = computeKnownBits (I, Depth, CxtI);
716716 }
717717 break ;
718718 }
@@ -775,7 +775,7 @@ Value *InstCombinerImpl::SimplifyDemandedUseBits(Value *V, APInt DemandedMask,
775775 Known.One |= HighBits;
776776 }
777777 } else {
778- computeKnownBits (I, Known , Depth, CxtI);
778+ Known = computeKnownBits (I, Depth, CxtI);
779779 }
780780 break ;
781781 }
@@ -797,7 +797,7 @@ Value *InstCombinerImpl::SimplifyDemandedUseBits(Value *V, APInt DemandedMask,
797797 Known = KnownBits::udiv (LHSKnown, KnownBits::makeConstant (*SA),
798798 cast<BinaryOperator>(I)->isExact ());
799799 } else {
800- computeKnownBits (I, Known , Depth, CxtI);
800+ Known = computeKnownBits (I, Depth, CxtI);
801801 }
802802 break ;
803803 }
@@ -837,7 +837,7 @@ Value *InstCombinerImpl::SimplifyDemandedUseBits(Value *V, APInt DemandedMask,
837837 }
838838 }
839839
840- computeKnownBits (I, Known , Depth, CxtI);
840+ Known = computeKnownBits (I, Depth, CxtI);
841841 break ;
842842 }
843843 case Instruction::URem: {
@@ -977,7 +977,7 @@ Value *InstCombinerImpl::SimplifyDemandedUseBits(Value *V, APInt DemandedMask,
977977 }
978978
979979 if (!KnownBitsComputed)
980- computeKnownBits (V, Known , Depth, CxtI);
980+ Known = computeKnownBits (V, Depth, CxtI);
981981 break ;
982982 }
983983 }
@@ -1007,8 +1007,8 @@ Value *InstCombinerImpl::SimplifyMultipleUseDemandedBits(
10071007 // this instruction has a simpler value in that context.
10081008 switch (I->getOpcode ()) {
10091009 case Instruction::And: {
1010- computeKnownBits (I->getOperand (1 ), RHSKnown , Depth + 1 , CxtI);
1011- computeKnownBits (I->getOperand (0 ), LHSKnown , Depth + 1 , CxtI);
1010+ RHSKnown = computeKnownBits (I->getOperand (1 ), Depth + 1 , CxtI);
1011+ LHSKnown = computeKnownBits (I->getOperand (0 ), Depth + 1 , CxtI);
10121012 Known = LHSKnown & RHSKnown;
10131013 computeKnownBitsFromAssume (I, Known, Depth, SQ.getWithInstruction (CxtI));
10141014
@@ -1027,8 +1027,8 @@ Value *InstCombinerImpl::SimplifyMultipleUseDemandedBits(
10271027 break ;
10281028 }
10291029 case Instruction::Or: {
1030- computeKnownBits (I->getOperand (1 ), RHSKnown , Depth + 1 , CxtI);
1031- computeKnownBits (I->getOperand (0 ), LHSKnown , Depth + 1 , CxtI);
1030+ RHSKnown = computeKnownBits (I->getOperand (1 ), Depth + 1 , CxtI);
1031+ LHSKnown = computeKnownBits (I->getOperand (0 ), Depth + 1 , CxtI);
10321032 Known = LHSKnown | RHSKnown;
10331033 computeKnownBitsFromAssume (I, Known, Depth, SQ.getWithInstruction (CxtI));
10341034
@@ -1049,8 +1049,8 @@ Value *InstCombinerImpl::SimplifyMultipleUseDemandedBits(
10491049 break ;
10501050 }
10511051 case Instruction::Xor: {
1052- computeKnownBits (I->getOperand (1 ), RHSKnown , Depth + 1 , CxtI);
1053- computeKnownBits (I->getOperand (0 ), LHSKnown , Depth + 1 , CxtI);
1052+ RHSKnown = computeKnownBits (I->getOperand (1 ), Depth + 1 , CxtI);
1053+ LHSKnown = computeKnownBits (I->getOperand (0 ), Depth + 1 , CxtI);
10541054 Known = LHSKnown ^ RHSKnown;
10551055 computeKnownBitsFromAssume (I, Known, Depth, SQ.getWithInstruction (CxtI));
10561056
@@ -1075,11 +1075,11 @@ Value *InstCombinerImpl::SimplifyMultipleUseDemandedBits(
10751075
10761076 // If an operand adds zeros to every bit below the highest demanded bit,
10771077 // that operand doesn't change the result. Return the other side.
1078- computeKnownBits (I->getOperand (1 ), RHSKnown , Depth + 1 , CxtI);
1078+ RHSKnown = computeKnownBits (I->getOperand (1 ), Depth + 1 , CxtI);
10791079 if (DemandedFromOps.isSubsetOf (RHSKnown.Zero ))
10801080 return I->getOperand (0 );
10811081
1082- computeKnownBits (I->getOperand (0 ), LHSKnown , Depth + 1 , CxtI);
1082+ LHSKnown = computeKnownBits (I->getOperand (0 ), Depth + 1 , CxtI);
10831083 if (DemandedFromOps.isSubsetOf (LHSKnown.Zero ))
10841084 return I->getOperand (1 );
10851085
@@ -1094,19 +1094,19 @@ Value *InstCombinerImpl::SimplifyMultipleUseDemandedBits(
10941094
10951095 // If an operand subtracts zeros from every bit below the highest demanded
10961096 // bit, that operand doesn't change the result. Return the other side.
1097- computeKnownBits (I->getOperand (1 ), RHSKnown , Depth + 1 , CxtI);
1097+ RHSKnown = computeKnownBits (I->getOperand (1 ), Depth + 1 , CxtI);
10981098 if (DemandedFromOps.isSubsetOf (RHSKnown.Zero ))
10991099 return I->getOperand (0 );
11001100
11011101 bool NSW = cast<OverflowingBinaryOperator>(I)->hasNoSignedWrap ();
1102- computeKnownBits (I->getOperand (0 ), LHSKnown , Depth + 1 , CxtI);
1102+ LHSKnown = computeKnownBits (I->getOperand (0 ), Depth + 1 , CxtI);
11031103 Known = KnownBits::computeForAddSub (/* Add*/ false , NSW, LHSKnown, RHSKnown);
11041104 computeKnownBitsFromAssume (I, Known, Depth, SQ.getWithInstruction (CxtI));
11051105 break ;
11061106 }
11071107 case Instruction::AShr: {
11081108 // Compute the Known bits to simplify things downstream.
1109- computeKnownBits (I, Known , Depth, CxtI);
1109+ Known = computeKnownBits (I, Depth, CxtI);
11101110
11111111 // If this user is only demanding bits that we know, return the known
11121112 // constant.
@@ -1133,7 +1133,7 @@ Value *InstCombinerImpl::SimplifyMultipleUseDemandedBits(
11331133 }
11341134 default :
11351135 // Compute the Known bits to simplify things downstream.
1136- computeKnownBits (I, Known , Depth, CxtI);
1136+ Known = computeKnownBits (I, Depth, CxtI);
11371137
11381138 // If this user is only demanding bits that we know, return the known
11391139 // constant.
0 commit comments