[llvm] [MachineOutliner] Remove LOHs from outlined candidates (PR #143617)
Ellis Hoag via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 12 16:28:28 PDT 2025
================
@@ -1075,6 +1076,23 @@ bool MachineOutliner::outline(
<< " B) > threshold (" << OutlinerBenefitThreshold
<< " B)\n");
+ // Remove all Linker Optimization Hints from the candidates since we did not
+ // check if the set of hints are the same for each of them.
+ // TODO: The intersection of the LOHs from all candidates should be legal in
+ // the outlined function.
+ SmallPtrSet<MachineInstr *, 2> MIs;
+ std::optional<size_t> MinRemovedLOHs;
+ for (Candidate &C : OF->Candidates) {
+ const TargetInstrInfo &TII = *C.getMF()->getSubtarget().getInstrInfo();
----------------
ellishg wrote:
Just moved it to TargetMachine anyway
https://github.com/llvm/llvm-project/pull/143617
More information about the llvm-commits
mailing list