}
}
// TODO: Should we try to mask with N1 as well?
- if (!IsInLaneMask &&
- (!DemandedLHS.isNullValue() || !DemandedRHS.isNullValue()) &&
- (DemandedLHS.isNullValue() ||
- DAG.MaskedVectorIsZero(N0, DemandedLHS)) &&
- (DemandedRHS.isNullValue() ||
- DAG.MaskedVectorIsZero(N1, DemandedRHS))) {
+ if (!IsInLaneMask && (!DemandedLHS.isZero() || !DemandedRHS.isZero()) &&
+ (DemandedLHS.isZero() || DAG.MaskedVectorIsZero(N0, DemandedLHS)) &&
+ (DemandedRHS.isZero() || DAG.MaskedVectorIsZero(N1, DemandedRHS))) {
SDLoc DL(N);
EVT IntVT = VT.changeVectorElementTypeToInteger();
EVT IntSVT = VT.getVectorElementType().changeTypeToInteger();
uint64_t Key = I.getOperand(3).getImm();
Register DiscReg = I.getOperand(4).getReg();
auto DiscVal = getIConstantVRegVal(DiscReg, MRI);
- bool IsDiscZero = DiscVal && DiscVal->isNullValue();
+ bool IsDiscZero = DiscVal && DiscVal->isZero();
if (Key > AArch64PACKey::LAST)
return false;
}
return false;
}
- return (ZeroV1.isNullValue() || DAG.MaskedVectorIsZero(V1, ZeroV1)) &&
- (ZeroV2.isNullValue() || DAG.MaskedVectorIsZero(V2, ZeroV2));
+ return (ZeroV1.isZero() || DAG.MaskedVectorIsZero(V1, ZeroV1)) &&
+ (ZeroV2.isZero() || DAG.MaskedVectorIsZero(V2, ZeroV2));
}
// Check if the shuffle mask is suitable for the AVX vpunpcklwd or vpunpckhwd
for (unsigned I = 0; I != NumLanesTotal; ++I) {
APInt LaneEltMask = WidenedDemandedElts.extractBits(
NumEltsPerLane, NumEltsPerLane * I);
- if (LaneEltMask.isNullValue())
+ if (LaneEltMask.isZero())
continue;
// FIXME: we don't need to extract if all non-demanded elements
// are legalization-inserted padding.
for (unsigned I = 0; I != NumLanesTotal; ++I) {
APInt LaneEltMask = WidenedDemandedElts.extractBits(
NumEltsPerLane, I * NumEltsPerLane);
- if (LaneEltMask.isNullValue())
+ if (LaneEltMask.isZero())
continue;
Cost += getShuffleCost(TTI::SK_ExtractSubvector, Ty, std::nullopt,
CostKind, I * NumEltsPerLane, LaneTy);
bool div0 = false;
auto result = constFoldBinaryOp<IntegerAttr>(adaptor.getOperands(),
[&](APInt a, const APInt &b) {
- if (div0 || b.isNullValue()) {
+ if (div0 || b.isZero()) {
div0 = true;
return a;
}
bool div0 = false;
auto result = constFoldBinaryOp<IntegerAttr>(adaptor.getOperands(),
[&](APInt a, const APInt &b) {
- if (div0 || b.isNullValue()) {
+ if (div0 || b.isZero()) {
div0 = true;
return a;
}
if (!alignmentInt)
return parser.emitError(parser.getNameLoc(),
"expected integer alignment");
- if (alignmentInt.getValue().isNullValue())
+ if (alignmentInt.getValue().isZero())
result.attributes.erase("alignment");
}
static bool isZeroAttribute(Attribute value) {
if (auto intValue = value.dyn_cast<IntegerAttr>())
- return intValue.getValue().isNullValue();
+ return intValue.getValue().isZero();
if (auto fpValue = value.dyn_cast<FloatAttr>())
return fpValue.getValue().isZero();
if (auto splatValue = value.dyn_cast<SplatElementsAttr>())
return emitOpError("must have exactly two branch weights");
}
if (llvm::all_of(*weights, [](Attribute attr) {
- return attr.cast<IntegerAttr>().getValue().isNullValue();
+ return attr.cast<IntegerAttr>().getValue().isZero();
}))
return emitOpError("branch weights cannot both be zero");
}
// negative. Rather, APInt rounds toward zero.
APInt quotient, remainder;
APInt::sdivrem(lhs.getValue(), rhs.getValue(), quotient, remainder);
- if (quotient.isNegative() && !remainder.isNullValue()) {
+ if (quotient.isNegative() && !remainder.isZero()) {
quotient -= 1;
}