summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/TargetLowering.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-03-31 00:46:36 +0000
committerChris Lattner <sabre@nondot.org>2006-03-31 00:46:36 +0000
commitf144dac7b7ef86d4336131e82871eca4e8f32224 (patch)
tree40bf5aadd86c8b9cd73e522a513acecce94c57b9 /llvm/lib/Target/TargetLowering.cpp
parentd9d0bbb5ac5674096d5d0bfc89834787e9491750 (diff)
downloadbcm5719-llvm-f144dac7b7ef86d4336131e82871eca4e8f32224.tar.gz
bcm5719-llvm-f144dac7b7ef86d4336131e82871eca4e8f32224.zip
Modify the TargetLowering::getPackedTypeBreakdown method to also return the
unpromoted element type. llvm-svn: 27273
Diffstat (limited to 'llvm/lib/Target/TargetLowering.cpp')
-rw-r--r--llvm/lib/Target/TargetLowering.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/llvm/lib/Target/TargetLowering.cpp b/llvm/lib/Target/TargetLowering.cpp
index b9c10ce103e..922245f5535 100644
--- a/llvm/lib/Target/TargetLowering.cpp
+++ b/llvm/lib/Target/TargetLowering.cpp
@@ -148,11 +148,13 @@ const char *TargetLowering::getTargetNodeName(unsigned Opcode) const {
///
/// This method returns the number and type of the resultant breakdown.
///
-MVT::ValueType TargetLowering::getPackedTypeBreakdown(const PackedType *PTy,
- unsigned &NumVals) const {
+unsigned TargetLowering::getPackedTypeBreakdown(const PackedType *PTy,
+ MVT::ValueType &PTyElementVT,
+ MVT::ValueType &PTyLegalElementVT) const {
// Figure out the right, legal destination reg to copy into.
unsigned NumElts = PTy->getNumElements();
MVT::ValueType EltTy = getValueType(PTy->getElementType());
+ PTyElementVT = EltTy;
unsigned NumVectorRegs = 1;
@@ -170,13 +172,14 @@ MVT::ValueType TargetLowering::getPackedTypeBreakdown(const PackedType *PTy,
VT = getVectorType(EltTy, NumElts);
MVT::ValueType DestVT = getTypeToTransformTo(VT);
+ PTyLegalElementVT = DestVT;
if (DestVT < VT) {
// Value is expanded, e.g. i64 -> i16.
- NumVals = NumVectorRegs*(MVT::getSizeInBits(VT)/MVT::getSizeInBits(DestVT));
+ return NumVectorRegs*(MVT::getSizeInBits(VT)/MVT::getSizeInBits(DestVT));
} else {
// Otherwise, promotion or legal types use the same number of registers as
// the vector decimated to the appropriate level.
- NumVals = NumVectorRegs;
+ return NumVectorRegs;
}
return DestVT;
OpenPOWER on IntegriCloud