summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2012-07-25 17:02:47 +0000
committerJim Grosbach <grosbach@apple.com>2012-07-25 17:02:47 +0000
commit242204784bae63da503c2f509a38c532085f0eb1 (patch)
treeb60f26130a733857df37d5dd46b25aaf7da3fbab /lib
parenteba2bbb58cafcb1ec0fa50d5e8a1c6a8cac2f780 (diff)
downloadllvm-242204784bae63da503c2f509a38c532085f0eb1.tar.gz
llvm-242204784bae63da503c2f509a38c532085f0eb1.tar.bz2
llvm-242204784bae63da503c2f509a38c532085f0eb1.tar.xz
ARM: Don't assume an SDNode is a constant.
Before accessing a node as a ConstandSDNode, make sure it actually is one. No testcase of non-trivial size. rdar://11948669 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160735 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Target/ARM/ARMISelLowering.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Target/ARM/ARMISelLowering.cpp b/lib/Target/ARM/ARMISelLowering.cpp
index 04370c095c..9d8b7dff10 100644
--- a/lib/Target/ARM/ARMISelLowering.cpp
+++ b/lib/Target/ARM/ARMISelLowering.cpp
@@ -4271,6 +4271,10 @@ SDValue ARMTargetLowering::ReconstructShuffle(SDValue Op,
// Record this extraction against the appropriate vector if possible...
SDValue SourceVec = V.getOperand(0);
+ // If the element number isn't a constant, we can't effectively
+ // analyze what's going on.
+ if (!isa<ConstantSDNode>(V.getOperand(1)))
+ return SDValue();
unsigned EltNo = cast<ConstantSDNode>(V.getOperand(1))->getZExtValue();
bool FoundSource = false;
for (unsigned j = 0; j < SourceVecs.size(); ++j) {