#include "llvm/IR/InstrTypes.h"
namespace llvm {
- class ICmpInst;
class Type;
class Value;
/// 110 6 A <= B
/// 111 7 Always true
///
- unsigned getICmpCode(const ICmpInst *ICI, bool InvertPred = false);
+ unsigned getICmpCode(CmpInst::Predicate Pred);
/// This is the complement of getICmpCode. It turns a predicate code into
/// either a constant true or false or the predicate for a new ICmp.
if (LHS->getOperand(0) == RHS->getOperand(0) &&
LHS->getOperand(1) == RHS->getOperand(1)) {
Value *Op0 = LHS->getOperand(0), *Op1 = LHS->getOperand(1);
- unsigned Code = getICmpCode(LHS) & getICmpCode(RHS);
+ unsigned Code =
+ getICmpCode(LHS->getPredicate()) & getICmpCode(RHS->getPredicate());
bool IsSigned = LHS->isSigned() || RHS->isSigned();
return getNewICmpValue(Code, IsSigned, Op0, Op1, Builder);
}
if (LHS0 == RHS1 && LHS1 == RHS0)
LHS->swapOperands();
if (LHS0 == RHS0 && LHS1 == RHS1) {
- unsigned Code = getICmpCode(LHS) | getICmpCode(RHS);
+ unsigned Code =
+ getICmpCode(LHS->getPredicate()) | getICmpCode(RHS->getPredicate());
bool IsSigned = LHS->isSigned() || RHS->isSigned();
return getNewICmpValue(Code, IsSigned, LHS0, LHS1, Builder);
}
LHS->getOperand(1) == RHS->getOperand(1)) {
// (icmp1 A, B) ^ (icmp2 A, B) --> (icmp3 A, B)
Value *Op0 = LHS->getOperand(0), *Op1 = LHS->getOperand(1);
- unsigned Code = getICmpCode(LHS) ^ getICmpCode(RHS);
+ unsigned Code =
+ getICmpCode(LHS->getPredicate()) ^ getICmpCode(RHS->getPredicate());
bool IsSigned = LHS->isSigned() || RHS->isSigned();
return getNewICmpValue(Code, IsSigned, Op0, Op1, Builder);
}