mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-15 05:24:01 +00:00
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10908 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -161,6 +161,11 @@ void BytecodeWriter::outputConstantsInPlane(const std::vector<const Value*>
|
||||
}
|
||||
}
|
||||
|
||||
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 @@ void BytecodeWriter::outputConstants(bool isFunction) {
|
||||
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;
|
||||
|
Reference in New Issue
Block a user