47 }
while (
I->isMetaInstruction() ||
I->isInlineAsm());
57 if (
I->getNumOperands() == 0)
60 if (!
I->getOperand(0).isReg())
63 unsigned reg =
I->getOperand(0).getReg();
72 switch (
I->getOpcode()) {
87 switch (
I->getOpcode()) {
105 if (
MI->mayStore() ||
MI->mayLoad())
126 switch (
I->getOpcode()) {
162 while (
MI != TargetMBB->
end() &&
MI->isMetaInstruction())
165 if (
MI == TargetMBB->
end())
168 switch (
MI->getOpcode()) {
184 switch (
MI->getOpcode()) {
199 while (
I !=
MBB.
end() &&
I->isMetaInstruction())
201 switch (
I->getOpcode()) {
217 if (
I->getOpcode() != SP::BCOND &&
I->getOpcode() != SP::BCONDA)
223 while (
MI != TargetMBB->
end() &&
MI->isMetaInstruction())
226 if (
MI == TargetMBB->
end())
250 unsigned dstReg =
I->getOperand(0).getReg();
256 if (
MI->isBranch()) {
263 unsigned fpFound = 0;
264 for (
unsigned i = 0; i < 4; i++) {
272 if (
MI->readsRegister(dstReg,
TRI))
296 bool Changed =
false;
299 if (!(
ST->fixTN0009() ||
ST->fixTN0010() ||
ST->fixTN0012() ||
309 for (
auto &
MBB : MF) {
310 for (
auto &
I :
MBB) {
311 if (
ST->fixTN0009()) {
355 unsigned Opcode =
MI.getOpcode();
356 if (Opcode >= SP::LDDArr && Opcode <= SP::LDrr) {
390 unsigned Opcode =
MI.getOpcode();
391 if (Opcode == SP::CALL &&
MI.getNumOperands() > 0) {
397 errs() <<
"Error: You are using the detectroundchange "
398 "option to detect rounding changes that will "
399 "cause LEON errata. The only way to fix this "
400 "is to remove the call to fesetround from "
401 "the source code.\n";
444 unsigned Opcode =
MI.getOpcode();
450 if (Opcode == SP::FSQRTD || Opcode == SP::FDIVD) {
451 for (
int InsertedCount = 0; InsertedCount < 5; InsertedCount++)
455 for (
int InsertedCount = 0; InsertedCount < 28; InsertedCount++)
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
MachineBasicBlock MachineBasicBlock::iterator MBBI
const HexagonInstrInfo * TII
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
static bool contains(SmallPtrSetImpl< ConstantExpr * > &Cache, ConstantExpr *Expr, Constant *C)
bool runOnMachineFunction(MachineFunction &MF) override
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformat...
bool checkSeqTN0009A(MachineBasicBlock::iterator I)
bool checkSeqTN0013(MachineBasicBlock::iterator I)
bool checkSeqTN0010First(MachineBasicBlock &MBB)
bool moveNext(MachineBasicBlock::iterator &I)
const SparcSubtarget * ST
bool checkSeqTN0012(MachineBasicBlock::iterator I)
bool checkSeqTN0010(MachineBasicBlock::iterator I)
bool checkSeqTN0009B(MachineBasicBlock::iterator I)
const TargetInstrInfo * TII
bool isDivSqrt(MachineBasicBlock::iterator I)
bool isFloat(MachineBasicBlock::iterator I)
bool runOnMachineFunction(MachineFunction &MF) override
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformat...
const TargetRegisterInfo * TRI
void insertNop(MachineBasicBlock::iterator I)
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...
LEONMachineFunctionPass(char &ID)
const SparcSubtarget * Subtarget
const MCInstrDesc & get(unsigned Opcode) const
Return the machine instruction descriptor that corresponds to the specified instruction opcode.
MachineBasicBlock * getFallThrough(bool JumpToFallThrough=true)
Return the fallthrough block if the block can implicitly transfer control to the block after it by fa...
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
const MachineBasicBlock & front() const
Representation of each machine instruction.
MachineOperand class - Representation of each machine instruction operand.
const GlobalValue * getGlobal() const
bool isGlobal() const
isGlobal - Tests if this is a MO_GlobalAddress operand.
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
const SparcRegisterInfo * getRegisterInfo() const override
const SparcInstrInfo * getInstrInfo() const override
StringRef - Represent a constant reference to a string, i.e.
int compare_insensitive(StringRef RHS) const
Compare two strings, ignoring case.
TargetInstrInfo - Interface to description of machine instruction set.
StringRef getName() const
Return a constant reference to the value's name.
This is an optimization pass for GlobalISel generic memory operations.
MachineInstrBuilder BuildMI(MachineFunction &MF, const MIMetadata &MIMD, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
void initializeErrataWorkaroundPass(PassRegistry &)
raw_fd_ostream & errs()
This returns a reference to a raw_ostream for standard error.