15 #ifndef LLVM_CODEGEN_GLOBALISEL_UTILS_H 16 #define LLVM_CODEGEN_GLOBALISEL_UTILS_H 23 class MachineFunction;
26 class MachineOptimizationRemarkEmitter;
27 class MachineOptimizationRemarkMissed;
28 class MachineRegisterInfo;
31 class TargetInstrInfo;
32 class TargetPassConfig;
33 class TargetRegisterInfo;
34 class TargetRegisterClass;
45 const TargetInstrInfo &
TII,
47 MachineInstr &InsertPt,
unsigned Reg,
48 const TargetRegisterClass &RegClass);
58 const TargetRegisterInfo &
TRI,
59 MachineRegisterInfo &
MRI,
60 const TargetInstrInfo &
TII,
62 MachineInstr &InsertPt,
const MCInstrDesc &II,
63 const MachineOperand &RegMO,
unsigned OpIdx);
75 const TargetInstrInfo &
TII,
76 const TargetRegisterInfo &
TRI,
85 MachineOptimizationRemarkEmitter &
MORE,
86 MachineOptimizationRemarkMissed &
R);
89 MachineOptimizationRemarkEmitter &
MORE,
90 const char *PassName, StringRef Msg,
91 const MachineInstr &
MI);
94 const MachineRegisterInfo &
MRI);
96 const MachineRegisterInfo &
MRI);
102 const MachineRegisterInfo &
MRI);
113 const MachineRegisterInfo &
MRI);
This class represents lattice values for constants.
void getSelectionDAGFallbackAnalysisUsage(AnalysisUsage &AU)
Modify analysis usage so it preserves passes required for the SelectionDAG fallback.
const ConstantFP * getConstantFPVRegVal(unsigned VReg, const MachineRegisterInfo &MRI)
unsigned const TargetRegisterInfo * TRI
const HexagonInstrInfo * TII
Optional< APInt > ConstantFoldBinOp(unsigned Opcode, const unsigned Op1, const unsigned Op2, const MachineRegisterInfo &MRI)
APFloat getAPFloatFromSize(double Val, unsigned Size)
Returns an APFloat from Val converted to the appropriate size.
MachineInstr * getOpcodeDef(unsigned Opcode, unsigned Reg, const MachineRegisterInfo &MRI)
See if Reg is defined by an single def instruction that is Opcode.
unsigned const MachineRegisterInfo * MRI
unsigned constrainRegToClass(MachineRegisterInfo &MRI, const TargetInstrInfo &TII, const RegisterBankInfo &RBI, MachineInstr &InsertPt, unsigned Reg, const TargetRegisterClass &RegClass)
Try to constrain Reg to the specified register class.
bool constrainSelectedInstRegOperands(MachineInstr &I, const TargetInstrInfo &TII, const TargetRegisterInfo &TRI, const RegisterBankInfo &RBI)
Mutate the newly-selected instruction I to constrain its (possibly generic) virtual register operands...
RegisterBankInfo(RegisterBank **RegBanks, unsigned NumRegBanks)
Create a RegisterBankInfo that can accommodate up to NumRegBanks RegisterBank instances.
Optional< int64_t > getConstantVRegVal(unsigned VReg, const MachineRegisterInfo &MRI)
bool isTriviallyDead(const MachineInstr &MI, const MachineRegisterInfo &MRI)
Check whether an instruction MI is dead: it only defines dead virtual registers, and doesn't have oth...
unsigned constrainOperandRegClass(const MachineFunction &MF, const TargetRegisterInfo &TRI, MachineRegisterInfo &MRI, const TargetInstrInfo &TII, const RegisterBankInfo &RBI, MachineInstr &InsertPt, const MCInstrDesc &II, const MachineOperand &RegMO, unsigned OpIdx)
Try to constrain Reg so that it is usable by argument OpIdx of the provided MCInstrDesc II...
void reportGISelFailure(MachineFunction &MF, const TargetPassConfig &TPC, MachineOptimizationRemarkEmitter &MORE, MachineOptimizationRemarkMissed &R)
Report an ISel error as a missed optimization remark to the LLVMContext's diagnostic stream...