diff options
author | Chris Lattner <sabre@nondot.org> | 2006-03-31 00:46:36 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-03-31 00:46:36 +0000 |
commit | 79227e2906656b2c92965f5dbebcd66a5774c87f (patch) | |
tree | ed4c937f0dbd6926b6c8d058d477d1870a74adc3 /lib/CodeGen/SelectionDAG/TargetLowering.cpp | |
parent | fb47a9b1c86201529f25a6b8b0c2145eb7a24cca (diff) |
Modify the TargetLowering::getPackedTypeBreakdown method to also return the
unpromoted element type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27273 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/TargetLowering.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/TargetLowering.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/lib/CodeGen/SelectionDAG/TargetLowering.cpp index b9c10ce103..922245f553 100644 --- a/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/lib/CodeGen/SelectionDAG/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; |