diff options
author | Craig Topper <craig.topper@intel.com> | 2017-07-05 23:35:46 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@intel.com> | 2017-07-05 23:35:46 +0000 |
commit | 4584476caccc9ee20cdeeccdb1e37239de48b18e (patch) | |
tree | 6ccac03320ffa0cd055f58baf7a7810d90cecc45 /llvm/lib/IR/Constants.cpp | |
parent | a4c15c13390e8f3eade38a348df9239ed4db0688 (diff) | |
download | bcm5719-llvm-4584476caccc9ee20cdeeccdb1e37239de48b18e.tar.gz bcm5719-llvm-4584476caccc9ee20cdeeccdb1e37239de48b18e.zip |
[IR] Use CmpInst::isFPPredicate/isIntPredicate in a few other places. NFC
llvm-svn: 307224
Diffstat (limited to 'llvm/lib/IR/Constants.cpp')
-rw-r--r-- | llvm/lib/IR/Constants.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/IR/Constants.cpp b/llvm/lib/IR/Constants.cpp index d387a6f0ecb..413d391d951 100644 --- a/llvm/lib/IR/Constants.cpp +++ b/llvm/lib/IR/Constants.cpp @@ -1914,8 +1914,8 @@ Constant *ConstantExpr::getGetElementPtr(Type *Ty, Constant *C, Constant *ConstantExpr::getICmp(unsigned short pred, Constant *LHS, Constant *RHS, bool OnlyIfReduced) { assert(LHS->getType() == RHS->getType()); - assert(pred >= ICmpInst::FIRST_ICMP_PREDICATE && - pred <= ICmpInst::LAST_ICMP_PREDICATE && "Invalid ICmp Predicate"); + assert(CmpInst::isIntPredicate((CmpInst::Predicate)pred) && + "Invalid ICmp Predicate"); if (Constant *FC = ConstantFoldCompareInstruction(pred, LHS, RHS)) return FC; // Fold a few common cases... @@ -1939,7 +1939,8 @@ Constant *ConstantExpr::getICmp(unsigned short pred, Constant *LHS, Constant *ConstantExpr::getFCmp(unsigned short pred, Constant *LHS, Constant *RHS, bool OnlyIfReduced) { assert(LHS->getType() == RHS->getType()); - assert(pred <= FCmpInst::LAST_FCMP_PREDICATE && "Invalid FCmp Predicate"); + assert(CmpInst::isFPPredicate((CmpInst::Predicate)pred) && + "Invalid FCmp Predicate"); if (Constant *FC = ConstantFoldCompareInstruction(pred, LHS, RHS)) return FC; // Fold a few common cases... |