1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 19:52:54 +01:00

Make these predicates return true for bit_convert(buildvector)'s as well as

buildvectors.

llvm-svn: 27723
This commit is contained in:
Chris Lattner 2006-04-15 23:38:00 +00:00
parent 9f33b2abc5
commit 918dbf7203

View File

@ -73,6 +73,10 @@ bool ConstantFPSDNode::isExactlyValue(double V) const {
/// isBuildVectorAllOnes - Return true if the specified node is a
/// BUILD_VECTOR where all of the elements are ~0 or undef.
bool ISD::isBuildVectorAllOnes(const SDNode *N) {
// Look through a bit convert.
if (N->getOpcode() == ISD::BIT_CONVERT)
N = N->getOperand(0).Val;
if (N->getOpcode() != ISD::BUILD_VECTOR) return false;
unsigned i = 0, e = N->getNumOperands();
@ -117,6 +121,10 @@ bool ISD::isBuildVectorAllOnes(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) {
// Look through a bit convert.
if (N->getOpcode() == ISD::BIT_CONVERT)
N = N->getOperand(0).Val;
if (N->getOpcode() != ISD::BUILD_VECTOR) return false;
unsigned i = 0, e = N->getNumOperands();