Skip to content

Commit 09fd2e0

Browse files
committed
[MachineOutlineer][NFC] Remove unnecessary RepeatedSequenceLocs.clear()
- When `getOutliningCandidateInfo()` returns `std::nullopt` (meaning no `OutlinedFunction` is created), there is no need to clear the input argument, `RepeatedSequenceLocs`, as it's already beaing cleared in the main loop of `findCandidates()`. - Replaced `2` by `MinRepeats` as I missed this instance from #105398
1 parent 5f2389d commit 09fd2e0

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
@@ -8990,7 +8990,7 @@ AArch64InstrInfo::getOutliningCandidateInfo(
89908990
NumBytesNoStackCalls <= RepeatedSequenceLocs.size() * 12) {
89918991
RepeatedSequenceLocs = CandidatesWithoutStackFixups;
89928992
FrameID = MachineOutlinerNoLRSave;
8993-
if (RepeatedSequenceLocs.size() < 2)
8993+
if (RepeatedSequenceLocs.size() < MinRepeats)
89948994
return std::nullopt;
89958995
} else {
89968996
SetCandidateCallInfo(MachineOutlinerDefault, 12);
@@ -9051,10 +9051,8 @@ AArch64InstrInfo::getOutliningCandidateInfo(
90519051
}
90529052

90539053
// If we dropped all of the candidates, bail out here.
9054-
if (RepeatedSequenceLocs.size() < MinRepeats) {
9055-
RepeatedSequenceLocs.clear();
9054+
if (RepeatedSequenceLocs.size() < MinRepeats)
90569055
return std::nullopt;
9057-
}
90589056
}
90599057

90609058
// Does every candidate's MBB contain a call? If so, then we might have a call
@@ -9079,10 +9077,8 @@ AArch64InstrInfo::getOutliningCandidateInfo(
90799077

90809078
if (ModStackToSaveLR) {
90819079
// We can't fix up the stack. Bail out.
9082-
if (!AllStackInstrsSafe) {
9083-
RepeatedSequenceLocs.clear();
9080+
if (!AllStackInstrsSafe)
90849081
return std::nullopt;
9085-
}
90869082

90879083
// Save + restore LR.
90889084
NumBytesToCreateFrame += 8;

0 commit comments

Comments
 (0)