[llvm-commits] CVS: llvm/lib/Target/TargetMachine.cpp

Chris Lattner lattner at cs.uiuc.edu
Sat Apr 26 14:48:01 PDT 2003


Changes in directory llvm/lib/Target:

TargetMachine.cpp updated: 1.17 -> 1.18

---
Log message:

The promotion rules are the same for all targets, they are set by the C standard.


---
Diffs of the changes:

Index: llvm/lib/Target/TargetMachine.cpp
diff -u llvm/lib/Target/TargetMachine.cpp:1.17 llvm/lib/Target/TargetMachine.cpp:1.18
--- llvm/lib/Target/TargetMachine.cpp:1.17	Sat Dec 28 20:50:31 2002
+++ llvm/lib/Target/TargetMachine.cpp	Sat Apr 26 14:47:36 2003
@@ -20,16 +20,10 @@
 
 // function TargetMachine::findOptimalStorageSize 
 // 
-// Purpose:
-//   This default implementation assumes that all sub-word data items use
-//   space equal to optSizeForSubWordData, and all other primitive data
-//   items use space according to the type.
-//   
 unsigned TargetMachine::findOptimalStorageSize(const Type *Ty) const {
-  // Round integral values smaller than SubWordDataSize up to SubWordDataSize
-  if (Ty->isIntegral() &&
-      Ty->getPrimitiveSize() < DataLayout.getSubWordDataSize())
-    return DataLayout.getSubWordDataSize();
+  // All integer types smaller than ints promote to 4 byte integers.
+  if (Ty->isIntegral() && Ty->getPrimitiveSize() < 4)
+    return 4;
 
   return DataLayout.getTypeSize(Ty);
 }





More information about the llvm-commits mailing list