41 while (
I ==
MBB->end()) {
42 if (
MBB->getFallThrough() ==
nullptr)
44 MBB =
MBB->getFallThrough();
47 }
while (
I->isMetaInstruction() ||
I->isInlineAsm());
53 BuildMI(*
I->getParent(),
I,
I->getDebugLoc(),
TII->get(SP::NOP));
57 if (
I->getNumOperands() == 0)
60 if (!
I->getOperand(0).isReg())
63 unsigned reg =
I->getOperand(0).getReg();
72 switch (
I->getOpcode()) {
83 switch (
I->getOpcode()) {
100 switch (
I->getOpcode()) {
118 if (
MI->mayStore() ||
MI->mayLoad())
139 switch (
I->getOpcode()) {
171 if (
I->isBranch() &&
I->getOperand(0).isMBB()) {
175 while (
MI != TargetMBB->
end() &&
MI->isMetaInstruction())
178 if (
MI == TargetMBB->
end())
199 while (
I !=
MBB.end() &&
I->isMetaInstruction())
213 if (
I->getOpcode() != SP::BCOND &&
I->getOpcode() != SP::BCONDA)
219 while (
MI != TargetMBB->
end() &&
MI->isMetaInstruction())
222 if (
MI == TargetMBB->
end())
246 unsigned dstReg =
I->getOperand(0).getReg();
252 if (
MI->isBranch()) {
259 unsigned fpFound = 0;
260 for (
unsigned i = 0; i < 4; i++) {
268 if (
MI->readsRegister(dstReg,
TRI))
295 if (!(
ST->fixTN0009() ||
ST->fixTN0010() ||
ST->fixTN0012() ||
299 TII =
ST->getInstrInfo();
300 TRI =
ST->getRegisterInfo();
305 for (
auto &
MBB : MF) {
306 for (
auto &
I :
MBB) {
307 if (
ST->fixTN0009()) {
351 unsigned Opcode =
MI.getOpcode();
352 if (Opcode >= SP::LDDArr && Opcode <= SP::LDrr) {
386 unsigned Opcode =
MI.getOpcode();
387 if (Opcode == SP::CALL &&
MI.getNumOperands() > 0) {
393 errs() <<
"Error: You are using the detectroundchange "
394 "option to detect rounding changes that will "
395 "cause LEON errata. The only way to fix this "
396 "is to remove the call to fesetround from "
397 "the source code.\n";
440 unsigned Opcode =
MI.getOpcode();
446 if (Opcode == SP::FSQRTD || Opcode == SP::FDIVD) {
447 for (
int InsertedCount = 0; InsertedCount < 5; InsertedCount++)
451 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 isAtomic(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
MachineInstrBundleIterator< MachineInstr > iterator
MachineFunctionPass(char &ID)
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 LLVM_ABI PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
Represent a constant reference to a string, i.e.
LLVM_ABI int compare_insensitive(StringRef RHS) const
Compare two strings, ignoring case.
TargetInstrInfo - Interface to description of machine instruction set.
LLVM_ABI StringRef getName() const
Return a constant reference to the value's name.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
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 &)
LLVM_ABI raw_fd_ostream & errs()
This returns a reference to a raw_ostream for standard error.