Skip to content

Commit 140381d

Browse files
authored
[MachineOutliner][NFC] Remove unnecessary RepeatedSequenceLocs.clear() (#106171)
- When `getOutliningCandidateInfo()` returns `std::nullopt` (meaning no `OutlinedFunction` is created), there is no need to clear the input argument, `RepeatedSequenceLocs`, as it's already being cleared in the main loop of `findCandidates()`. - Replaced `2` by `MinRepeats`, which I missed from #105398
1 parent cc0f2d5 commit 140381d

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

llvm/lib/Target/AArch64/AArch64InstrInfo.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9003,7 +9003,7 @@ AArch64InstrInfo::getOutliningCandidateInfo(
90039003
NumBytesNoStackCalls <= RepeatedSequenceLocs.size() * 12) {
90049004
RepeatedSequenceLocs = CandidatesWithoutStackFixups;
90059005
FrameID = MachineOutlinerNoLRSave;
9006-
if (RepeatedSequenceLocs.size() < 2)
9006+
if (RepeatedSequenceLocs.size() < MinRepeats)
90079007
return std::nullopt;
90089008
} else {
90099009
SetCandidateCallInfo(MachineOutlinerDefault, 12);
@@ -9064,10 +9064,8 @@ AArch64InstrInfo::getOutliningCandidateInfo(
90649064
}
90659065

90669066
// If we dropped all of the candidates, bail out here.
9067-
if (RepeatedSequenceLocs.size() < MinRepeats) {
9068-
RepeatedSequenceLocs.clear();
9067+
if (RepeatedSequenceLocs.size() < MinRepeats)
90699068
return std::nullopt;
9070-
}
90719069
}
90729070

90739071
// Does every candidate's MBB contain a call? If so, then we might have a call
@@ -9092,10 +9090,8 @@ AArch64InstrInfo::getOutliningCandidateInfo(
90929090

90939091
if (ModStackToSaveLR) {
90949092
// We can't fix up the stack. Bail out.
9095-
if (!AllStackInstrsSafe) {
9096-
RepeatedSequenceLocs.clear();
9093+
if (!AllStackInstrsSafe)
90979094
return std::nullopt;
9098-
}
90999095

91009096
// Save + restore LR.
91019097
NumBytesToCreateFrame += 8;

0 commit comments

Comments
 (0)