Skip to content

Commit 09aeee9

Browse files
committed
rename func
1 parent 30acec2 commit 09aeee9

File tree

5 files changed

+14
-9
lines changed

5 files changed

+14
-9
lines changed

llvm/include/llvm/CodeGen/TargetInstrInfo.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2184,9 +2184,12 @@ class LLVM_ABI TargetInstrInfo : public MCInstrInfo {
21842184
MachineBasicBlock::iterator &MIT,
21852185
unsigned Flags) const;
21862186

2187-
/// Remove all Linker Optimization Hints associated with instructions in
2188-
// \p MIs and \return the number of hints removed.
2189-
virtual size_t clearLOHs(const SmallPtrSetImpl<MachineInstr *> &MIs) const {
2187+
/// Remove all Linker Optimization Hints (LOH) associated with instructions in
2188+
/// \p MIs and \return the number of hints removed. This is useful in
2189+
/// transformations that cause these hints to be illegal, like in the machine
2190+
/// outliner.
2191+
virtual size_t clearLinkerOptimizationHints(
2192+
const SmallPtrSetImpl<MachineInstr *> &MIs) const {
21902193
return 0;
21912194
}
21922195

llvm/lib/CodeGen/MachineOutliner.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1086,7 +1086,7 @@ bool MachineOutliner::outline(
10861086
const TargetInstrInfo &TII = *C.getMF()->getSubtarget().getInstrInfo();
10871087
for (MachineInstr &MI : C)
10881088
MIs.insert(&MI);
1089-
size_t NumRemoved = TII.clearLOHs(MIs);
1089+
size_t NumRemoved = TII.clearLinkerOptimizationHints(MIs);
10901090
MIs.clear();
10911091
MinRemovedLOHs =
10921092
std::min(MinRemovedLOHs.value_or(NumRemoved), NumRemoved);

llvm/lib/Target/AArch64/AArch64InstrInfo.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9641,13 +9641,13 @@ AArch64InstrInfo::getOutlinableRanges(MachineBasicBlock &MBB,
96419641
return Ranges;
96429642
}
96439643

9644-
size_t
9645-
AArch64InstrInfo::clearLOHs(const SmallPtrSetImpl<MachineInstr *> &MIs) const {
9644+
size_t AArch64InstrInfo::clearLinkerOptimizationHints(
9645+
const SmallPtrSetImpl<MachineInstr *> &MIs) const {
96469646
if (MIs.empty())
96479647
return 0;
96489648
auto *MI = *MIs.begin();
96499649
auto *FuncInfo = MI->getMF()->getInfo<AArch64FunctionInfo>();
9650-
return FuncInfo->clearLOHs(MIs);
9650+
return FuncInfo->clearLinkerOptimizationHints(MIs);
96519651
}
96529652

96539653
outliner::InstrType

llvm/lib/Target/AArch64/AArch64InstrInfo.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,8 @@ class AArch64InstrInfo final : public AArch64GenInstrInfo {
493493
outliner::InstrType getOutliningTypeImpl(const MachineModuleInfo &MMI,
494494
MachineBasicBlock::iterator &MIT,
495495
unsigned Flags) const override;
496-
size_t clearLOHs(const SmallPtrSetImpl<MachineInstr *> &MIs) const override;
496+
size_t clearLinkerOptimizationHints(
497+
const SmallPtrSetImpl<MachineInstr *> &MIs) const override;
497498
SmallVector<
498499
std::pair<MachineBasicBlock::iterator, MachineBasicBlock::iterator>>
499500
getOutlinableRanges(MachineBasicBlock &MBB, unsigned &Flags) const override;

llvm/lib/Target/AArch64/AArch64MachineFunctionInfo.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,8 @@ class AArch64FunctionInfo final : public MachineFunctionInfo {
504504
LOHRelated.insert_range(Args);
505505
}
506506

507-
size_t clearLOHs(const SmallPtrSetImpl<MachineInstr *> &MIs) {
507+
size_t
508+
clearLinkerOptimizationHints(const SmallPtrSetImpl<MachineInstr *> &MIs) {
508509
size_t InitialSize = LOHContainerSet.size();
509510
erase_if(LOHContainerSet, [&](const auto &D) {
510511
return any_of(D.getArgs(), [&](auto *Arg) { return MIs.contains(Arg); });

0 commit comments

Comments
 (0)