From f6e3b957b8346cf98679162a1c063ed10422fa70 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 25 Mar 2006 22:59:28 +0000 Subject: Fix a bug in ISD::isBuildVectorAllOnesInteger that caused it to always return false llvm-svn: 27131 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp') 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(N) || !cast(N)->isAllOnesValue()) + SDOperand NotZero = N->getOperand(i); + if (!isa(NotZero) || + !cast(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) -- cgit v1.2.3