llvm.org GIT mirror llvm / 1c193f4
[X86] Don't compute known bits twice for the same SDValue in LowerMUL. We called MaskedValueIsZero with two different masks, but underneath that calls computeKnownBits before applying the mask. This means we compute the same known bits twice due to the two calls. Instead just call computeKnownBits directly and apply the two masks ourselves. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327251 91177308-0d34-0410-b5e6-96231b3b80d8 Craig Topper 2 years ago
1 changed file(s) with 8 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
2253122531 //
2253222532 // Hi = psllqi(AloBhi + AhiBlo, 32);
2253322533 // return AloBlo + Hi;
22534 KnownBits AKnown, BKnown;
22535 DAG.computeKnownBits(A, AKnown);
22536 DAG.computeKnownBits(B, BKnown);
22537
2253422538 APInt LowerBitsMask = APInt::getLowBitsSet(64, 32);
22535 bool ALoIsZero = DAG.MaskedValueIsZero(A, LowerBitsMask);
22536 bool BLoIsZero = DAG.MaskedValueIsZero(B, LowerBitsMask);
22539 bool ALoIsZero = LowerBitsMask.isSubsetOf(AKnown.Zero);
22540 bool BLoIsZero = LowerBitsMask.isSubsetOf(BKnown.Zero);
2253722541
2253822542 APInt UpperBitsMask = APInt::getHighBitsSet(64, 32);
22539 bool AHiIsZero = DAG.MaskedValueIsZero(A, UpperBitsMask);
22540 bool BHiIsZero = DAG.MaskedValueIsZero(B, UpperBitsMask);
22543 bool AHiIsZero = UpperBitsMask.isSubsetOf(AKnown.Zero);
22544 bool BHiIsZero = UpperBitsMask.isSubsetOf(BKnown.Zero);
2254122545
2254222546 // If DQI is supported we can use MULLQ, but MULUDQ is still better if the
2254322547 // the high bits are known to be zero.