aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/TargetLowering.cpp
diff options
context:
space:
mode:
authorMon P Wang <wangmp@apple.com>2008-10-30 08:01:45 +0000
committerMon P Wang <wangmp@apple.com>2008-10-30 08:01:45 +0000
commit0c39719bfc7d0b3e61fbd55e1115184a1d5f6ae7 (patch)
tree58d22bd694449b4f892ce8e5939e75dc396f4679 /lib/CodeGen/SelectionDAG/TargetLowering.cpp
parent1eb4df6481fcc31d5ebcccb2df4d92ed44186530 (diff)
Add initial support for vector widening. Logic is set to widen for X86.
One will only see an effect if legalizetype is not active. Will move support to LegalizeType soon. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58426 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/TargetLowering.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/TargetLowering.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/lib/CodeGen/SelectionDAG/TargetLowering.cpp
index 1e7e847b8a..9410271d06 100644
--- a/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+++ b/lib/CodeGen/SelectionDAG/TargetLowering.cpp
@@ -573,7 +573,7 @@ void TargetLowering::computeRegisterProperties() {
RegisterVT);
RegisterTypeForVT[i] = RegisterVT;
TransformToType[i] = MVT::Other; // this isn't actually used
- ValueTypeActions.setTypeAction(VT, Expand);
+ ValueTypeActions.setTypeAction(VT, Promote);
}
}
}
@@ -642,6 +642,20 @@ unsigned TargetLowering::getVectorTypeBreakdown(MVT VT,
return 1;
}
+/// getWidenVectorType: given a vector type, returns the type to widen to
+/// (e.g., v7i8 to v8i8). If the vector type is legal, it returns itself.
+/// If there is no vector type that we want to widen to, returns MVT::Other
+/// When and were to widen is target dependent based on the cost of
+/// scalarizing vs using the wider vector type.
+MVT TargetLowering::getWidenVectorType(MVT VT) {
+ assert(VT.isVector());
+ if (isTypeLegal(VT))
+ return VT;
+
+ // Default is not to widen until moved to LegalizeTypes
+ return MVT::Other;
+}
+
/// getByValTypeAlignment - Return the desired alignment for ByVal aggregate
/// function arguments in the caller parameter area. This is the actual
/// alignment, not its logarithm.