Please use GitHub pull requests for new patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h
Show First 20 Lines • Show All 67 Lines • ▼ Show 20 Lines | |||||
struct ShiftOfShiftedLogic { | struct ShiftOfShiftedLogic { | ||||
MachineInstr *Logic; | MachineInstr *Logic; | ||||
MachineInstr *Shift2; | MachineInstr *Shift2; | ||||
Register LogicNonShiftReg; | Register LogicNonShiftReg; | ||||
uint64_t ValSum; | uint64_t ValSum; | ||||
}; | }; | ||||
using BuildFnTy = std::function<void(MachineIRBuilder &)>; | using BuildFnTy = std::function<void(MachineIRBuilder &)>; | ||||
struct MergeTruncStoresInfo { | |||||
SmallVector<GStore *> FoundStores; | |||||
GStore *LowestIdxStore = nullptr; | |||||
Register WideSrcVal; | |||||
arsenm: Reverse the order of the fields? | |||||
Why? aemerson: Why? | |||||
Not Done ReplyInline ActionsThey're currently ordered to maximize padding. I also don't think the NeedBSwap and NeedRotate would be the most important fields (also they should get default initializers) arsenm: They're currently ordered to maximize padding. I also don't think the NeedBSwap and NeedRotate… | |||||
bool NeedBSwap = false; | |||||
bool NeedRotate = false; | |||||
}; | |||||
Not Done ReplyInline ActionsLooks like this part isn't used in the change? paquette: Looks like this part isn't used in the change? | |||||
Yeah I initially used it but then changed it later. I'll commit this as a separate NFC change. aemerson: Yeah I initially used it but then changed it later. I'll commit this as a separate NFC change. | |||||
using OperandBuildSteps = | using OperandBuildSteps = | ||||
SmallVector<std::function<void(MachineInstrBuilder &)>, 4>; | SmallVector<std::function<void(MachineInstrBuilder &)>, 4>; | ||||
struct InstructionBuildSteps { | struct InstructionBuildSteps { | ||||
unsigned Opcode = 0; /// The opcode for the produced instruction. | unsigned Opcode = 0; /// The opcode for the produced instruction. | ||||
OperandBuildSteps OperandFns; /// Operands to be added to the instruction. | OperandBuildSteps OperandFns; /// Operands to be added to the instruction. | ||||
InstructionBuildSteps() = default; | InstructionBuildSteps() = default; | ||||
InstructionBuildSteps(unsigned Opcode, const OperandBuildSteps &OperandFns) | InstructionBuildSteps(unsigned Opcode, const OperandBuildSteps &OperandFns) | ||||
: Opcode(Opcode), OperandFns(OperandFns) {} | : Opcode(Opcode), OperandFns(OperandFns) {} | ||||
▲ Show 20 Lines • Show All 433 Lines • ▼ Show 20 Lines | public: | ||||
/// sN *a = ... | /// sN *a = ... | ||||
/// sM val = a[0] | (a[1] << N) | (a[2] << 2N) | (a[3] << 3N) ... | /// sM val = a[0] | (a[1] << N) | (a[2] << 2N) | (a[3] << 3N) ... | ||||
/// \endcode | /// \endcode | ||||
/// | /// | ||||
/// And check if the tree can be replaced with a M-bit load + possibly a | /// And check if the tree can be replaced with a M-bit load + possibly a | ||||
/// bswap. | /// bswap. | ||||
bool matchLoadOrCombine(MachineInstr &MI, BuildFnTy &MatchInfo); | bool matchLoadOrCombine(MachineInstr &MI, BuildFnTy &MatchInfo); | ||||
bool matchTruncStoreMerge(MachineInstr &MI, MergeTruncStoresInfo &MatchInfo); | |||||
void applyTruncStoreMerge(MachineInstr &MI, MergeTruncStoresInfo &MatchInfo); | |||||
bool matchExtendThroughPhis(MachineInstr &MI, MachineInstr *&ExtMI); | bool matchExtendThroughPhis(MachineInstr &MI, MachineInstr *&ExtMI); | ||||
void applyExtendThroughPhis(MachineInstr &MI, MachineInstr *&ExtMI); | void applyExtendThroughPhis(MachineInstr &MI, MachineInstr *&ExtMI); | ||||
bool matchExtractVecEltBuildVec(MachineInstr &MI, Register &Reg); | bool matchExtractVecEltBuildVec(MachineInstr &MI, Register &Reg); | ||||
void applyExtractVecEltBuildVec(MachineInstr &MI, Register &Reg); | void applyExtractVecEltBuildVec(MachineInstr &MI, Register &Reg); | ||||
bool matchExtractAllEltsFromBuildVector( | bool matchExtractAllEltsFromBuildVector( | ||||
MachineInstr &MI, | MachineInstr &MI, | ||||
▲ Show 20 Lines • Show All 105 Lines • Show Last 20 Lines |
Reverse the order of the fields?