[llvm-commits] [llvm] r65794 - in /llvm/branches/Apple/Dib: lib/CodeGen/SelectionDAG/DAGCombiner.cpp test/CodeGen/X86/extract-combine.ll

Bill Wendling isanbard at gmail.com
Sun Mar 1 18:22:14 PST 2009


Author: void
Date: Sun Mar  1 20:22:12 2009
New Revision: 65794

URL: http://llvm.org/viewvc/llvm-project?rev=65794&view=rev
Log:
Merge r65791 into Dib:

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

Added:
    llvm/branches/Apple/Dib/test/CodeGen/X86/extract-combine.ll
      - copied unchanged from r65791, llvm/trunk/test/CodeGen/X86/extract-combine.ll
Modified:
    llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Modified: llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=65794&r1=65793&r2=65794&view=diff

==============================================================================
--- llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original)
+++ llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Sun Mar  1 20:22:12 2009
@@ -5257,7 +5257,8 @@
     }
     
     // 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();
 





More information about the llvm-commits mailing list