diff --git a/llvm/include/llvm/CodeGen/MacroFusion.h b/llvm/include/llvm/CodeGen/MacroFusion.h --- a/llvm/include/llvm/CodeGen/MacroFusion.h +++ b/llvm/include/llvm/CodeGen/MacroFusion.h @@ -23,6 +23,8 @@ class ScheduleDAGMutation; class TargetInstrInfo; class TargetSubtargetInfo; +class ScheduleDAGInstrs; +class SUnit; /// Check if the instr pair, FirstMI and SecondMI, should be fused /// together. Given SecondMI, when FirstMI is unspecified, then check if @@ -32,6 +34,10 @@ const MachineInstr *FirstMI, const MachineInstr &SecondMI)>; +bool hasLessThanNumFused(const SUnit &SU, unsigned FuseLimit); +bool fuseInstructionPair(ScheduleDAGInstrs &DAG, SUnit &FirstSU, + SUnit &SecondSU); + /// Create a DAG scheduling mutation to pair instructions back to back /// for instructions that benefit according to the target-specific /// shouldScheduleAdjacent predicate function. diff --git a/llvm/lib/CodeGen/MacroFusion.cpp b/llvm/lib/CodeGen/MacroFusion.cpp --- a/llvm/lib/CodeGen/MacroFusion.cpp +++ b/llvm/lib/CodeGen/MacroFusion.cpp @@ -44,15 +44,15 @@ return nullptr; } -static bool hasLessThanNumFused(const SUnit &SU, unsigned FuseLimit) { +bool llvm::hasLessThanNumFused(const SUnit &SU, unsigned FuseLimit) { unsigned Num = 1; const SUnit *CurrentSU = &SU; while ((CurrentSU = getPredClusterSU(*CurrentSU)) && Num < FuseLimit) Num ++; return Num < FuseLimit; } -static bool fuseInstructionPair(ScheduleDAGInstrs &DAG, SUnit &FirstSU, - SUnit &SecondSU) { +bool llvm::fuseInstructionPair(ScheduleDAGInstrs &DAG, SUnit &FirstSU, + SUnit &SecondSU) { // Check that neither instr is already paired with another along the edge // between them. for (SDep &SI : FirstSU.Succs)