llvm.org GIT mirror llvm / 3208bb2
[IR] Use CmpInst::isFPPredicate/isIntPredicate in a few other places. NFC git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307224 91177308-0d34-0410-b5e6-96231b3b80d8 Craig Topper 2 years ago
2 changed file(s) with 6 addition(s) and 7 deletion(s). Raw diff Collapse all Expand all
19131913 Constant *ConstantExpr::getICmp(unsigned short pred, Constant *LHS,
19141914 Constant *RHS, bool OnlyIfReduced) {
19151915 assert(LHS->getType() == RHS->getType());
1916 assert(pred >= ICmpInst::FIRST_ICMP_PREDICATE &&
1917 pred <= ICmpInst::LAST_ICMP_PREDICATE && "Invalid ICmp Predicate");
1916 assert(CmpInst::isIntPredicate((CmpInst::Predicate)pred) &&
1917 "Invalid ICmp Predicate");
19181918
19191919 if (Constant *FC = ConstantFoldCompareInstruction(pred, LHS, RHS))
19201920 return FC; // Fold a few common cases...
19381938 Constant *ConstantExpr::getFCmp(unsigned short pred, Constant *LHS,
19391939 Constant *RHS, bool OnlyIfReduced) {
19401940 assert(LHS->getType() == RHS->getType());
1941 assert(pred <= FCmpInst::LAST_FCMP_PREDICATE && "Invalid FCmp Predicate");
1941 assert(CmpInst::isFPPredicate((CmpInst::Predicate)pred) &&
1942 "Invalid FCmp Predicate");
19421943
19431944 if (Constant *FC = ConstantFoldCompareInstruction(pred, LHS, RHS))
19441945 return FC; // Fold a few common cases...
29542954 Assert(Op0Ty->isIntOrIntVectorTy() || Op0Ty->getScalarType()->isPointerTy(),
29552955 "Invalid operand types for ICmp instruction", &IC);
29562956 // Check that the predicate is valid.
2957 Assert(IC.getPredicate() >= CmpInst::FIRST_ICMP_PREDICATE &&
2958 IC.getPredicate() <= CmpInst::LAST_ICMP_PREDICATE,
2957 Assert(IC.isIntPredicate(),
29592958 "Invalid predicate in ICmp instruction!", &IC);
29602959
29612960 visitInstruction(IC);
29712970 Assert(Op0Ty->isFPOrFPVectorTy(),
29722971 "Invalid operand types for FCmp instruction", &FC);
29732972 // Check that the predicate is valid.
2974 Assert(FC.getPredicate() >= CmpInst::FIRST_FCMP_PREDICATE &&
2975 FC.getPredicate() <= CmpInst::LAST_FCMP_PREDICATE,
2973 Assert(FC.isFPPredicate(),
29762974 "Invalid predicate in FCmp instruction!", &FC);
29772975
29782976 visitInstruction(FC);