summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-03-25 22:59:28 +0000
committerChris Lattner <sabre@nondot.org>2006-03-25 22:59:28 +0000
commitf6e3b957b8346cf98679162a1c063ed10422fa70 (patch)
tree0194308f206733f232c8609034c90d7b73b38503 /llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
parentc2d2811a07d7bcba4f3ca05ed872d424ffaf21c3 (diff)
downloadbcm5719-llvm-f6e3b957b8346cf98679162a1c063ed10422fa70.tar.gz
bcm5719-llvm-f6e3b957b8346cf98679162a1c063ed10422fa70.zip
Fix a bug in ISD::isBuildVectorAllOnesInteger that caused it to always return
false llvm-svn: 27131
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 9fcfc61af79..18e2ebcb45e 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -86,12 +86,13 @@ bool ISD::isBuildVectorAllOnesInteger(const SDNode *N) {
// Do not accept build_vectors that aren't all constants or which have non-~0
// elements.
- if (!isa<ConstantSDNode>(N) || !cast<ConstantSDNode>(N)->isAllOnesValue())
+ SDOperand NotZero = N->getOperand(i);
+ if (!isa<ConstantSDNode>(NotZero) ||
+ !cast<ConstantSDNode>(NotZero)->isAllOnesValue())
return false;
// Okay, we have at least one ~0 value, check to see if the rest match or are
// undefs.
- SDOperand NotZero = N->getOperand(i);
for (++i; i != e; ++i)
if (N->getOperand(i) != NotZero &&
N->getOperand(i).getOpcode() != ISD::UNDEF)
OpenPOWER on IntegriCloud