#ifndef LLVM_ANALYSIS_CMPINSTANALYSIS_H
#define LLVM_ANALYSIS_CMPINSTANALYSIS_H
#include "llvm/IR/InstrTypes.h"
namespace llvm {
class Type;
class Value;
unsigned getICmpCode(CmpInst::Predicate Pred);
Constant *getPredForICmpCode(unsigned Code, bool Sign, Type *OpTy,
CmpInst::Predicate &Pred);
bool predicatesFoldable(CmpInst::Predicate P1, CmpInst::Predicate P2);
inline unsigned getFCmpCode(CmpInst::Predicate CC) {
assert(CmpInst::FCMP_FALSE <= CC && CC <= CmpInst::FCMP_TRUE &&
"Unexpected FCmp predicate!");
static_assert(CmpInst::FCMP_FALSE == 0, ""); static_assert(CmpInst::FCMP_OEQ == 1, ""); static_assert(CmpInst::FCMP_OGT == 2, ""); static_assert(CmpInst::FCMP_OGE == 3, ""); static_assert(CmpInst::FCMP_OLT == 4, ""); static_assert(CmpInst::FCMP_OLE == 5, ""); static_assert(CmpInst::FCMP_ONE == 6, ""); static_assert(CmpInst::FCMP_ORD == 7, ""); static_assert(CmpInst::FCMP_UNO == 8, ""); static_assert(CmpInst::FCMP_UEQ == 9, ""); static_assert(CmpInst::FCMP_UGT == 10, ""); static_assert(CmpInst::FCMP_UGE == 11, ""); static_assert(CmpInst::FCMP_ULT == 12, ""); static_assert(CmpInst::FCMP_ULE == 13, ""); static_assert(CmpInst::FCMP_UNE == 14, ""); static_assert(CmpInst::FCMP_TRUE == 15, ""); return CC;
}
Constant *getPredForFCmpCode(unsigned Code, Type *OpTy,
CmpInst::Predicate &Pred);
bool decomposeBitTestICmp(Value *LHS, Value *RHS, CmpInst::Predicate &Pred,
Value *&X, APInt &Mask,
bool LookThroughTrunc = true);
}
#endif