[llvm-commits] [llvm] r57839 - /llvm/trunk/include/llvm/Target/TargetLowering.h

Duncan Sands baldrick at free.fr
Mon Oct 20 09:24:25 PDT 2008


Author: baldrick
Date: Mon Oct 20 11:24:25 2008
New Revision: 57839

URL: http://llvm.org/viewvc/llvm-project?rev=57839&view=rev
Log:
Teach getTypeToTransformTo to return something
sensible for vectors being scalarized.  Note
that this method can't return anything very
sensible when splitting non-power-of-two vectors.

Modified:
    llvm/trunk/include/llvm/Target/TargetLowering.h

Modified: llvm/trunk/include/llvm/Target/TargetLowering.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetLowering.h?rev=57839&r1=57838&r2=57839&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Target/TargetLowering.h (original)
+++ llvm/trunk/include/llvm/Target/TargetLowering.h Mon Oct 20 11:24:25 2008
@@ -209,10 +209,11 @@
       return NVT;
     }
 
-    if (VT.isVector())
-      return MVT::getVectorVT(VT.getVectorElementType(),
-                              VT.getVectorNumElements() / 2);
-    if (VT.isInteger()) {
+    if (VT.isVector()) {
+      unsigned NumElts = VT.getVectorNumElements();
+      MVT EltVT = VT.getVectorElementType();
+      return (NumElts == 1) ? EltVT : MVT::getVectorVT(EltVT, NumElts / 2);
+    } else if (VT.isInteger()) {
       MVT NVT = VT.getRoundIntegerType();
       if (NVT == VT)
         // Size is a power of two - expand to half the size.





More information about the llvm-commits mailing list