diff options
author | Chris Lattner <sabre@nondot.org> | 2005-01-16 00:37:38 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-01-16 00:37:38 +0000 |
commit | fb849800ea2040c188365c265421ad54fbdcf219 (patch) | |
tree | d37553580e2528f93ed8021524a38bc25eeaa5fa /lib | |
parent | ff3e50cc39db6939b637165997283f59412387bb (diff) |
Add support for targets that require promotions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19579 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index 3250760aca..94aab32337 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -77,7 +77,12 @@ namespace llvm { // The common case is that we will only create one register for this // value. If we have that case, create and return the virtual register. unsigned NV = TLI.getNumElements(VT); - if (NV == 1) return MakeReg(VT); + if (NV == 1) { + // If we are promoting this value, pick the next largest supported type. + while (!TLI.hasNativeSupportFor(VT)) + VT = (MVT::ValueType)(VT+1); + return MakeReg(VT); + } // If this value is represented with multiple target registers, make sure // to create enough consequtive registers of the right (smaller) type. |