aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen
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
commit547a16f27315a08527c41dc521c7cdf6ad9a0b6c (patch)
tree876345dcc76a8b38df975b28f202d086e908549e /lib/CodeGen
parent60d3fa24ba0edf936050adca71d9057ed8fae99c (diff)
downloadexternal_llvm-547a16f27315a08527c41dc521c7cdf6ad9a0b6c.zip
external_llvm-547a16f27315a08527c41dc521c7cdf6ad9a0b6c.tar.gz
external_llvm-547a16f27315a08527c41dc521c7cdf6ad9a0b6c.tar.bz2
Make these predicates return true for bit_convert(buildvector)'s as well as
buildvectors. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27723 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAG.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index bcdbef1..75281d5 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/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();