diff --git a/lib/Bytecode/Writer/Writer.cpp b/lib/Bytecode/Writer/Writer.cpp index fdd0f3ca427..b8f57f7f72f 100644 --- a/lib/Bytecode/Writer/Writer.cpp +++ b/lib/Bytecode/Writer/Writer.cpp @@ -449,8 +449,8 @@ void BytecodeWriter::outputInstructionFormat0(const Instruction *I, output_typeid(Type); // Result type unsigned NumArgs = I->getNumOperands(); - output_vbr(NumArgs + (isa(I) || isa(I) || - isa(I) || Opcode == 58)); + output_vbr(NumArgs + (isa(I) || isa(I) || + isa(I) || isa(I) || Opcode == 58)); if (!isa(&I)) { for (unsigned i = 0; i < NumArgs; ++i) { @@ -463,6 +463,8 @@ void BytecodeWriter::outputInstructionFormat0(const Instruction *I, int Slot = Table.getSlot(I->getType()); assert(Slot != -1 && "Cast return type unknown?"); output_typeid((unsigned)Slot); + } else if (isa(I)) { + output_vbr(unsigned(cast(I)->getPredicate())); } else if (isa(I)) { output_vbr(cast(I)->getCallingConv()); } else if (Opcode == 58) { // Call escape sequence @@ -793,13 +795,6 @@ void BytecodeWriter::outputInstruction(const Instruction &I) { } } - // In the weird case of the ICmp or FCmp instructions, we need to also put - // out the instruction's predicate value. We do that here, after the - // instruction's type and operands have been written so we can reuse the - // code above. - if (const CmpInst* CI = dyn_cast(&I)) - output_vbr((unsigned)CI->getPredicate()); - // If we weren't handled before here, we either have a large number of // operands or a large operand index that we are referring to. outputInstructionFormat0(&I, Opcode, Table, Type);