summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-07-09 00:46:33 +0000
committerDan Gohman <gohman@apple.com>2009-07-09 00:46:33 +0000
commit6b04136756f23ef2f8f7bc3190e64d84b1b5df91 (patch)
treef577afca6eb5c894c78fa6f9ab7c08f84ef66c16 /llvm/lib/CodeGen
parent031c5fec43b9ee470d8715ca9383028e63d1069c (diff)
downloadbcm5719-llvm-6b04136756f23ef2f8f7bc3190e64d84b1b5df91.tar.gz
bcm5719-llvm-6b04136756f23ef2f8f7bc3190e64d84b1b5df91.zip
Make SelectionDAG::getVectorShuffle work properly for VECTOR_SHUFFLE
nodes with operand types that differ from the result type. (This doesn't normally happen right now, because SelectionDAGLowering::visitShuffleVector normalizes vector shuffles.) llvm-svn: 75081
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index c46eee8a4ed..177f806dbce 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -1187,7 +1187,7 @@ SDValue SelectionDAG::getVectorShuffle(MVT VT, DebugLoc dl, SDValue N1,
// Canonicalize shuffle undef, undef -> undef
if (N1.getOpcode() == ISD::UNDEF && N2.getOpcode() == ISD::UNDEF)
- return N1;
+ return getUNDEF(VT);
// Validate that all indices in Mask are within the range of the elements
// input to the shuffle.
@@ -1239,7 +1239,7 @@ SDValue SelectionDAG::getVectorShuffle(MVT VT, DebugLoc dl, SDValue N1,
if (MaskVec[i] >= 0 && MaskVec[i] != (int)i) Identity = false;
if (MaskVec[i] >= 0) AllUndef = false;
}
- if (Identity)
+ if (Identity && NElts == N1.getValueType().getVectorNumElements())
return N1;
if (AllUndef)
return getUNDEF(VT);
OpenPOWER on IntegriCloud