[llvm] [MachineOutliner] Remove LOHs from outlined candidates (PR #143617)
Ellis Hoag via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 11 09:54:55 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:
I'm not sure how else to grab a `TargetInstrInfo` and this is how it does it later down in the function.
https://github.com/llvm/llvm-project/pull/143617
More information about the llvm-commits
mailing list