summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-04-15 23:38:00 +0000
committerChris Lattner <sabre@nondot.org>2006-04-15 23:38:00 +0000
commit7e7ad593cc4ad34051de68d18eabda717b9b5d8d (patch)
tree9a588d739980f01655b12a4c0237c903c055f2b7 /llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
parent8f1d80138966ae2f1515bf7e994c7aab1a153198 (diff)
downloadbcm5719-llvm-7e7ad593cc4ad34051de68d18eabda717b9b5d8d.tar.gz
bcm5719-llvm-7e7ad593cc4ad34051de68d18eabda717b9b5d8d.zip
Make these predicates return true for bit_convert(buildvector)'s as well as
buildvectors. llvm-svn: 27723
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index bcdbef17ec4..75281d5a85d 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -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();
OpenPOWER on IntegriCloud