aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2008-10-20 16:24:25 +0000
committerDuncan Sands <baldrick@free.fr>2008-10-20 16:24:25 +0000
commit9a2c1d3c46e6f24f978513244daad5c9b94e4556 (patch)
treeaca7ecdfb20d9424a9adf79e99a8ed33d4223abe /include
parentb5f68e241f9eb19e5694131df830acbfce20a6eb (diff)
downloadexternal_llvm-9a2c1d3c46e6f24f978513244daad5c9b94e4556.zip
external_llvm-9a2c1d3c46e6f24f978513244daad5c9b94e4556.tar.gz
external_llvm-9a2c1d3c46e6f24f978513244daad5c9b94e4556.tar.bz2
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57839 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Target/TargetLowering.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/include/llvm/Target/TargetLowering.h b/include/llvm/Target/TargetLowering.h
index 85e90af..2884ab7 100644
--- a/include/llvm/Target/TargetLowering.h
+++ b/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.