aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAG.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 9fcfc61af7..18e2ebcb45 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/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)