diff options
author | Duncan Sands <baldrick@free.fr> | 2008-10-20 16:24:25 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2008-10-20 16:24:25 +0000 |
commit | d28e8ff804160b75d2c85e2282a573691c388544 (patch) | |
tree | c2398bc70ecc89abcc5e1603ebeab66eda08d51f | |
parent | e0fb87acf6dc7e96ebf920f0966bbab73c98cb81 (diff) | |
download | bcm5719-llvm-d28e8ff804160b75d2c85e2282a573691c388544.tar.gz bcm5719-llvm-d28e8ff804160b75d2c85e2282a573691c388544.zip |
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.
llvm-svn: 57839
-rw-r--r-- | llvm/include/llvm/Target/TargetLowering.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/include/llvm/Target/TargetLowering.h b/llvm/include/llvm/Target/TargetLowering.h index 85e90af5adf..2884ab72040 100644 --- a/llvm/include/llvm/Target/TargetLowering.h +++ b/llvm/include/llvm/Target/TargetLowering.h @@ -209,10 +209,11 @@ public: 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. |