[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
Chris Lattner
lattner at cs.uiuc.edu
Sat Jan 15 16:37:53 PST 2005
Changes in directory llvm/lib/CodeGen/SelectionDAG:
SelectionDAGISel.cpp updated: 1.17 -> 1.18
---
Log message:
Add support for targets that require promotions.
---
Diffs of the changes: (+6 -1)
Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.17 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.18
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.17 Sat Jan 15 00:17:04 2005
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Sat Jan 15 18:37:38 2005
@@ -77,7 +77,12 @@
// 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.
More information about the llvm-commits
mailing list