[llvm-commits] CVS: llvm/lib/VMCore/SlotCalculator.cpp

Chris Lattner lattner at cs.uiuc.edu
Sat Jan 17 17:26:01 PST 2004


Changes in directory llvm/lib/VMCore:

SlotCalculator.cpp updated: 1.46 -> 1.47

---
Log message:

Bytecode format for LLVM 1.2 no longer explicitly encodes zeros in primitive
type planes.  This saves about 5k on 176.gcc, and is needed for a subsequent
patch of mine I'm working on.


---
Diffs of the changes:  (+5 -1)

Index: llvm/lib/VMCore/SlotCalculator.cpp
diff -u llvm/lib/VMCore/SlotCalculator.cpp:1.46 llvm/lib/VMCore/SlotCalculator.cpp:1.47
--- llvm/lib/VMCore/SlotCalculator.cpp:1.46	Thu Jan 15 14:24:09 2004
+++ llvm/lib/VMCore/SlotCalculator.cpp	Sat Jan 17 17:25:43 2004
@@ -406,6 +406,10 @@
   return doInsertValue(D);
 }
 
+static inline bool hasNullValue(unsigned TyID) {
+  return TyID != Type::LabelTyID && TyID != Type::TypeTyID &&
+         TyID != Type::VoidTyID;
+}
 
 // doInsertValue - This is a small helper function to be called only
 // be insertValue.
@@ -435,7 +439,7 @@
 
   // If this is the first value to get inserted into the type plane, make sure
   // to insert the implicit null value...
-  if (Table[Ty].empty() && Ty >= Type::FirstDerivedTyID && BuildBytecodeInfo) {
+  if (Table[Ty].empty() && BuildBytecodeInfo && hasNullValue(Ty)) {
     Value *ZeroInitializer = Constant::getNullValue(Typ);
 
     // If we are pushing zeroinit, it will be handled below.





More information about the llvm-commits mailing list