For PR950:

Make necessary changes to support DIV -> [SUF]Div. This changes llvm to
have three division instructions: signed, unsigned, floating point. The
bytecode and assembler are bacwards compatible, however.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31195 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Reid Spencer
2006-10-26 06:15:43 +00:00
parent 7043d00750
commit 1628cec4d7
32 changed files with 3086 additions and 1944 deletions

File diff suppressed because it is too large Load Diff

View File

@ -226,6 +226,18 @@ protected:
Function* F ///< The function into which BBs will be inserted
);
/// Convert previous opcode values into the current value and/or construct
/// the instruction. This function handles all *abnormal* cases for
/// instruction generation based on obsolete opcode values. The normal cases
/// are handled by the ParseInstruction function.
Instruction* handleObsoleteOpcodes(
unsigned &opcode, ///< The old opcode, possibly updated by this function
std::vector<unsigned> &Oprnds, ///< The operands to the instruction
unsigned &iType, ///< The type code from the bytecode file
const Type* InstTy, ///< The type of the instruction
BasicBlock* BB ///< The basic block to insert into, if we need to
);
/// @brief Parse a single instruction.
void ParseInstruction(
std::vector<unsigned>& Args, ///< The arguments to be filled in
@ -336,6 +348,13 @@ private:
// unreachable instruction.
bool hasNoUnreachableInst;
// In version 5 and prior, instructions were signless. In version 6,
// instructions became signed. For example in version 5 we have the DIV
// instruction but in version 6 we have FDIV, SDIV and UDIV to replace it.
// This causes a renumbering of the instruction codes in version 6 that must
// be dealt with when reading old bytecode files.
bool hasSignlessInstructions;
/// In release 1.7 we changed intrinsic functions to not be overloaded. There
/// is no bytecode change for this, but to optimize the auto-upgrade of calls
/// to intrinsic functions, we save a mapping of old function definitions to

View File

@ -40,7 +40,7 @@ using namespace llvm;
/// so that the reader can distinguish which format of the bytecode file has
/// been written.
/// @brief The bytecode version number
const unsigned BCVersionNum = 5;
const unsigned BCVersionNum = 6;
static RegisterPass<WriteBytecodePass> X("emitbytecode", "Bytecode Writer");