forked from OSchip/llvm-project
parent
30ee72586d
commit
a67899195f
|
@ -458,7 +458,10 @@ namespace ISD {
|
||||||
/// isBuildVectorAllOnesInteger - Return true if the specified node is a
|
/// isBuildVectorAllOnesInteger - Return true if the specified node is a
|
||||||
/// BUILD_VECTOR where all of the elements are ~0 or undef.
|
/// BUILD_VECTOR where all of the elements are ~0 or undef.
|
||||||
bool isBuildVectorAllOnesInteger(const SDNode *N);
|
bool isBuildVectorAllOnesInteger(const SDNode *N);
|
||||||
|
|
||||||
|
/// isBuildVectorAllZeros - Return true if the specified node is a
|
||||||
|
/// BUILD_VECTOR where all of the elements are 0 or undef.
|
||||||
|
bool isBuildVectorAllZeros(const SDNode *N);
|
||||||
|
|
||||||
//===--------------------------------------------------------------------===//
|
//===--------------------------------------------------------------------===//
|
||||||
/// ISD::CondCode enum - These are ordered carefully to make the bitfields
|
/// ISD::CondCode enum - These are ordered carefully to make the bitfields
|
||||||
|
|
|
@ -101,6 +101,30 @@ bool ISD::isBuildVectorAllOnesInteger(const SDNode *N) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// isBuildVectorAllZeros - Return true if the specified node is a
|
||||||
|
/// BUILD_VECTOR where all of the elements are 0 or undef.
|
||||||
|
bool ISD::isBuildVectorAllZeros(const SDNode *N) {
|
||||||
|
if (N->getOpcode() != ISD::BUILD_VECTOR) return false;
|
||||||
|
|
||||||
|
bool AllUndef = true;
|
||||||
|
for (unsigned i = 0, e = N->getNumOperands(); i != e; ++i) {
|
||||||
|
SDOperand Elt = N->getOperand(i);
|
||||||
|
if (Elt.getOpcode() != ISD::UNDEF) {
|
||||||
|
AllUndef = false;
|
||||||
|
if (isa<ConstantSDNode>(Elt)) {
|
||||||
|
if (!cast<ConstantSDNode>(Elt)->isNullValue())
|
||||||
|
return false;
|
||||||
|
} else if (isa<ConstantFPSDNode>(Elt)) {
|
||||||
|
if (!cast<ConstantFPSDNode>(Elt)->isExactlyValue(0.0))
|
||||||
|
return false;
|
||||||
|
} else
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return !AllUndef;
|
||||||
|
}
|
||||||
|
|
||||||
/// getSetCCSwappedOperands - Return the operation corresponding to (Y op X)
|
/// getSetCCSwappedOperands - Return the operation corresponding to (Y op X)
|
||||||
/// when given the operation for (X op Y).
|
/// when given the operation for (X op Y).
|
||||||
ISD::CondCode ISD::getSetCCSwappedOperands(ISD::CondCode Operation) {
|
ISD::CondCode ISD::getSetCCSwappedOperands(ISD::CondCode Operation) {
|
||||||
|
|
Loading…
Reference in New Issue