diff options
-rw-r--r-- | include/llvm/Bitcode/NaCl/NaClLLVMBitCodes.h | 5 | ||||
-rw-r--r-- | lib/Bitcode/NaCl/Reader/NaClBitcodeReader.cpp | 36 |
2 files changed, 5 insertions, 36 deletions
diff --git a/include/llvm/Bitcode/NaCl/NaClLLVMBitCodes.h b/include/llvm/Bitcode/NaCl/NaClLLVMBitCodes.h index 53f74f0ef4..5433ed5352 100644 --- a/include/llvm/Bitcode/NaCl/NaClLLVMBitCodes.h +++ b/include/llvm/Bitcode/NaCl/NaClLLVMBitCodes.h @@ -270,12 +270,11 @@ namespace naclbitc { // [, flags]] FUNC_CODE_INST_CAST = 3, // CAST: [opval, destty, castopc] FUNC_CODE_INST_GEP = 4, // Not used in PNaCl. - FUNC_CODE_INST_SELECT = 5, // SELECT: [opval, opval, opval] + FUNC_CODE_INST_SELECT = 5, // Not used in PNaCl. Replaced by VSELECT. FUNC_CODE_INST_EXTRACTELT = 6, // Not used in PNaCl. FUNC_CODE_INST_INSERTELT = 7, // Not used in PNaCl. FUNC_CODE_INST_SHUFFLEVEC = 8, // Not used in PNaCl. - FUNC_CODE_INST_CMP = 9, // CMP: [opval, opval, pred] - + FUNC_CODE_INST_CMP = 9, // Not used in PNaCl. Replaced by CMP2. FUNC_CODE_INST_RET = 10, // RET: [opval<optional>] FUNC_CODE_INST_BR = 11, // BR: [bb#, bb#, cond] or [bb#] FUNC_CODE_INST_SWITCH = 12, // SWITCH: [opty, op0, op1, ...] diff --git a/lib/Bitcode/NaCl/Reader/NaClBitcodeReader.cpp b/lib/Bitcode/NaCl/Reader/NaClBitcodeReader.cpp index b384df7f58..9c2f45ea56 100644 --- a/lib/Bitcode/NaCl/Reader/NaClBitcodeReader.cpp +++ b/lib/Bitcode/NaCl/Reader/NaClBitcodeReader.cpp @@ -29,10 +29,6 @@ #include "llvm/Support/raw_ostream.h" using namespace llvm; -enum { - SWITCH_INST_MAGIC = 0x4B5 // May 2012 => 1205 => Hex -}; - void NaClBitcodeReader::FreeState() { if (BufferOwned) delete Buffer; @@ -1443,20 +1439,6 @@ bool NaClBitcodeReader::ParseFunctionBody(Function *F) { break; } - case naclbitc::FUNC_CODE_INST_SELECT: { // SELECT: [opval, opval, opval] - // obsolete form of select - // handles select i1 ... in old bitcode - unsigned OpNum = 0; - Value *TrueVal, *FalseVal, *Cond; - if (popValue(Record, &OpNum, NextValueNo, &TrueVal) || - popValue(Record, &OpNum, NextValueNo, &FalseVal) || - popValue(Record, &OpNum, NextValueNo, &Cond)) - return Error("Invalid SELECT record"); - - I = SelectInst::Create(Cond, TrueVal, FalseVal); - break; - } - case naclbitc::FUNC_CODE_INST_VSELECT: {// VSELECT: [opval, opval, pred] // new form of select // handles select i1 or select [N x i1] @@ -1467,26 +1449,14 @@ bool NaClBitcodeReader::ParseFunctionBody(Function *F) { popValue(Record, &OpNum, NextValueNo, &Cond)) return Error("Invalid SELECT record"); - // select condition can be either i1 or [N x i1] - if (VectorType* vector_type = - dyn_cast<VectorType>(Cond->getType())) { - // expect <n x i1> - if (vector_type->getElementType() != Type::getInt1Ty(Context)) - return Error("Invalid SELECT condition type"); - } else { - // expect i1 - if (Cond->getType() != Type::getInt1Ty(Context)) - return Error("Invalid SELECT condition type"); - } + // expect i1 + if (Cond->getType() != Type::getInt1Ty(Context)) + return Error("Invalid SELECT condition type"); I = SelectInst::Create(Cond, TrueVal, FalseVal); break; } - case naclbitc::FUNC_CODE_INST_CMP: // CMP: [opval, opval, pred] - // Old form of ICmp/FCmp returning bool - // Existed to differentiate between icmp/fcmp and vicmp/vfcmp which were - // both legal on vectors but had different behaviour. case naclbitc::FUNC_CODE_INST_CMP2: { // CMP2: [opval, opval, pred] // FCmp/ICmp returning bool or vector of bool |