40 static int NotFoundIndex = -10;
50 for (
int RegisterIndex = SP::F0; RegisterIndex <= SP::F31; ++RegisterIndex) {
79 bool Modified =
false;
80 for (
auto MFI = MF.
begin(),
E = MF.
end(); MFI !=
E; ++MFI) {
82 for (
auto MBBI = MBB.
begin(),
E = MBB.
end(); MBBI !=
E; ++MBBI) {
85 if (Opcode >= SP::LDDArr && Opcode <= SP::LDrr) {
120 bool Modified =
false;
121 for (
auto MFI = MF.
begin(),
E = MF.
end(); MFI !=
E; ++MFI) {
123 for (
auto MBBI = MBB.
begin(),
E = MBB.
end(); MBBI !=
E; ++MBBI) {
128 const int UNASSIGNED_INDEX = -1;
129 int Reg1Index = UNASSIGNED_INDEX;
130 int Reg2Index = UNASSIGNED_INDEX;
131 int Reg3Index = UNASSIGNED_INDEX;
140 if (Reg1Index != UNASSIGNED_INDEX && Reg2Index != UNASSIGNED_INDEX &&
141 Reg3Index != UNASSIGNED_INDEX) {
151 if (ScratchReg1Index == UNASSIGNED_INDEX ||
152 ScratchReg2Index == UNASSIGNED_INDEX) {
153 errs() <<
"Cannot allocate free scratch registers for the FixFSMULD "
159 .addReg(ScratchReg1Index)
164 .addReg(ScratchReg2Index)
171 .
addReg(ScratchReg2Index);
209 bool Modified =
false;
210 for (
auto MFI = MF.
begin(),
E = MF.
end(); MFI !=
E; ++MFI) {
212 for (
auto MBBI = MBB.
begin(),
E = MBB.
end(); MBBI !=
E; ++MBBI) {
216 const int UNASSIGNED_INDEX = -1;
217 int Reg1Index = UNASSIGNED_INDEX;
218 int Reg2Index = UNASSIGNED_INDEX;
219 int Reg3Index = UNASSIGNED_INDEX;
228 if (Reg1Index != UNASSIGNED_INDEX && Reg2Index != UNASSIGNED_INDEX &&
229 Reg3Index != UNASSIGNED_INDEX) {
239 if (ScratchReg1Index == UNASSIGNED_INDEX ||
240 ScratchReg2Index == UNASSIGNED_INDEX) {
241 errs() <<
"Cannot allocate free scratch registers for the "
247 .addReg(ScratchReg1Index)
252 .addReg(ScratchReg2Index)
259 .
addReg(ScratchReg2Index);
290 bool Modified =
false;
291 for (
auto MFI = MF.
begin(),
E = MF.
end(); MFI !=
E; ++MFI) {
293 for (
auto MBBI = MBB.
begin(),
E = MBB.
end(); MBBI !=
E; ++MBBI) {
302 errs() <<
"Error: You are using the detectroundchange "
303 "option to detect rounding changes that will "
304 "cause LEON errata. The only way to fix this "
305 "is to remove the call to fesetround from "
306 "the source code.\n";
342 bool Modified =
false;
343 for (
auto MFI = MF.
begin(),
E = MF.
end(); MFI !=
E; ++MFI) {
345 for (
auto MBBI = MBB.
begin(),
E = MBB.
end(); MBBI !=
E; ++MBBI) {
353 if (Opcode == SP::FSQRTD || Opcode == SP::FDIVD) {
354 for (
int InsertedCount = 0; InsertedCount < 5; InsertedCount++)
358 for (
int InsertedCount = 0; InsertedCount < 28; InsertedCount++)
LLVM_NODISCARD int compare_lower(StringRef RHS) const
compare_lower - Compare two strings, ignoring case.
raw_ostream & errs()
This returns a reference to a raw_ostream for standard error.
const GlobalValue * getGlobal() const
const SparcInstrInfo * getInstrInfo() const override
StringRef getName() const
Return a constant reference to the value's name.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
bool isPhysRegUsed(unsigned PhysReg) const
Return true if the specified register is modified or read in this function.
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
DILocation * get() const
Get the underlying DILocation.
const HexagonInstrInfo * TII
bool isReg() const
isReg - Tests if this is a MO_Register operand.
void eraseFromParent()
Unlink 'this' from the containing basic block and delete it.
bool runOnMachineFunction(MachineFunction &MF) override
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformat...
unsigned getNumOperands() const
Access to explicit operands of the instruction.
bool isGlobal() const
isGlobal - Tests if this is a MO_GlobalAddress operand.
void clearUsedRegisterList()
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
TargetInstrInfo - Interface to description of machine instruction set.
const SparcSubtarget * Subtarget
MachineInstrBuilder BuildMI(MachineFunction &MF, const DebugLoc &DL, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
int GetRegIndexForOperand(MachineInstr &MI, int OperandIndex)
unsigned const MachineRegisterInfo * MRI
bool runOnMachineFunction(MachineFunction &MF) override
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformat...
const MachineOperand & getOperand(unsigned i) const
int getUnusedFPRegister(MachineRegisterInfo &MRI)
bool runOnMachineFunction(MachineFunction &MF) override
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformat...
void markRegisterUsed(int registerIndex)
MachineOperand class - Representation of each machine instruction operand.
LEONMachineFunctionPass(char &ID)
MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.
Representation of each machine instruction.
bool runOnMachineFunction(MachineFunction &MF) override
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformat...
bool runOnMachineFunction(MachineFunction &MF) override
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformat...
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
std::vector< int > UsedRegisters
unsigned getReg() const
getReg - Returns the register number.
StringRef - Represent a constant reference to a string, i.e.
const MachineInstrBuilder & addReg(unsigned RegNo, unsigned flags=0, unsigned SubReg=0) const
Add a new virtual register operand.
bool is_contained(R &&Range, const E &Element)
Wrapper function around std::find to detect if an element exists in a container.