forked from OSchip/llvm-project
CodeGen: Minor cleanups to use MachineInstr::getMF. NFC
Since r315388 we have a shorter way to say this, so we'll replace MI->getParent()->getParent() with MI->getMF() in a few places. llvm-svn: 315390
This commit is contained in:
parent
0bf7717a02
commit
fdf9bf4f16
|
@ -310,9 +310,8 @@ bool InstructionSelector::executeMatchTable(
|
||||||
int64_t NewOpcode = MatchTable[CurrentIdx++];
|
int64_t NewOpcode = MatchTable[CurrentIdx++];
|
||||||
assert((size_t)NewInsnID == OutMIs.size() &&
|
assert((size_t)NewInsnID == OutMIs.size() &&
|
||||||
"Expected to store MIs in order");
|
"Expected to store MIs in order");
|
||||||
OutMIs.push_back(
|
OutMIs.push_back(MachineInstrBuilder(*State.MIs[OldInsnID]->getMF(),
|
||||||
MachineInstrBuilder(*State.MIs[OldInsnID]->getParent()->getParent(),
|
State.MIs[OldInsnID]));
|
||||||
State.MIs[OldInsnID]));
|
|
||||||
OutMIs[NewInsnID]->setDesc(TII.get(NewOpcode));
|
OutMIs[NewInsnID]->setDesc(TII.get(NewOpcode));
|
||||||
DEBUG(dbgs() << CurrentIdx << ": GIR_MutateOpcode(OutMIs[" << NewInsnID
|
DEBUG(dbgs() << CurrentIdx << ": GIR_MutateOpcode(OutMIs[" << NewInsnID
|
||||||
<< "], MIs[" << OldInsnID << "], " << NewOpcode << ")\n");
|
<< "], MIs[" << OldInsnID << "], " << NewOpcode << ")\n");
|
||||||
|
|
|
@ -93,8 +93,7 @@ public:
|
||||||
/// Some constructors for easy use.
|
/// Some constructors for easy use.
|
||||||
MachineIRBuilder() = default;
|
MachineIRBuilder() = default;
|
||||||
MachineIRBuilder(MachineFunction &MF) { setMF(MF); }
|
MachineIRBuilder(MachineFunction &MF) { setMF(MF); }
|
||||||
MachineIRBuilder(MachineInstr &MI)
|
MachineIRBuilder(MachineInstr &MI) : MachineIRBuilder(*MI.getMF()) {
|
||||||
: MachineIRBuilder(*MI.getParent()->getParent()) {
|
|
||||||
setInstr(MI);
|
setInstr(MI);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -744,7 +744,7 @@ void AsmPrinter::EmitFunctionEntryLabel() {
|
||||||
/// emitComments - Pretty-print comments for instructions.
|
/// emitComments - Pretty-print comments for instructions.
|
||||||
static void emitComments(const MachineInstr &MI, raw_ostream &CommentOS,
|
static void emitComments(const MachineInstr &MI, raw_ostream &CommentOS,
|
||||||
AsmPrinter *AP) {
|
AsmPrinter *AP) {
|
||||||
const MachineFunction *MF = MI.getParent()->getParent();
|
const MachineFunction *MF = MI.getMF();
|
||||||
const TargetInstrInfo *TII = MF->getSubtarget().getInstrInfo();
|
const TargetInstrInfo *TII = MF->getSubtarget().getInstrInfo();
|
||||||
|
|
||||||
// Check for spills and reloads
|
// Check for spills and reloads
|
||||||
|
@ -2846,7 +2846,7 @@ void AsmPrinter::emitXRayTable() {
|
||||||
|
|
||||||
void AsmPrinter::recordSled(MCSymbol *Sled, const MachineInstr &MI,
|
void AsmPrinter::recordSled(MCSymbol *Sled, const MachineInstr &MI,
|
||||||
SledKind Kind, uint8_t Version) {
|
SledKind Kind, uint8_t Version) {
|
||||||
auto Fn = MI.getParent()->getParent()->getFunction();
|
auto Fn = MI.getMF()->getFunction();
|
||||||
auto Attr = Fn->getFnAttribute("function-instrument");
|
auto Attr = Fn->getFnAttribute("function-instrument");
|
||||||
bool LogArgs = Fn->hasFnAttribute("xray-log-args");
|
bool LogArgs = Fn->hasFnAttribute("xray-log-args");
|
||||||
bool AlwaysInstrument =
|
bool AlwaysInstrument =
|
||||||
|
|
|
@ -1148,7 +1148,7 @@ void DwarfDebug::beginInstruction(const MachineInstr *MI) {
|
||||||
DebugHandlerBase::beginInstruction(MI);
|
DebugHandlerBase::beginInstruction(MI);
|
||||||
assert(CurMI);
|
assert(CurMI);
|
||||||
|
|
||||||
const auto *SP = MI->getParent()->getParent()->getFunction()->getSubprogram();
|
const auto *SP = MI->getMF()->getFunction()->getSubprogram();
|
||||||
if (!SP || SP->getUnit()->getEmissionKind() == DICompileUnit::NoDebug)
|
if (!SP || SP->getUnit()->getEmissionKind() == DICompileUnit::NoDebug)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
@ -151,7 +151,7 @@ RegisterBankInfo::getInstrMappingImpl(const MachineInstr &MI) const {
|
||||||
// is important. The rest is not constrained.
|
// is important. The rest is not constrained.
|
||||||
unsigned NumOperandsForMapping = IsCopyLike ? 1 : MI.getNumOperands();
|
unsigned NumOperandsForMapping = IsCopyLike ? 1 : MI.getNumOperands();
|
||||||
|
|
||||||
const MachineFunction &MF = *MI.getParent()->getParent();
|
const MachineFunction &MF = *MI.getMF();
|
||||||
const TargetSubtargetInfo &STI = MF.getSubtarget();
|
const TargetSubtargetInfo &STI = MF.getSubtarget();
|
||||||
const TargetRegisterInfo &TRI = *STI.getRegisterInfo();
|
const TargetRegisterInfo &TRI = *STI.getRegisterInfo();
|
||||||
const MachineRegisterInfo &MRI = MF.getRegInfo();
|
const MachineRegisterInfo &MRI = MF.getRegInfo();
|
||||||
|
@ -543,9 +543,9 @@ bool RegisterBankInfo::InstructionMapping::verify(
|
||||||
// For PHI, we only care about mapping the definition.
|
// For PHI, we only care about mapping the definition.
|
||||||
assert(NumOperands == (isCopyLike(MI) ? 1 : MI.getNumOperands()) &&
|
assert(NumOperands == (isCopyLike(MI) ? 1 : MI.getNumOperands()) &&
|
||||||
"NumOperands must match, see constructor");
|
"NumOperands must match, see constructor");
|
||||||
assert(MI.getParent() && MI.getParent()->getParent() &&
|
assert(MI.getParent() && MI.getMF() &&
|
||||||
"MI must be connected to a MachineFunction");
|
"MI must be connected to a MachineFunction");
|
||||||
const MachineFunction &MF = *MI.getParent()->getParent();
|
const MachineFunction &MF = *MI.getMF();
|
||||||
(void)MF;
|
(void)MF;
|
||||||
|
|
||||||
for (unsigned Idx = 0; Idx < NumOperands; ++Idx) {
|
for (unsigned Idx = 0; Idx < NumOperands; ++Idx) {
|
||||||
|
@ -725,8 +725,8 @@ void RegisterBankInfo::OperandsMapper::print(raw_ostream &OS,
|
||||||
// If we have a function, we can pretty print the name of the registers.
|
// If we have a function, we can pretty print the name of the registers.
|
||||||
// Otherwise we will print the raw numbers.
|
// Otherwise we will print the raw numbers.
|
||||||
const TargetRegisterInfo *TRI =
|
const TargetRegisterInfo *TRI =
|
||||||
getMI().getParent() && getMI().getParent()->getParent()
|
getMI().getParent() && getMI().getMF()
|
||||||
? getMI().getParent()->getParent()->getSubtarget().getRegisterInfo()
|
? getMI().getMF()->getSubtarget().getRegisterInfo()
|
||||||
: nullptr;
|
: nullptr;
|
||||||
bool IsFirst = true;
|
bool IsFirst = true;
|
||||||
for (unsigned Idx = 0; Idx != NumOpds; ++Idx) {
|
for (unsigned Idx = 0; Idx != NumOpds; ++Idx) {
|
||||||
|
|
|
@ -1361,8 +1361,7 @@ static void InsertUncondBranch(MachineBasicBlock &MBB, MachineBasicBlock &ToMBB,
|
||||||
/// Behaves like LiveRegUnits::StepForward() but also adds implicit uses to all
|
/// Behaves like LiveRegUnits::StepForward() but also adds implicit uses to all
|
||||||
/// values defined in MI which are also live/used by MI.
|
/// values defined in MI which are also live/used by MI.
|
||||||
static void UpdatePredRedefs(MachineInstr &MI, LivePhysRegs &Redefs) {
|
static void UpdatePredRedefs(MachineInstr &MI, LivePhysRegs &Redefs) {
|
||||||
const TargetRegisterInfo *TRI = MI.getParent()->getParent()
|
const TargetRegisterInfo *TRI = MI.getMF()->getSubtarget().getRegisterInfo();
|
||||||
->getSubtarget().getRegisterInfo();
|
|
||||||
|
|
||||||
// Before stepping forward past MI, remember which regs were live
|
// Before stepping forward past MI, remember which regs were live
|
||||||
// before MI. This is needed to set the Undef flag only when reg is
|
// before MI. This is needed to set the Undef flag only when reg is
|
||||||
|
@ -1382,7 +1381,7 @@ static void UpdatePredRedefs(MachineInstr &MI, LivePhysRegs &Redefs) {
|
||||||
unsigned Reg = Clobber.first;
|
unsigned Reg = Clobber.first;
|
||||||
MachineOperand &Op = const_cast<MachineOperand&>(*Clobber.second);
|
MachineOperand &Op = const_cast<MachineOperand&>(*Clobber.second);
|
||||||
MachineInstr *OpMI = Op.getParent();
|
MachineInstr *OpMI = Op.getParent();
|
||||||
MachineInstrBuilder MIB(*OpMI->getParent()->getParent(), OpMI);
|
MachineInstrBuilder MIB(*OpMI->getMF(), OpMI);
|
||||||
if (Op.isRegMask()) {
|
if (Op.isRegMask()) {
|
||||||
// First handle regmasks. They clobber any entries in the mask which
|
// First handle regmasks. They clobber any entries in the mask which
|
||||||
// means that we need a def for those registers.
|
// means that we need a def for those registers.
|
||||||
|
|
|
@ -374,7 +374,7 @@ void LiveDebugValues::transferDebugValue(const MachineInstr &MI,
|
||||||
void LiveDebugValues::transferRegisterDef(MachineInstr &MI,
|
void LiveDebugValues::transferRegisterDef(MachineInstr &MI,
|
||||||
OpenRangesSet &OpenRanges,
|
OpenRangesSet &OpenRanges,
|
||||||
const VarLocMap &VarLocIDs) {
|
const VarLocMap &VarLocIDs) {
|
||||||
MachineFunction *MF = MI.getParent()->getParent();
|
MachineFunction *MF = MI.getMF();
|
||||||
const TargetLowering *TLI = MF->getSubtarget().getTargetLowering();
|
const TargetLowering *TLI = MF->getSubtarget().getTargetLowering();
|
||||||
unsigned SP = TLI->getStackPointerRegisterToSaveRestore();
|
unsigned SP = TLI->getStackPointerRegisterToSaveRestore();
|
||||||
SparseBitVector<> KillSet;
|
SparseBitVector<> KillSet;
|
||||||
|
@ -450,7 +450,7 @@ void LiveDebugValues::transferSpillInst(MachineInstr &MI,
|
||||||
VarLocMap &VarLocIDs,
|
VarLocMap &VarLocIDs,
|
||||||
SpillMap &Spills) {
|
SpillMap &Spills) {
|
||||||
unsigned Reg;
|
unsigned Reg;
|
||||||
MachineFunction *MF = MI.getParent()->getParent();
|
MachineFunction *MF = MI.getMF();
|
||||||
if (!isSpillInstruction(MI, MF, Reg))
|
if (!isSpillInstruction(MI, MF, Reg))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
@ -401,7 +401,7 @@ bool LocalStackSlotPass::insertFrameReferenceRegisters(MachineFunction &Fn) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
const MachineFunction *MF = MI.getParent()->getParent();
|
const MachineFunction *MF = MI.getMF();
|
||||||
const TargetRegisterClass *RC = TRI->getPointerRegClass(*MF);
|
const TargetRegisterClass *RC = TRI->getPointerRegClass(*MF);
|
||||||
BaseReg = Fn.getRegInfo().createVirtualRegister(RC);
|
BaseReg = Fn.getRegInfo().createVirtualRegister(RC);
|
||||||
|
|
||||||
|
|
|
@ -703,7 +703,7 @@ static LLT getTypeToPrint(const MachineInstr &MI, unsigned OpIdx,
|
||||||
}
|
}
|
||||||
|
|
||||||
void MIPrinter::print(const MachineInstr &MI) {
|
void MIPrinter::print(const MachineInstr &MI) {
|
||||||
const auto *MF = MI.getParent()->getParent();
|
const auto *MF = MI.getMF();
|
||||||
const auto &MRI = MF->getRegInfo();
|
const auto &MRI = MF->getRegInfo();
|
||||||
const auto &SubTarget = MF->getSubtarget();
|
const auto &SubTarget = MF->getSubtarget();
|
||||||
const auto *TRI = SubTarget.getRegisterInfo();
|
const auto *TRI = SubTarget.getRegisterInfo();
|
||||||
|
@ -854,8 +854,7 @@ static const char *getTargetFlagName(const TargetInstrInfo *TII, unsigned TF) {
|
||||||
void MIPrinter::printTargetFlags(const MachineOperand &Op) {
|
void MIPrinter::printTargetFlags(const MachineOperand &Op) {
|
||||||
if (!Op.getTargetFlags())
|
if (!Op.getTargetFlags())
|
||||||
return;
|
return;
|
||||||
const auto *TII =
|
const auto *TII = Op.getParent()->getMF()->getSubtarget().getInstrInfo();
|
||||||
Op.getParent()->getParent()->getParent()->getSubtarget().getInstrInfo();
|
|
||||||
assert(TII && "expected instruction info");
|
assert(TII && "expected instruction info");
|
||||||
auto Flags = TII->decomposeMachineOperandsTargetFlags(Op.getTargetFlags());
|
auto Flags = TII->decomposeMachineOperandsTargetFlags(Op.getTargetFlags());
|
||||||
OS << "target-flags(";
|
OS << "target-flags(";
|
||||||
|
@ -964,8 +963,8 @@ void MIPrinter::print(const MachineOperand &Op, const TargetRegisterInfo *TRI,
|
||||||
break;
|
break;
|
||||||
case MachineOperand::MO_TargetIndex:
|
case MachineOperand::MO_TargetIndex:
|
||||||
OS << "target-index(";
|
OS << "target-index(";
|
||||||
if (const auto *Name = getTargetIndexName(
|
if (const auto *Name =
|
||||||
*Op.getParent()->getParent()->getParent(), Op.getIndex()))
|
getTargetIndexName(*Op.getParent()->getMF(), Op.getIndex()))
|
||||||
OS << Name;
|
OS << Name;
|
||||||
else
|
else
|
||||||
OS << "<unknown>";
|
OS << "<unknown>";
|
||||||
|
@ -1029,7 +1028,7 @@ void MIPrinter::print(const MachineOperand &Op, const TargetRegisterInfo *TRI,
|
||||||
OS << "<mcsymbol " << *Op.getMCSymbol() << ">";
|
OS << "<mcsymbol " << *Op.getMCSymbol() << ">";
|
||||||
break;
|
break;
|
||||||
case MachineOperand::MO_CFIIndex: {
|
case MachineOperand::MO_CFIIndex: {
|
||||||
const MachineFunction &MF = *Op.getParent()->getParent()->getParent();
|
const MachineFunction &MF = *Op.getParent()->getMF();
|
||||||
print(MF.getFrameInstructions()[Op.getCFIIndex()], TRI);
|
print(MF.getFrameInstructions()[Op.getCFIIndex()], TRI);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1038,7 +1037,7 @@ void MIPrinter::print(const MachineOperand &Op, const TargetRegisterInfo *TRI,
|
||||||
if (ID < Intrinsic::num_intrinsics)
|
if (ID < Intrinsic::num_intrinsics)
|
||||||
OS << "intrinsic(@" << Intrinsic::getName(ID, None) << ')';
|
OS << "intrinsic(@" << Intrinsic::getName(ID, None) << ')';
|
||||||
else {
|
else {
|
||||||
const MachineFunction &MF = *Op.getParent()->getParent()->getParent();
|
const MachineFunction &MF = *Op.getParent()->getMF();
|
||||||
const TargetIntrinsicInfo *TII = MF.getTarget().getIntrinsicInfo();
|
const TargetIntrinsicInfo *TII = MF.getTarget().getIntrinsicInfo();
|
||||||
OS << "intrinsic(@" << TII->getName(ID) << ')';
|
OS << "intrinsic(@" << TII->getName(ID) << ')';
|
||||||
}
|
}
|
||||||
|
|
|
@ -111,7 +111,7 @@ void ilist_traits<MachineInstr>::removeNodeFromList(MachineInstr *N) {
|
||||||
assert(N->getParent() && "machine instruction not in a basic block");
|
assert(N->getParent() && "machine instruction not in a basic block");
|
||||||
|
|
||||||
// Remove from the use/def lists.
|
// Remove from the use/def lists.
|
||||||
if (MachineFunction *MF = N->getParent()->getParent())
|
if (MachineFunction *MF = N->getMF())
|
||||||
N->RemoveRegOperandsFromUseLists(MF->getRegInfo());
|
N->RemoveRegOperandsFromUseLists(MF->getRegInfo());
|
||||||
|
|
||||||
N->setParent(nullptr);
|
N->setParent(nullptr);
|
||||||
|
|
|
@ -311,7 +311,7 @@ bool MachineOperand::isIdenticalTo(const MachineOperand &Other) const {
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// Calculate the size of the RegMask
|
// Calculate the size of the RegMask
|
||||||
const MachineFunction *MF = getParent()->getParent()->getParent();
|
const MachineFunction *MF = getParent()->getMF();
|
||||||
const TargetRegisterInfo *TRI = MF->getSubtarget().getRegisterInfo();
|
const TargetRegisterInfo *TRI = MF->getSubtarget().getRegisterInfo();
|
||||||
unsigned RegMaskSize = (TRI->getNumRegs() + 31) / 32;
|
unsigned RegMaskSize = (TRI->getNumRegs() + 31) / 32;
|
||||||
|
|
||||||
|
@ -1055,7 +1055,7 @@ MachineInstr::mergeMemRefsWith(const MachineInstr& Other) {
|
||||||
if (CombinedNumMemRefs != uint8_t(CombinedNumMemRefs))
|
if (CombinedNumMemRefs != uint8_t(CombinedNumMemRefs))
|
||||||
return std::make_pair(nullptr, 0);
|
return std::make_pair(nullptr, 0);
|
||||||
|
|
||||||
MachineFunction *MF = getParent()->getParent();
|
MachineFunction *MF = getMF();
|
||||||
mmo_iterator MemBegin = MF->allocateMemRefsArray(CombinedNumMemRefs);
|
mmo_iterator MemBegin = MF->allocateMemRefsArray(CombinedNumMemRefs);
|
||||||
mmo_iterator MemEnd = std::copy(memoperands_begin(), memoperands_end(),
|
mmo_iterator MemEnd = std::copy(memoperands_begin(), memoperands_end(),
|
||||||
MemBegin);
|
MemBegin);
|
||||||
|
@ -1307,8 +1307,8 @@ MachineInstr::getRegClassConstraint(unsigned OpIdx,
|
||||||
const TargetInstrInfo *TII,
|
const TargetInstrInfo *TII,
|
||||||
const TargetRegisterInfo *TRI) const {
|
const TargetRegisterInfo *TRI) const {
|
||||||
assert(getParent() && "Can't have an MBB reference here!");
|
assert(getParent() && "Can't have an MBB reference here!");
|
||||||
assert(getParent()->getParent() && "Can't have an MF reference here!");
|
assert(getMF() && "Can't have an MF reference here!");
|
||||||
const MachineFunction &MF = *getParent()->getParent();
|
const MachineFunction &MF = *getMF();
|
||||||
|
|
||||||
// Most opcodes have fixed constraints in their MCInstrDesc.
|
// Most opcodes have fixed constraints in their MCInstrDesc.
|
||||||
if (!isInlineAsm())
|
if (!isInlineAsm())
|
||||||
|
@ -1669,7 +1669,7 @@ bool MachineInstr::isSafeToMove(AliasAnalysis *AA, bool &SawStore) const {
|
||||||
|
|
||||||
bool MachineInstr::mayAlias(AliasAnalysis *AA, MachineInstr &Other,
|
bool MachineInstr::mayAlias(AliasAnalysis *AA, MachineInstr &Other,
|
||||||
bool UseTBAA) {
|
bool UseTBAA) {
|
||||||
const MachineFunction *MF = getParent()->getParent();
|
const MachineFunction *MF = getMF();
|
||||||
const TargetInstrInfo *TII = MF->getSubtarget().getInstrInfo();
|
const TargetInstrInfo *TII = MF->getSubtarget().getInstrInfo();
|
||||||
const MachineFrameInfo &MFI = MF->getFrameInfo();
|
const MachineFrameInfo &MFI = MF->getFrameInfo();
|
||||||
|
|
||||||
|
|
|
@ -917,8 +917,8 @@ bool MachineLICM::IsLoopInvariantInst(MachineInstr &I) {
|
||||||
// However, if the physreg is known to always be caller saved/restored
|
// However, if the physreg is known to always be caller saved/restored
|
||||||
// then this use is safe to hoist.
|
// then this use is safe to hoist.
|
||||||
if (!MRI->isConstantPhysReg(Reg) &&
|
if (!MRI->isConstantPhysReg(Reg) &&
|
||||||
!(TRI->isCallerPreservedPhysReg(Reg, *I.getParent()->getParent())))
|
!(TRI->isCallerPreservedPhysReg(Reg, *I.getMF())))
|
||||||
return false;
|
return false;
|
||||||
// Otherwise it's safe to move.
|
// Otherwise it's safe to move.
|
||||||
continue;
|
continue;
|
||||||
} else if (!MO.isDead()) {
|
} else if (!MO.isDead()) {
|
||||||
|
@ -1191,7 +1191,7 @@ MachineInstr *MachineLICM::ExtractHoistableLoad(MachineInstr *MI) {
|
||||||
&LoadRegIndex);
|
&LoadRegIndex);
|
||||||
if (NewOpc == 0) return nullptr;
|
if (NewOpc == 0) return nullptr;
|
||||||
const MCInstrDesc &MID = TII->get(NewOpc);
|
const MCInstrDesc &MID = TII->get(NewOpc);
|
||||||
MachineFunction &MF = *MI->getParent()->getParent();
|
MachineFunction &MF = *MI->getMF();
|
||||||
const TargetRegisterClass *RC = TII->getRegClass(MID, LoadRegIndex, TRI, MF);
|
const TargetRegisterClass *RC = TII->getRegClass(MID, LoadRegIndex, TRI, MF);
|
||||||
// Ok, we're unfolding. Create a temporary register and do the unfold.
|
// Ok, we're unfolding. Create a temporary register and do the unfold.
|
||||||
unsigned Reg = MRI->createVirtualRegister(RC);
|
unsigned Reg = MRI->createVirtualRegister(RC);
|
||||||
|
|
|
@ -939,8 +939,7 @@ MachineOutliner::findCandidates(SuffixTree &ST, const TargetInstrInfo &TII,
|
||||||
// Emit a remark explaining why we didn't outline this candidate.
|
// Emit a remark explaining why we didn't outline this candidate.
|
||||||
std::pair<MachineBasicBlock::iterator, MachineBasicBlock::iterator> C =
|
std::pair<MachineBasicBlock::iterator, MachineBasicBlock::iterator> C =
|
||||||
RepeatedSequenceLocs[0];
|
RepeatedSequenceLocs[0];
|
||||||
MachineOptimizationRemarkEmitter MORE(
|
MachineOptimizationRemarkEmitter MORE(*(C.first->getMF()), nullptr);
|
||||||
*(C.first->getParent()->getParent()), nullptr);
|
|
||||||
MachineOptimizationRemarkMissed R(DEBUG_TYPE, "NotOutliningCheaper",
|
MachineOptimizationRemarkMissed R(DEBUG_TYPE, "NotOutliningCheaper",
|
||||||
C.first->getDebugLoc(),
|
C.first->getDebugLoc(),
|
||||||
C.first->getParent());
|
C.first->getParent());
|
||||||
|
|
|
@ -3353,7 +3353,7 @@ bool SwingSchedulerDAG::canUseLastOffsetValue(MachineInstr *MI,
|
||||||
unsigned BaseReg = MI->getOperand(BasePosLd).getReg();
|
unsigned BaseReg = MI->getOperand(BasePosLd).getReg();
|
||||||
|
|
||||||
// Look for the Phi instruction.
|
// Look for the Phi instruction.
|
||||||
MachineRegisterInfo &MRI = MI->getParent()->getParent()->getRegInfo();
|
MachineRegisterInfo &MRI = MI->getMF()->getRegInfo();
|
||||||
MachineInstr *Phi = MRI.getVRegDef(BaseReg);
|
MachineInstr *Phi = MRI.getVRegDef(BaseReg);
|
||||||
if (!Phi || !Phi->isPHI())
|
if (!Phi || !Phi->isPHI())
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -2653,7 +2653,7 @@ void GenericScheduler::initialize(ScheduleDAGMI *dag) {
|
||||||
void GenericScheduler::initPolicy(MachineBasicBlock::iterator Begin,
|
void GenericScheduler::initPolicy(MachineBasicBlock::iterator Begin,
|
||||||
MachineBasicBlock::iterator End,
|
MachineBasicBlock::iterator End,
|
||||||
unsigned NumRegionInstrs) {
|
unsigned NumRegionInstrs) {
|
||||||
const MachineFunction &MF = *Begin->getParent()->getParent();
|
const MachineFunction &MF = *Begin->getMF();
|
||||||
const TargetLowering *TLI = MF.getSubtarget().getTargetLowering();
|
const TargetLowering *TLI = MF.getSubtarget().getTargetLowering();
|
||||||
|
|
||||||
// Avoid setting up the register pressure tracker for small regions to save
|
// Avoid setting up the register pressure tracker for small regions to save
|
||||||
|
|
|
@ -363,7 +363,7 @@ bool CoalescerPair::setRegisters(const MachineInstr *MI) {
|
||||||
Flipped = true;
|
Flipped = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const MachineRegisterInfo &MRI = MI->getParent()->getParent()->getRegInfo();
|
const MachineRegisterInfo &MRI = MI->getMF()->getRegInfo();
|
||||||
|
|
||||||
if (TargetRegisterInfo::isPhysicalRegister(Dst)) {
|
if (TargetRegisterInfo::isPhysicalRegister(Dst)) {
|
||||||
// Eliminate DstSub on a physreg.
|
// Eliminate DstSub on a physreg.
|
||||||
|
|
|
@ -463,7 +463,7 @@ RegScavenger::spill(unsigned Reg, const TargetRegisterClass &RC, int SPAdj,
|
||||||
MachineBasicBlock::iterator &UseMI) {
|
MachineBasicBlock::iterator &UseMI) {
|
||||||
// Find an available scavenging slot with size and alignment matching
|
// Find an available scavenging slot with size and alignment matching
|
||||||
// the requirements of the class RC.
|
// the requirements of the class RC.
|
||||||
const MachineFunction &MF = *Before->getParent()->getParent();
|
const MachineFunction &MF = *Before->getMF();
|
||||||
const MachineFrameInfo &MFI = MF.getFrameInfo();
|
const MachineFrameInfo &MFI = MF.getFrameInfo();
|
||||||
unsigned NeedSize = TRI->getSpillSize(RC);
|
unsigned NeedSize = TRI->getSpillSize(RC);
|
||||||
unsigned NeedAlign = TRI->getSpillAlignment(RC);
|
unsigned NeedAlign = TRI->getSpillAlignment(RC);
|
||||||
|
@ -536,7 +536,7 @@ unsigned RegScavenger::scavengeRegister(const TargetRegisterClass *RC,
|
||||||
MachineBasicBlock::iterator I,
|
MachineBasicBlock::iterator I,
|
||||||
int SPAdj) {
|
int SPAdj) {
|
||||||
MachineInstr &MI = *I;
|
MachineInstr &MI = *I;
|
||||||
const MachineFunction &MF = *MI.getParent()->getParent();
|
const MachineFunction &MF = *MI.getMF();
|
||||||
// Consider all allocatable registers in the register class initially
|
// Consider all allocatable registers in the register class initially
|
||||||
BitVector Candidates = TRI->getAllocatableSet(MF, RC);
|
BitVector Candidates = TRI->getAllocatableSet(MF, RC);
|
||||||
|
|
||||||
|
|
|
@ -191,7 +191,7 @@ MachineInstr *TargetInstrInfo::commuteInstructionImpl(MachineInstr &MI,
|
||||||
MachineInstr *CommutedMI = nullptr;
|
MachineInstr *CommutedMI = nullptr;
|
||||||
if (NewMI) {
|
if (NewMI) {
|
||||||
// Create a new instruction.
|
// Create a new instruction.
|
||||||
MachineFunction &MF = *MI.getParent()->getParent();
|
MachineFunction &MF = *MI.getMF();
|
||||||
CommutedMI = MF.CloneMachineInstr(&MI);
|
CommutedMI = MF.CloneMachineInstr(&MI);
|
||||||
} else {
|
} else {
|
||||||
CommutedMI = &MI;
|
CommutedMI = &MI;
|
||||||
|
@ -438,7 +438,7 @@ static const TargetRegisterClass *canFoldCopy(const MachineInstr &MI,
|
||||||
assert(TargetRegisterInfo::isVirtualRegister(FoldReg) &&
|
assert(TargetRegisterInfo::isVirtualRegister(FoldReg) &&
|
||||||
"Cannot fold physregs");
|
"Cannot fold physregs");
|
||||||
|
|
||||||
const MachineRegisterInfo &MRI = MI.getParent()->getParent()->getRegInfo();
|
const MachineRegisterInfo &MRI = MI.getMF()->getRegInfo();
|
||||||
const TargetRegisterClass *RC = MRI.getRegClass(FoldReg);
|
const TargetRegisterClass *RC = MRI.getRegClass(FoldReg);
|
||||||
|
|
||||||
if (TargetRegisterInfo::isPhysicalRegister(LiveOp.getReg()))
|
if (TargetRegisterInfo::isPhysicalRegister(LiveOp.getReg()))
|
||||||
|
@ -763,7 +763,7 @@ void TargetInstrInfo::reassociateOps(
|
||||||
SmallVectorImpl<MachineInstr *> &InsInstrs,
|
SmallVectorImpl<MachineInstr *> &InsInstrs,
|
||||||
SmallVectorImpl<MachineInstr *> &DelInstrs,
|
SmallVectorImpl<MachineInstr *> &DelInstrs,
|
||||||
DenseMap<unsigned, unsigned> &InstrIdxForVirtReg) const {
|
DenseMap<unsigned, unsigned> &InstrIdxForVirtReg) const {
|
||||||
MachineFunction *MF = Root.getParent()->getParent();
|
MachineFunction *MF = Root.getMF();
|
||||||
MachineRegisterInfo &MRI = MF->getRegInfo();
|
MachineRegisterInfo &MRI = MF->getRegInfo();
|
||||||
const TargetInstrInfo *TII = MF->getSubtarget().getInstrInfo();
|
const TargetInstrInfo *TII = MF->getSubtarget().getInstrInfo();
|
||||||
const TargetRegisterInfo *TRI = MF->getSubtarget().getRegisterInfo();
|
const TargetRegisterInfo *TRI = MF->getSubtarget().getRegisterInfo();
|
||||||
|
@ -846,7 +846,7 @@ void TargetInstrInfo::genAlternativeCodeSequence(
|
||||||
SmallVectorImpl<MachineInstr *> &InsInstrs,
|
SmallVectorImpl<MachineInstr *> &InsInstrs,
|
||||||
SmallVectorImpl<MachineInstr *> &DelInstrs,
|
SmallVectorImpl<MachineInstr *> &DelInstrs,
|
||||||
DenseMap<unsigned, unsigned> &InstIdxForVirtReg) const {
|
DenseMap<unsigned, unsigned> &InstIdxForVirtReg) const {
|
||||||
MachineRegisterInfo &MRI = Root.getParent()->getParent()->getRegInfo();
|
MachineRegisterInfo &MRI = Root.getMF()->getRegInfo();
|
||||||
|
|
||||||
// Select the previous instruction in the sequence based on the input pattern.
|
// Select the previous instruction in the sequence based on the input pattern.
|
||||||
MachineInstr *Prev = nullptr;
|
MachineInstr *Prev = nullptr;
|
||||||
|
@ -870,7 +870,7 @@ void TargetInstrInfo::genAlternativeCodeSequence(
|
||||||
|
|
||||||
bool TargetInstrInfo::isReallyTriviallyReMaterializableGeneric(
|
bool TargetInstrInfo::isReallyTriviallyReMaterializableGeneric(
|
||||||
const MachineInstr &MI, AliasAnalysis *AA) const {
|
const MachineInstr &MI, AliasAnalysis *AA) const {
|
||||||
const MachineFunction &MF = *MI.getParent()->getParent();
|
const MachineFunction &MF = *MI.getMF();
|
||||||
const MachineRegisterInfo &MRI = MF.getRegInfo();
|
const MachineRegisterInfo &MRI = MF.getRegInfo();
|
||||||
|
|
||||||
// Remat clients assume operand 0 is the defined register.
|
// Remat clients assume operand 0 is the defined register.
|
||||||
|
@ -948,7 +948,7 @@ bool TargetInstrInfo::isReallyTriviallyReMaterializableGeneric(
|
||||||
}
|
}
|
||||||
|
|
||||||
int TargetInstrInfo::getSPAdjust(const MachineInstr &MI) const {
|
int TargetInstrInfo::getSPAdjust(const MachineInstr &MI) const {
|
||||||
const MachineFunction *MF = MI.getParent()->getParent();
|
const MachineFunction *MF = MI.getMF();
|
||||||
const TargetFrameLowering *TFI = MF->getSubtarget().getFrameLowering();
|
const TargetFrameLowering *TFI = MF->getSubtarget().getFrameLowering();
|
||||||
bool StackGrowsDown =
|
bool StackGrowsDown =
|
||||||
TFI->getStackGrowthDirection() == TargetFrameLowering::StackGrowsDown;
|
TFI->getStackGrowthDirection() == TargetFrameLowering::StackGrowsDown;
|
||||||
|
|
|
@ -866,7 +866,7 @@ MachineBasicBlock *
|
||||||
TargetLoweringBase::emitPatchPoint(MachineInstr &InitialMI,
|
TargetLoweringBase::emitPatchPoint(MachineInstr &InitialMI,
|
||||||
MachineBasicBlock *MBB) const {
|
MachineBasicBlock *MBB) const {
|
||||||
MachineInstr *MI = &InitialMI;
|
MachineInstr *MI = &InitialMI;
|
||||||
MachineFunction &MF = *MI->getParent()->getParent();
|
MachineFunction &MF = *MI->getMF();
|
||||||
MachineFrameInfo &MFI = MF.getFrameInfo();
|
MachineFrameInfo &MFI = MF.getFrameInfo();
|
||||||
|
|
||||||
// We're handling multiple types of operands here:
|
// We're handling multiple types of operands here:
|
||||||
|
|
|
@ -316,7 +316,7 @@ computeOutputLatency(const MachineInstr *DefMI, unsigned DefOperIdx,
|
||||||
// correctly append imp-use operands, and readsReg() strangely returns false
|
// correctly append imp-use operands, and readsReg() strangely returns false
|
||||||
// for predicated defs.
|
// for predicated defs.
|
||||||
unsigned Reg = DefMI->getOperand(DefOperIdx).getReg();
|
unsigned Reg = DefMI->getOperand(DefOperIdx).getReg();
|
||||||
const MachineFunction &MF = *DefMI->getParent()->getParent();
|
const MachineFunction &MF = *DefMI->getMF();
|
||||||
const TargetRegisterInfo *TRI = MF.getSubtarget().getRegisterInfo();
|
const TargetRegisterInfo *TRI = MF.getSubtarget().getRegisterInfo();
|
||||||
if (!DepMI->readsRegister(Reg, TRI) && TII->isPredicated(*DepMI))
|
if (!DepMI->readsRegister(Reg, TRI) && TII->isPredicated(*DepMI))
|
||||||
return computeInstrLatency(DefMI);
|
return computeInstrLatency(DefMI);
|
||||||
|
|
Loading…
Reference in New Issue