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.
llvm-svn: 10908
diff --git a/llvm/lib/Bytecode/Writer/Writer.cpp b/llvm/lib/Bytecode/Writer/Writer.cpp
index 6467921..ff9e8a9 100644
--- a/llvm/lib/Bytecode/Writer/Writer.cpp
+++ b/llvm/lib/Bytecode/Writer/Writer.cpp
@@ -161,6 +161,11 @@
}
}
+static inline bool hasNullValue(unsigned TyID) {
+ return TyID != Type::LabelTyID && TyID != Type::TypeTyID &&
+ TyID != Type::VoidTyID;
+}
+
void BytecodeWriter::outputConstants(bool isFunction) {
ConstantTotalBytes -= Out.size();
if (isFunction) FunctionConstantTotalBytes -= Out.size();
@@ -190,7 +195,7 @@
if (isFunction) // Don't re-emit module constants
ValNo += Table.getModuleLevel(pno);
- if (pno >= Type::FirstDerivedTyID) {
+ if (hasNullValue(pno)) {
// Skip zero initializer
if (ValNo == 0)
ValNo = 1;