summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-01-16 00:37:38 +0000
committerChris Lattner <sabre@nondot.org>2005-01-16 00:37:38 +0000
commita8d34fb8c6819ae9c547ae7958064756add45190 (patch)
tree35e48f43fea8c168218667391bf6900673e4023d /llvm/lib
parent207a962c2c3f5f8161ce5e0fd462259d34cb1c50 (diff)
downloadbcm5719-llvm-a8d34fb8c6819ae9c547ae7958064756add45190.tar.gz
bcm5719-llvm-a8d34fb8c6819ae9c547ae7958064756add45190.zip
Add support for targets that require promotions.
llvm-svn: 19579
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index 3250760acad..94aab323378 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/llvm/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.
OpenPOWER on IntegriCloud