diff options
| author | Nate Begeman <natebegeman@mac.com> | 2009-03-01 23:44:07 +0000 |
|---|---|---|
| committer | Nate Begeman <natebegeman@mac.com> | 2009-03-01 23:44:07 +0000 |
| commit | a9e981225e050a02c79c68537779b36289d2115b (patch) | |
| tree | f5919ea480ebbd5d585a574ac1a450310d722b19 /llvm/lib | |
| parent | 705f0b764e338f1a5fe921e9f65908dbf728150e (diff) | |
| download | bcm5719-llvm-a9e981225e050a02c79c68537779b36289d2115b.tar.gz bcm5719-llvm-a9e981225e050a02c79c68537779b36289d2115b.zip | |
Fix a problem with DAGCombine on 64b targets where folding
extracts + build_vector into a shuffle would fail, because the
type of the new build_vector would not be legal. Try harder to
create a legal build_vector type. Note: this will be totally
irrelevant once vector_shuffle no longer takes a build_vector for
shuffle mask.
New:
_foo:
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
subps %xmm1, %xmm1
mulps %xmm0, %xmm1
addps %xmm0, %xmm1
movaps %xmm1, 0
Old:
_foo:
xorps %xmm0, %xmm0
movss %xmm0, %xmm1
xorps %xmm2, %xmm2
unpcklps %xmm1, %xmm2
pshufd $80, %xmm1, %xmm1
unpcklps %xmm1, %xmm2
pslldq $16, %xmm2
pshufd $57, %xmm2, %xmm1
subps %xmm0, %xmm1
mulps %xmm0, %xmm1
addps %xmm0, %xmm1
movaps %xmm1, 0
llvm-svn: 65791
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 4b3935c2173..788ffb6ad01 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -5257,7 +5257,8 @@ SDValue DAGCombiner::visitBUILD_VECTOR(SDNode *N) { } // Add count and size info. - MVT BuildVecVT = MVT::getVectorVT(TLI.getPointerTy(), NumElts); + MVT IndexVT = MVT::getIntegerVT(EltType.getSizeInBits()); + MVT BuildVecVT = MVT::getVectorVT(IndexVT, NumElts); if (!TLI.isTypeLegal(BuildVecVT) && LegalTypes) return SDValue(); |

