summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-05-11 18:30:42 +0000
committerDan Gohman <gohman@apple.com>2009-05-11 18:30:42 +0000
commit9521cadff7f4f1ccc74989673d6b6a486982613c (patch)
tree14371b1dd4cbaefbd394f220bc5616725618f135 /llvm/lib/CodeGen
parentd0e3ab2196763f44d1ee1f381bc9d7e438e75ac1 (diff)
downloadbcm5719-llvm-9521cadff7f4f1ccc74989673d6b6a486982613c.tar.gz
bcm5719-llvm-9521cadff7f4f1ccc74989673d6b6a486982613c.zip
When scalarizing a vector BITCAST, check whether the operand has vector
type, rather than assume that it does. If the operand is not vector, it shouldn't be run through ScalarizeVectorOp. This fixes one of the testcases in PR3886. llvm-svn: 71453
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
index 1a3370f0a06..0c37f526292 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
@@ -7961,7 +7961,8 @@ SDValue SelectionDAGLegalize::ScalarizeVectorOp(SDValue Op) {
break;
case ISD::BIT_CONVERT: {
SDValue Op0 = Op.getOperand(0);
- if (Op0.getValueType().getVectorNumElements() == 1)
+ if (Op0.getValueType().isVector() &&
+ Op0.getValueType().getVectorNumElements() == 1)
Op0 = ScalarizeVectorOp(Op0);
Result = DAG.getNode(ISD::BIT_CONVERT, dl, NewVT, Op0);
break;
OpenPOWER on IntegriCloud