Changeset View
Changeset View
Standalone View
Standalone View
llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h
Show First 20 Lines • Show All 400 Lines • ▼ Show 20 Lines | public: | ||||
bool matchCombineFAbsOfFNeg(MachineInstr &MI, BuildFnTy &MatchInfo); | bool matchCombineFAbsOfFNeg(MachineInstr &MI, BuildFnTy &MatchInfo); | ||||
/// Transform trunc ([asz]ext x) to x or ([asz]ext x) or (trunc x). | /// Transform trunc ([asz]ext x) to x or ([asz]ext x) or (trunc x). | ||||
bool matchCombineTruncOfExt(MachineInstr &MI, | bool matchCombineTruncOfExt(MachineInstr &MI, | ||||
std::pair<Register, unsigned> &MatchInfo); | std::pair<Register, unsigned> &MatchInfo); | ||||
void applyCombineTruncOfExt(MachineInstr &MI, | void applyCombineTruncOfExt(MachineInstr &MI, | ||||
std::pair<Register, unsigned> &MatchInfo); | std::pair<Register, unsigned> &MatchInfo); | ||||
/// Transform trunc (shl x, K) to shl (trunc x), | /// Transform trunc (shl x, K) to shl (trunc x), K | ||||
/// K => K < VT.getScalarSizeInBits(). | /// if K < VT.getScalarSizeInBits(). | ||||
bool matchCombineTruncOfShl(MachineInstr &MI, | /// | ||||
std::pair<Register, Register> &MatchInfo); | /// Transforms trunc ([al]shr x, K) to (trunc ([al]shr (MidVT (trunc x)), K)) | ||||
void applyCombineTruncOfShl(MachineInstr &MI, | /// if K <= (MidVT.getScalarSizeInBits() - VT.getScalarSizeInBits()) | ||||
std::pair<Register, Register> &MatchInfo); | /// MidVT is obtained by finding a legal type between the trunc's src and dst | ||||
foad: Interesting - this seems like an abuse of getPreferredShiftAmountTy, but I guess it works out… | |||||
This is definitely not what getPreferredShiftAmountTy is for, which is only supposed to help produce already legal shift RHS operands arsenm: This is definitely not what getPreferredShiftAmountTy is for, which is only supposed to help… | |||||
/// types. | |||||
bool matchCombineTruncOfShift(MachineInstr &MI, | |||||
std::pair<MachineInstr *, LLT> &MatchInfo); | |||||
void applyCombineTruncOfShift(MachineInstr &MI, | |||||
std::pair<MachineInstr *, LLT> &MatchInfo); | |||||
/// Transform G_MUL(x, -1) to G_SUB(0, x) | /// Transform G_MUL(x, -1) to G_SUB(0, x) | ||||
void applyCombineMulByNegativeOne(MachineInstr &MI); | void applyCombineMulByNegativeOne(MachineInstr &MI); | ||||
/// Return true if any explicit use operand on \p MI is defined by a | /// Return true if any explicit use operand on \p MI is defined by a | ||||
/// G_IMPLICIT_DEF. | /// G_IMPLICIT_DEF. | ||||
bool matchAnyExplicitUseIsUndef(MachineInstr &MI); | bool matchAnyExplicitUseIsUndef(MachineInstr &MI); | ||||
▲ Show 20 Lines • Show All 456 Lines • Show Last 20 Lines |
Interesting - this seems like an abuse of getPreferredShiftAmountTy, but I guess it works out OK in practice for the one case we care about (converting 64-bit shifts to 32-bit shifts).