Skip to content

Commit d02a580

Browse files
authored
Merge pull request #27 from nikolaperic/ins-opt-revert
Revert "NanoMips: Support for 16bit masks in OR to INS combine"
2 parents d7a2124 + acb6b0d commit d02a580

File tree

1 file changed

+2
-20
lines changed

1 file changed

+2
-20
lines changed

llvm/lib/Target/Mips/MipsISelLowering.cpp

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,26 +1046,8 @@ static SDValue attemptOrToIns(SDValue &And, SDValue &Right, SDNode *N,
10461046
if (!(CN = dyn_cast<ConstantSDNode>(And.getOperand(1))))
10471047
return SDValue();
10481048
unsigned Mask0 = ~CN->getZExtValue();
1049-
1050-
KnownBits KnownMaskBits = DAG.computeKnownBits(SDValue(CN, 0));
1051-
APInt maxValue = KnownMaskBits.getMaxValue();
1052-
unsigned int MaxNumOfActiveBitsInMask = maxValue.getActiveBits();
1053-
1054-
// If the mask value fits into 16 bits, trim the leading ones.
1055-
// Leading ones were made after negating zero expanded 16 bit value.
1056-
// This enables the function isShiftedMask() to recognize 16 bit masks as
1057-
// valid.
1058-
// TODO: Support the case when there are two two consecutive OR instructions
1059-
// and two masks whose value fits in 16 bits.
1060-
if (MaxNumOfActiveBitsInMask <= 16) {
1061-
uint16_t Mask0_16 = Mask0;
1062-
if (!isShiftedMask(Mask0_16, SMPos0, SMSize0))
1063-
return SDValue();
1064-
} else if (MaxNumOfActiveBitsInMask <= 32) {
1065-
uint32_t Mask0_32 = Mask0;
1066-
if (!isShiftedMask(Mask0_32, SMPos0, SMSize0))
1067-
return SDValue();
1068-
}
1049+
if (!isShiftedMask(Mask0, SMPos0, SMSize0))
1050+
return SDValue();
10691051

10701052
SDLoc DL(N);
10711053
EVT ValTy = N->getValueType(0);

0 commit comments

Comments
 (0)