]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/include/llvm/CodeGen/MacroFusion.h
Merge llvm, clang, lld, lldb, compiler-rt and libc++ r306325, and update
[FreeBSD/FreeBSD.git] / contrib / llvm / include / llvm / CodeGen / MacroFusion.h
1 //===- MacroFusion.h - Macro Fusion ------------------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 /// \file This file contains the definition of the DAG scheduling mutation to
11 /// pair instructions back to back.
12 //
13 //===----------------------------------------------------------------------===//
14
15 #include <functional>
16 #include "llvm/Target/TargetInstrInfo.h"
17 #include "llvm/CodeGen/MachineScheduler.h"
18
19 namespace llvm {
20
21 /// \brief Check if the instr pair, FirstMI and SecondMI, should be fused
22 /// together. Given SecondMI, when FirstMI is unspecified, then check if
23 /// SecondMI may be part of a fused pair at all.
24 typedef std::function<bool(const TargetInstrInfo &TII,
25                            const TargetSubtargetInfo &TSI,
26                            const MachineInstr *FirstMI,
27                            const MachineInstr &SecondMI)>  ShouldSchedulePredTy;
28
29 /// \brief Create a DAG scheduling mutation to pair instructions back to back
30 /// for instructions that benefit according to the target-specific
31 /// shouldScheduleAdjacent predicate function.
32 std::unique_ptr<ScheduleDAGMutation>
33 createMacroFusionDAGMutation(ShouldSchedulePredTy shouldScheduleAdjacent);
34
35 /// \brief Create a DAG scheduling mutation to pair branch instructions with one
36 /// of their predecessors back to back for instructions that benefit according
37 /// to the target-specific shouldScheduleAdjacent predicate function.
38 std::unique_ptr<ScheduleDAGMutation>
39 createBranchMacroFusionDAGMutation(ShouldSchedulePredTy shouldScheduleAdjacent);
40
41 } // end namespace llvm