25#define DEBUG_TYPE "gi-combiner"
29bool CombinerHelper::constantFoldICmp(
const GICmp &ICmp,
54 B.buildConstant(Dst, 0);
60bool CombinerHelper::constantFoldFCmp(
const GFCmp &FCmp,
85 B.buildConstant(Dst, 0);
93 const GICmp *Cmp = cast<GICmp>(&
MI);
103 return constantFoldICmp(*Cmp, *CLHS, *CRHS, MatchInfo);
118 const GFCmp *Cmp = cast<GFCmp>(&
MI);
129 return constantFoldFCmp(*Cmp, *CLHS, *CRHS, MatchInfo);
136 B.buildFCmp(Pred, Dst,
LHS,
RHS, Cmp->getFlags());
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
This contains common combine transformations that may be used in a combine pass,or by the target else...
Declares convenience wrapper classes for interpreting MachineInstr instances as specific generic oper...
Interface for Targets to specify which operations they can successfully select and how the others sho...
This file declares the MachineIRBuilder class.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Class for arbitrary precision integers.
Predicate
This enumeration lists the possible predicates for CmpInst subclasses.
Predicate getSwappedPredicate() const
For example, EQ->EQ, SLE->SGE, ULT->UGT, OEQ->OEQ, ULE->UGE, OLT->OGT, etc.
bool isFPPredicate() const
bool isIntPredicate() const
const TargetLowering & getTargetLowering() const
bool matchCanonicalizeFCmp(const MachineInstr &MI, BuildFnTy &MatchInfo) const
bool isConstantLegalOrBeforeLegalizer(const LLT Ty) const
MachineRegisterInfo & MRI
bool matchCanonicalizeICmp(const MachineInstr &MI, BuildFnTy &MatchInfo) const
static bool compare(const APFloat &LHS, const APFloat &RHS, FCmpInst::Predicate Pred)
Return result of LHS Pred RHS comparison.
CmpInst::Predicate getCond() const
An floating-point-like constant.
static std::optional< GFConstant > getConstant(Register Const, const MachineRegisterInfo &MRI)
GFConstantKind getKind() const
Returns the kind of of this constant, e.g, Scalar.
APFloat getScalarValue() const
Returns the value, if this constant is a scalar.
An integer-like constant.
APInt getScalarValue() const
Returns the value, if this constant is a scalar.
static std::optional< GIConstant > getConstant(Register Const, const MachineRegisterInfo &MRI)
GIConstantKind getKind() const
Returns the kind of of this constant, e.g, Scalar.
Register getReg(unsigned Idx) const
Access the Idx'th operand as a register and return it.
static bool compare(const APInt &LHS, const APInt &RHS, ICmpInst::Predicate Pred)
Return result of LHS Pred RHS comparison.
constexpr bool isVector() const
Helper class to build MachineInstr.
Representation of each machine instruction.
LLT getType(Register Reg) const
Get the low-level type of Reg or LLT{} if Reg is not a generic (target independent) virtual register.
Wrapper class representing virtual and physical registers.
This is an optimization pass for GlobalISel generic memory operations.
std::function< void(MachineIRBuilder &)> BuildFnTy
int64_t getICmpTrueVal(const TargetLowering &TLI, bool IsVector, bool IsFP)
Returns an integer representing true, as defined by the TargetBooleanContents.
void swap(llvm::BitVector &LHS, llvm::BitVector &RHS)
Implement std::swap in terms of BitVector swap.