llvm.org GIT mirror llvm / 5e20776
Use isNullConstantOrNullSplatConstant helper. NFCI. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307895 91177308-0d34-0410-b5e6-96231b3b80d8 Simon Pilgrim 3 years ago
1 changed file(s) with 2 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
38883888 // Note: the SimplifyDemandedBits fold below can make an information-losing
38893889 // transform, and then we have no way to find this better fold.
38903890 if (N1C && N1C->isOne() && N0.getOpcode() == ISD::SUB) {
3891 ConstantSDNode *SubLHS = isConstOrConstSplat(N0.getOperand(0));
3892 SDValue SubRHS = N0.getOperand(1);
3893 if (SubLHS && SubLHS->isNullValue()) {
3891 if (isNullConstantOrNullSplatConstant(N0.getOperand(0))) {
3892 SDValue SubRHS = N0.getOperand(1);
38943893 if (SubRHS.getOpcode() == ISD::ZERO_EXTEND &&
38953894 SubRHS.getOperand(0).getScalarValueSizeInBits() == 1)
38963895 return SubRHS;