diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2009-07-08 03:04:38 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2009-07-08 03:04:38 +0000 |
commit | 7f6aa2b162e5daaf7b9ccf05d749597d3d7cf460 (patch) | |
tree | 7f1696da48ecf7a060d0c9322198de79ae1cfedb | |
parent | 34a0fa362dde63cf9adf5917ab2ee2c2b7dd2179 (diff) |
Remove the vicmp and vfcmp instructions. Because we never had a release with
these instructions, no autoupgrade or backwards compatibility support is
provided.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74991 91177308-0d34-0410-b5e6-96231b3b80d8
31 files changed, 99 insertions, 664 deletions
diff --git a/docs/LangRef.html b/docs/LangRef.html index c57518befc..416b105cd7 100644 --- a/docs/LangRef.html +++ b/docs/LangRef.html @@ -155,8 +155,6 @@ <ol> <li><a href="#i_icmp">'<tt>icmp</tt>' Instruction</a></li> <li><a href="#i_fcmp">'<tt>fcmp</tt>' Instruction</a></li> - <li><a href="#i_vicmp">'<tt>vicmp</tt>' Instruction</a></li> - <li><a href="#i_vfcmp">'<tt>vfcmp</tt>' Instruction</a></li> <li><a href="#i_phi">'<tt>phi</tt>' Instruction</a></li> <li><a href="#i_select">'<tt>select</tt>' Instruction</a></li> <li><a href="#i_call">'<tt>call</tt>' Instruction</a></li> @@ -2042,12 +2040,6 @@ following is the syntax for constant expressions:</p> <dt><b><tt>fcmp COND ( VAL1, VAL2 )</tt></b></dt> <dd>Performs the <a href="#i_fcmp">fcmp operation</a> on constants.</dd> - <dt><b><tt>vicmp COND ( VAL1, VAL2 )</tt></b></dt> - <dd>Performs the <a href="#i_vicmp">vicmp operation</a> on constants.</dd> - - <dt><b><tt>vfcmp COND ( VAL1, VAL2 )</tt></b></dt> - <dd>Performs the <a href="#i_vfcmp">vfcmp operation</a> on constants.</dd> - <dt><b><tt>extractelement ( VAL, IDX )</tt></b></dt> <dd>Perform the <a href="#i_extractelement">extractelement @@ -4506,109 +4498,6 @@ always yields an <a href="#t_primitive">i1</a> result, as follows:</p> <!-- _______________________________________________________________________ --> <div class="doc_subsubsection"> - <a name="i_vicmp">'<tt>vicmp</tt>' Instruction</a> -</div> -<div class="doc_text"> -<h5>Syntax:</h5> -<pre> <result> = vicmp <cond> <ty> <op1>, <op2> <i>; yields {ty}:result</i> -</pre> -<h5>Overview:</h5> -<p>The '<tt>vicmp</tt>' instruction returns an integer vector value based on -element-wise comparison of its two integer vector operands.</p> -<h5>Arguments:</h5> -<p>The '<tt>vicmp</tt>' instruction takes three operands. The first operand is -the condition code indicating the kind of comparison to perform. It is not -a value, just a keyword. The possible condition code are:</p> -<ol> - <li><tt>eq</tt>: equal</li> - <li><tt>ne</tt>: not equal </li> - <li><tt>ugt</tt>: unsigned greater than</li> - <li><tt>uge</tt>: unsigned greater or equal</li> - <li><tt>ult</tt>: unsigned less than</li> - <li><tt>ule</tt>: unsigned less or equal</li> - <li><tt>sgt</tt>: signed greater than</li> - <li><tt>sge</tt>: signed greater or equal</li> - <li><tt>slt</tt>: signed less than</li> - <li><tt>sle</tt>: signed less or equal</li> -</ol> -<p>The remaining two arguments must be <a href="#t_vector">vector</a> or -<a href="#t_integer">integer</a> typed. They must also be identical types.</p> -<h5>Semantics:</h5> -<p>The '<tt>vicmp</tt>' instruction compares <tt>op1</tt> and <tt>op2</tt> -according to the condition code given as <tt>cond</tt>. The comparison yields a -<a href="#t_vector">vector</a> of <a href="#t_integer">integer</a> result, of -identical type as the values being compared. The most significant bit in each -element is 1 if the element-wise comparison evaluates to true, and is 0 -otherwise. All other bits of the result are undefined. The condition codes -are evaluated identically to the <a href="#i_icmp">'<tt>icmp</tt>' -instruction</a>.</p> - -<h5>Example:</h5> -<pre> - <result> = vicmp eq <2 x i32> < i32 4, i32 0>, < i32 5, i32 0> <i>; yields: result=<2 x i32> < i32 0, i32 -1 ></i> - <result> = vicmp ult <2 x i8 > < i8 1, i8 2>, < i8 2, i8 2 > <i>; yields: result=<2 x i8> < i8 -1, i8 0 ></i> -</pre> -</div> - -<!-- _______________________________________________________________________ --> -<div class="doc_subsubsection"> - <a name="i_vfcmp">'<tt>vfcmp</tt>' Instruction</a> -</div> -<div class="doc_text"> -<h5>Syntax:</h5> -<pre> <result> = vfcmp <cond> <ty> <op1>, <op2></pre> -<h5>Overview:</h5> -<p>The '<tt>vfcmp</tt>' instruction returns an integer vector value based on -element-wise comparison of its two floating point vector operands. The output -elements have the same width as the input elements.</p> -<h5>Arguments:</h5> -<p>The '<tt>vfcmp</tt>' instruction takes three operands. The first operand is -the condition code indicating the kind of comparison to perform. It is not -a value, just a keyword. The possible condition code are:</p> -<ol> - <li><tt>false</tt>: no comparison, always returns false</li> - <li><tt>oeq</tt>: ordered and equal</li> - <li><tt>ogt</tt>: ordered and greater than </li> - <li><tt>oge</tt>: ordered and greater than or equal</li> - <li><tt>olt</tt>: ordered and less than </li> - <li><tt>ole</tt>: ordered and less than or equal</li> - <li><tt>one</tt>: ordered and not equal</li> - <li><tt>ord</tt>: ordered (no nans)</li> - <li><tt>ueq</tt>: unordered or equal</li> - <li><tt>ugt</tt>: unordered or greater than </li> - <li><tt>uge</tt>: unordered or greater than or equal</li> - <li><tt>ult</tt>: unordered or less than </li> - <li><tt>ule</tt>: unordered or less than or equal</li> - <li><tt>une</tt>: unordered or not equal</li> - <li><tt>uno</tt>: unordered (either nans)</li> - <li><tt>true</tt>: no comparison, always returns true</li> -</ol> -<p>The remaining two arguments must be <a href="#t_vector">vector</a> of -<a href="#t_floating">floating point</a> typed. They must also be identical -types.</p> -<h5>Semantics:</h5> -<p>The '<tt>vfcmp</tt>' instruction compares <tt>op1</tt> and <tt>op2</tt> -according to the condition code given as <tt>cond</tt>. The comparison yields a -<a href="#t_vector">vector</a> of <a href="#t_integer">integer</a> result, with -an identical number of elements as the values being compared, and each element -having identical with to the width of the floating point elements. The most -significant bit in each element is 1 if the element-wise comparison evaluates to -true, and is 0 otherwise. All other bits of the result are undefined. The -condition codes are evaluated identically to the -<a href="#i_fcmp">'<tt>fcmp</tt>' instruction</a>.</p> - -<h5>Example:</h5> -<pre> - <i>; yields: result=<2 x i32> < i32 0, i32 -1 ></i> - <result> = vfcmp oeq <2 x float> < float 4, float 0 >, < float 5, float 0 > - - <i>; yields: result=<2 x i64> < i64 -1, i64 0 ></i> - <result> = vfcmp ult <2 x double> < double 1, double 2 >, < double 2, double 2> -</pre> -</div> - -<!-- _______________________________________________________________________ --> -<div class="doc_subsubsection"> <a name="i_phi">'<tt>phi</tt>' Instruction</a> </div> diff --git a/include/llvm-c/Core.h b/include/llvm-c/Core.h index e0eaf9b5cb..9d8577380b 100644 --- a/include/llvm-c/Core.h +++ b/include/llvm-c/Core.h @@ -341,8 +341,6 @@ void LLVMDisposeTypeHandle(LLVMTypeHandleRef TypeHandle); macro(CmpInst) \ macro(FCmpInst) \ macro(ICmpInst) \ - macro(VFCmpInst) \ - macro(VICmpInst) \ macro(ExtractElementInst) \ macro(GetElementPtrInst) \ macro(InsertElementInst) \ diff --git a/include/llvm/Bitcode/LLVMBitCodes.h b/include/llvm/Bitcode/LLVMBitCodes.h index 1ede69dee1..c3a1bc1d8a 100644 --- a/include/llvm/Bitcode/LLVMBitCodes.h +++ b/include/llvm/Bitcode/LLVMBitCodes.h @@ -210,7 +210,8 @@ namespace bitc { FUNC_CODE_INST_GETRESULT = 25, // GETRESULT: [ty, opval, n] FUNC_CODE_INST_EXTRACTVAL = 26, // EXTRACTVAL: [n x operands] FUNC_CODE_INST_INSERTVAL = 27, // INSERTVAL: [n x operands] - // fcmp/icmp returning Int1TY or vector of Int1Ty, NOT for vicmp/vfcmp + // fcmp/icmp returning Int1TY or vector of Int1Ty. Same as CMP, exists to + // support legacy vicmp/vfcmp instructions. FUNC_CODE_INST_CMP2 = 28, // CMP2: [opty, opval, opval, pred] // new select on i1 or [N x i1] FUNC_CODE_INST_VSELECT = 29 // VSELECT: [ty,opval,opval,predty,pred] diff --git a/include/llvm/Constants.h b/include/llvm/Constants.h index da69d25cf6..09750668a1 100644 --- a/include/llvm/Constants.h +++ b/include/llvm/Constants.h @@ -710,8 +710,7 @@ public: /// static Constant *get(unsigned Opcode, Constant *C1, Constant *C2); - /// @brief Return an ICmp, FCmp, VICmp, or VFCmp comparison operator constant - /// expression. + /// @brief Return an ICmp or FCmp comparison operator constant expression. static Constant *getCompare(unsigned short pred, Constant *C1, Constant *C2); /// ConstantExpr::get* - Return some common constants without having to @@ -737,8 +736,6 @@ public: static Constant *getXor(Constant *C1, Constant *C2); static Constant *getICmp(unsigned short pred, Constant *LHS, Constant *RHS); static Constant *getFCmp(unsigned short pred, Constant *LHS, Constant *RHS); - static Constant *getVICmp(unsigned short pred, Constant *LHS, Constant *RHS); - static Constant *getVFCmp(unsigned short pred, Constant *LHS, Constant *RHS); static Constant *getShl(Constant *C1, Constant *C2); static Constant *getLShr(Constant *C1, Constant *C2); static Constant *getAShr(Constant *C1, Constant *C2); diff --git a/include/llvm/InstrTypes.h b/include/llvm/InstrTypes.h index 1eab983da6..0a018de5e9 100644 --- a/include/llvm/InstrTypes.h +++ b/include/llvm/InstrTypes.h @@ -655,14 +655,12 @@ public: static inline bool classof(const CmpInst *) { return true; } static inline bool classof(const Instruction *I) { return I->getOpcode() == Instruction::ICmp || - I->getOpcode() == Instruction::FCmp || - I->getOpcode() == Instruction::VICmp || - I->getOpcode() == Instruction::VFCmp; + I->getOpcode() == Instruction::FCmp; } static inline bool classof(const Value *V) { return isa<Instruction>(V) && classof(cast<Instruction>(V)); } - /// @brief Create a result type for fcmp/icmp (but not vicmp/vfcmp) + /// @brief Create a result type for fcmp/icmp static const Type* makeCmpResultType(const Type* opnd_type) { if (const VectorType* vt = dyn_cast<const VectorType>(opnd_type)) { return VectorType::get(Type::Int1Ty, vt->getNumElements()); diff --git a/include/llvm/Instruction.def b/include/llvm/Instruction.def index 98fda77705..e603c1257e 100644 --- a/include/llvm/Instruction.def +++ b/include/llvm/Instruction.def @@ -169,10 +169,8 @@ HANDLE_OTHER_INST(52, InsertElement, InsertElementInst) // insert into vector HANDLE_OTHER_INST(53, ShuffleVector, ShuffleVectorInst) // shuffle two vectors. HANDLE_OTHER_INST(54, ExtractValue, ExtractValueInst)// extract from aggregate HANDLE_OTHER_INST(55, InsertValue, InsertValueInst) // insert into aggregate -HANDLE_OTHER_INST(56, VICmp , VICmpInst ) // Vec Int comparison instruction. -HANDLE_OTHER_INST(57, VFCmp , VFCmpInst ) // Vec FP point comparison instr. - LAST_OTHER_INST(57) + LAST_OTHER_INST(55) #undef FIRST_TERM_INST #undef HANDLE_TERM_INST diff --git a/include/llvm/Instructions.h b/include/llvm/Instructions.h index 4419fbd6a9..aef77f0a93 100644 --- a/include/llvm/Instructions.h +++ b/include/llvm/Instructions.h @@ -862,118 +862,6 @@ public: }; //===----------------------------------------------------------------------===// -// VICmpInst Class -//===----------------------------------------------------------------------===// - -/// This instruction compares its operands according to the predicate given -/// to the constructor. It only operates on vectors of integers. -/// The operands must be identical types. -/// @brief Represents a vector integer comparison operator. -class VICmpInst: public CmpInst { -public: - /// @brief Constructor with insert-before-instruction semantics. - VICmpInst( - Predicate pred, ///< The predicate to use for the comparison - Value *LHS, ///< The left-hand-side of the expression - Value *RHS, ///< The right-hand-side of the expression - const std::string &NameStr = "", ///< Name of the instruction - Instruction *InsertBefore = 0 ///< Where to insert - ) : CmpInst(LHS->getType(), Instruction::VICmp, pred, LHS, RHS, NameStr, - InsertBefore) { - assert(pred >= CmpInst::FIRST_ICMP_PREDICATE && - pred <= CmpInst::LAST_ICMP_PREDICATE && - "Invalid VICmp predicate value"); - assert(getOperand(0)->getType() == getOperand(1)->getType() && - "Both operands to VICmp instruction are not of the same type!"); - } - - /// @brief Constructor with insert-at-block-end semantics. - VICmpInst( - Predicate pred, ///< The predicate to use for the comparison - Value *LHS, ///< The left-hand-side of the expression - Value *RHS, ///< The right-hand-side of the expression - const std::string &NameStr, ///< Name of the instruction - BasicBlock *InsertAtEnd ///< Block to insert into. - ) : CmpInst(LHS->getType(), Instruction::VICmp, pred, LHS, RHS, NameStr, - InsertAtEnd) { - assert(pred >= CmpInst::FIRST_ICMP_PREDICATE && - pred <= CmpInst::LAST_ICMP_PREDICATE && - "Invalid VICmp predicate value"); - assert(getOperand(0)->getType() == getOperand(1)->getType() && - "Both operands to VICmp instruction are not of the same type!"); - } - - /// @brief Return the predicate for this instruction. - Predicate getPredicate() const { return Predicate(SubclassData); } - - virtual VICmpInst *clone() const; - - // Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const VICmpInst *) { return true; } - static inline bool classof(const Instruction *I) { - return I->getOpcode() == Instruction::VICmp; - } - static inline bool classof(const Value *V) { - return isa<Instruction>(V) && classof(cast<Instruction>(V)); - } -}; - -//===----------------------------------------------------------------------===// -// VFCmpInst Class -//===----------------------------------------------------------------------===// - -/// This instruction compares its operands according to the predicate given -/// to the constructor. It only operates on vectors of floating point values. -/// The operands must be identical types. -/// @brief Represents a vector floating point comparison operator. -class VFCmpInst: public CmpInst { -public: - /// @brief Constructor with insert-before-instruction semantics. - VFCmpInst( - Predicate pred, ///< The predicate to use for the comparison - Value *LHS, ///< The left-hand-side of the expression - Value *RHS, ///< The right-hand-side of the expression - const std::string &NameStr = "", ///< Name of the instruction - Instruction *InsertBefore = 0 ///< Where to insert - ) : CmpInst(VectorType::getInteger(cast<VectorType>(LHS->getType())), - Instruction::VFCmp, pred, LHS, RHS, NameStr, InsertBefore) { - assert(pred <= CmpInst::LAST_FCMP_PREDICATE && - "Invalid VFCmp predicate value"); - assert(getOperand(0)->getType() == getOperand(1)->getType() && - "Both operands to VFCmp instruction are not of the same type!"); - } - - /// @brief Constructor with insert-at-block-end semantics. - VFCmpInst( - Predicate pred, ///< The predicate to use for the comparison - Value *LHS, ///< The left-hand-side of the expression - Value *RHS, ///< The right-hand-side of the expression - const std::string &NameStr, ///< Name of the instruction - BasicBlock *InsertAtEnd ///< Block to insert into. - ) : CmpInst(VectorType::getInteger(cast<VectorType>(LHS->getType())), - Instruction::VFCmp, pred, LHS, RHS, NameStr, InsertAtEnd) { - assert(pred <= CmpInst::LAST_FCMP_PREDICATE && - "Invalid VFCmp predicate value"); - assert(getOperand(0)->getType() == getOperand(1)->getType() && - "Both operands to VFCmp instruction are not of the same type!"); - } - - /// @brief Return the predicate for this instruction. - Predicate getPredicate() const { return Predicate(SubclassData); } - - virtual VFCmpInst *clone() const; - - /// @brief Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const VFCmpInst *) { return true; } - static inline bool classof(const Instruction *I) { - return I->getOpcode() == Instruction::VFCmp; - } - static inline bool classof(const Value *V) { - return isa<Instruction>(V) && classof(cast<Instruction>(V)); - } -}; - -//===----------------------------------------------------------------------===// // CallInst Class //===----------------------------------------------------------------------===// /// CallInst - This class represents a function call, abstracting a target diff --git a/include/llvm/LLVMContext.h b/include/llvm/LLVMContext.h index 7420a74211..60da89eb4a 100644 --- a/include/llvm/LLVMContext.h +++ b/include/llvm/LLVMContext.h @@ -145,10 +145,6 @@ public: Constant* RHS); Constant* getConstantExprFCmp(unsigned short pred, Constant* LHS, Constant* RHS); - Constant* getConstantExprVICmp(unsigned short pred, Constant* LHS, - Constant* RHS); - Constant* getConstantExprVFCmp(unsigned short pred, Constant* LHS, - Constant* RHS); Constant* getConstantExprShl(Constant* C1, Constant* C2); Constant* getConstantExprLShr(Constant* C1, Constant* C2); Constant* getConstantExprAShr(Constant* C1, Constant* C2); diff --git a/include/llvm/Support/ConstantFolder.h b/include/llvm/Support/ConstantFolder.h index 35065a0608..71368f145b 100644 --- a/include/llvm/Support/ConstantFolder.h +++ b/include/llvm/Support/ConstantFolder.h @@ -154,14 +154,6 @@ public: Constant *RHS) const { return ConstantExpr::getCompare(P, LHS, RHS); } - Constant *CreateVICmp(CmpInst::Predicate P, Constant *LHS, - Constant *RHS) const { - return ConstantExpr::getCompare(P, LHS, RHS); - } - Constant *CreateVFCmp(CmpInst::Predicate P, Constant *LHS, - Constant *RHS) const { - return ConstantExpr::getCompare(P, LHS, RHS); - } //===--------------------------------------------------------------------===// // Other Instructions diff --git a/include/llvm/Support/IRBuilder.h b/include/llvm/Support/IRBuilder.h index f05ee86148..f92f8654a5 100644 --- a/include/llvm/Support/IRBuilder.h +++ b/include/llvm/Support/IRBuilder.h @@ -570,21 +570,6 @@ public: return Insert(new FCmpInst(P, LHS, RHS), Name); } - Value *CreateVICmp(CmpInst::Predicate P, Value *LHS, Value *RHS, - const char *Name = "") { - if (Constant *LC = dyn_cast<Constant>(LHS)) - if (Constant *RC = dyn_cast<Constant>(RHS)) - return Folder.CreateVICmp(P, LC, RC); - return Insert(new VICmpInst(P, LHS, RHS), Name); - } - Value *CreateVFCmp(CmpInst::Predicate P, Value *LHS, Value *RHS, - const char *Name = "") { - if (Constant *LC = dyn_cast<Constant>(LHS)) - if (Constant *RC = dyn_cast<Constant>(RHS)) - return Folder.CreateVFCmp(P, LC, RC); - return Insert(new VFCmpInst(P, LHS, RHS), Name); - } - //===--------------------------------------------------------------------===// // Instruction creation methods: Other Instructions //===--------------------------------------------------------------------===// diff --git a/include/llvm/Support/InstVisitor.h b/include/llvm/Support/InstVisitor.h index 597cc9d905..768f4877ad 100644 --- a/include/llvm/Support/InstVisitor.h +++ b/include/llvm/Support/InstVisitor.h @@ -165,8 +165,6 @@ public: RetTy visitUnreachableInst(UnreachableInst &I) { DELEGATE(TerminatorInst);} RetTy visitICmpInst(ICmpInst &I) { DELEGATE(CmpInst);} RetTy visitFCmpInst(FCmpInst &I) { DELEGATE(CmpInst);} - RetTy visitVICmpInst(VICmpInst &I) { DELEGATE(CmpInst);} - RetTy visitVFCmpInst(VFCmpInst &I) { DELEGATE(CmpInst);} RetTy visitMallocInst(MallocInst &I) { DELEGATE(AllocationInst);} RetTy visitAllocaInst(AllocaInst &I) { DELEGATE(AllocationInst);} RetTy visitFreeInst(FreeInst &I) { DELEGATE(Instruction); } diff --git a/include/llvm/Support/NoFolder.h b/include/llvm/Support/NoFolder.h index a49cf84240..40c1996c31 100644 --- a/include/llvm/Support/NoFolder.h +++ b/include/llvm/Support/NoFolder.h @@ -143,12 +143,6 @@ public: Value *CreateFCmp(CmpInst::Predicate P, Constant *LHS, Constant *RHS) const { return new FCmpInst(P, LHS, RHS); } - Value *CreateVICmp(CmpInst::Predicate P, Constant *LHS, Constant *RHS) const { - return new VICmpInst(P, LHS, RHS); - } - Value *CreateVFCmp(CmpInst::Predicate P, Constant *LHS, Constant *RHS) const { - return new VFCmpInst(P, LHS, RHS); - } //===--------------------------------------------------------------------===// // Other Instructions diff --git a/include/llvm/Support/TargetFolder.h b/include/llvm/Support/TargetFolder.h index a1b63aab84..db2a31a7d2 100644 --- a/include/llvm/Support/TargetFolder.h +++ b/include/llvm/Support/TargetFolder.h @@ -179,14 +179,6 @@ public: Constant *RHS) const { return Fold(ConstantExpr::getCompare(P, LHS, RHS)); } - Constant *CreateVICmp(CmpInst::Predicate P, Constant *LHS, - Constant *RHS) const { - return Fold(ConstantExpr::getCompare(P, LHS, RHS)); - } - Constant *CreateVFCmp(CmpInst::Predicate P, Constant *LHS, - Constant *RHS) const { - return Fold(ConstantExpr::getCompare(P, LHS, RHS)); - } //===--------------------------------------------------------------------===// // Other Instructions diff --git a/lib/Analysis/ConstantFolding.cpp b/lib/Analysis/ConstantFolding.cpp index 7ebfec3dff..ffdc52ce74 100644 --- a/lib/Analysis/ConstantFolding.cpp +++ b/lib/Analysis/ConstantFolding.cpp @@ -365,8 +365,6 @@ Constant *llvm::ConstantFoldInstOperands(unsigned Opcode, const Type *DestTy, return 0; case Instruction::ICmp: case Instruction::FCmp: - case Instruction::VICmp: - case Instruction::VFCmp: assert(0 &&"This function is invalid for compares: no predicate specified"); case Instruction::PtrToInt: // If the input is a inttoptr, eliminate the pair. This requires knowing diff --git a/lib/AsmParser/LLLexer.cpp b/lib/AsmParser/LLLexer.cpp index cab94174de..10e5a60ec9 100644 --- a/lib/AsmParser/LLLexer.cpp +++ b/lib/AsmParser/LLLexer.cpp @@ -591,7 +591,6 @@ lltok::Kind LLLexer::LexIdentifier() { INSTKEYWORD(shl, Shl); INSTKEYWORD(lshr, LShr); INSTKEYWORD(ashr, AShr); INSTKEYWORD(and, And); INSTKEYWORD(or, Or); INSTKEYWORD(xor, Xor); INSTKEYWORD(icmp, ICmp); INSTKEYWORD(fcmp, FCmp); - INSTKEYWORD(vicmp, VICmp); INSTKEYWORD(vfcmp, VFCmp); INSTKEYWORD(phi, PHI); INSTKEYWORD(call, Call); diff --git a/lib/AsmParser/LLParser.cpp b/lib/AsmParser/LLParser.cpp index 49509d5224..8c30ab5a70 100644 --- a/lib/AsmParser/LLParser.cpp +++ b/lib/AsmParser/LLParser.cpp @@ -1847,9 +1847,7 @@ bool LLParser::ParseValID(ValID &ID) { return false; } case lltok::kw_icmp: - case lltok::kw_fcmp: - case lltok::kw_vicmp: - case lltok::kw_vfcmp: { + case lltok::kw_fcmp: { unsigned PredVal, Opc = Lex.getUIntVal(); Constant *Val0, *Val1; Lex.Lex(); @@ -1870,23 +1868,12 @@ bool LLParser::ParseValID(ValID &ID) { if (!Val0->getType()->isFPOrFPVector()) return Error(ID.Loc, "fcmp requires floating point operands"); ID.ConstantVal = Context.getConstantExprFCmp(Pred, Val0, Val1); - } else if (Opc == Instruction::ICmp) { + } else { + assert(Opc == Instruction::ICmp && "Unexpected opcode for CmpInst!"); if (!Val0->getType()->isIntOrIntVector() && !isa<PointerType>(Val0->getType())) return Error(ID.Loc, "icmp requires pointer or integer operands"); ID.ConstantVal = Context.getConstantExprICmp(Pred, Val0, Val1); - } else if (Opc == Instruction::VFCmp) { - // FIXME: REMOVE VFCMP Support - if (!Val0->getType()->isFPOrFPVector() || - !isa<VectorType>(Val0->getType())) - return Error(ID.Loc, "vfcmp requires vector floating point operands"); - ID.ConstantVal = Context.getConstantExprVFCmp(Pred, Val0, Val1); - } else if (Opc == Instruction::VICmp) { - // FIXME: REMOVE VICMP Support - if (!Val0->getType()->isIntOrIntVector() || - !isa<VectorType>(Val0->getType())) - return Error(ID.Loc, "vicmp requires vector floating point operands"); - ID.ConstantVal = Context.getConstantExprVICmp(Pred, Val0, Val1); } ID.Kind = ValID::t_Constant; return false; @@ -2485,9 +2472,7 @@ bool LLParser::ParseInstruction(Instruction *&Inst, BasicBlock *BB, case lltok::kw_or: case lltok::kw_xor: return ParseLogical(Inst, PFS, KeywordVal); case lltok::kw_icmp: - case lltok::kw_fcmp: - case lltok::kw_vicmp: - case lltok::kw_vfcmp: return ParseCompare(Inst, PFS, KeywordVal); + case lltok::kw_fcmp: return ParseCompare(Inst, PFS, KeywordVal); // Casts. case lltok::kw_trunc: case lltok::kw_zext: @@ -2532,8 +2517,7 @@ bool LLParser::ParseInstruction(Instruction *&Inst, BasicBlock *BB, /// ParseCmpPredicate - Parse an integer or fp predicate, based on Kind. bool LLParser::ParseCmpPredicate(unsigned &P, unsigned Opc) { - // FIXME: REMOVE vicmp/vfcmp! - if (Opc == Instruction::FCmp || Opc == Instruction::VFCmp) { + if (Opc == Instruction::FCmp) { switch (Lex.getKind()) { default: TokError("expected fcmp predicate (e.g. 'oeq')"); case lltok::kw_oeq: P = CmpInst::FCMP_OEQ; break; @@ -2862,8 +2846,6 @@ bool LLParser::ParseLogical(Instruction *&Inst, PerFunctionState &PFS, /// ParseCompare /// ::= 'icmp' IPredicates TypeAndValue ',' Value /// ::= 'fcmp' FPredicates TypeAndValue ',' Value -/// ::= 'vicmp' IPredicates TypeAndValue ',' Value -/// ::= 'vfcmp' FPredicates TypeAndValue ',' Value bool LLParser::ParseCompare(Instruction *&Inst, PerFunctionState &PFS, unsigned Opc) { // Parse the integer/fp comparison predicate. @@ -2880,19 +2862,12 @@ bool LLParser::ParseCompare(Instruction *&Inst, PerFunctionState &PFS, if (!LHS->getType()->isFPOrFPVector()) return Error(Loc, "fcmp requires floating point operands"); Inst = new FCmpInst(CmpInst::Predicate(Pred), LHS, RHS); - } else if (Opc == Instruction::ICmp) { + } else { + assert(Opc == Instruction::ICmp && "Unknown opcode for CmpInst!"); if (!LHS->getType()->isIntOrIntVector() && !isa<PointerType>(LHS->getTy |