summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2008-03-10 19:58:22 +0000
committerEvan Cheng <evan.cheng@apple.com>2008-03-10 19:58:22 +0000
commitb9e4280e94a30b67ae1c4b93ee972f75ad814c7b (patch)
tree9f75f2b28f1414e07b7b16904c3dc1b23b386080 /llvm/lib/CodeGen
parentae2c56d93e61204a634544bb3d9389adfcc060cb (diff)
downloadbcm5719-llvm-b9e4280e94a30b67ae1c4b93ee972f75ad814c7b.tar.gz
bcm5719-llvm-b9e4280e94a30b67ae1c4b93ee972f75ad814c7b.zip
Somewhat better solution.
llvm-svn: 48170
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 5cda144c92d..45929713369 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -1103,9 +1103,10 @@ SDOperand DAGCombiner::visitSUB(SDNode *N) {
// fold (sub x, x) -> 0
if (N0 == N1) {
- if (ISD::isBuildVectorAllZeros(N0.Val))
- // Zero vectors might be normalized to a particular vector type to ensure
- // they are CSE'd. Return it as it is.
+ if (!AfterLegalize || !MVT::isVector(VT))
+ // For example, zero vectors might be normalized to a particular vector
+ // type to ensure they are CSE'd. Avoid issuing zero vector nodes of
+ // *unexpected* type after legalization.
return N0;
return DAG.getConstant(0, N->getValueType(0));
}
OpenPOWER on IntegriCloud